From 3b478e69dcbe8e416ddd46f0e24156392d4e71da Mon Sep 17 00:00:00 2001 From: akbash Date: Mon, 14 Sep 2026 01:11:07 +0300 Subject: fix: scope agent views to the selected machine (#3784) * fix: scope agent views to the selected machine refs #3732 * fix: preserve stable agent view ordering refs #3732 --------- Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com> Co-authored-by: JJ Liebig --- src/client/mod.rs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/client/mod.rs') diff --git a/src/client/mod.rs b/src/client/mod.rs index 36174064..8775ac19 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -421,6 +421,17 @@ async fn run_client_loop( .as_ref() .and_then(|(_, handshake)| handshake.endpoint_methods.clone()), ); + shell.set_endpoint_agent_view_projection_supported( + &endpoint::ClientEndpointId::Local, + initial + .as_ref() + .and_then(|(_, handshake)| handshake.endpoint_capabilities.as_ref()) + .is_some_and(|capabilities| { + capabilities.iter().any(|capability| { + capability == crate::protocol::endpoint::AGENT_VIEW_PROJECTION_CAPABILITY + }) + }), + ); if local_unavailable { shell.set_endpoint_status( &endpoint::ClientEndpointId::Local, @@ -1157,8 +1168,15 @@ async fn run_client_loop( ) { continue; } + let agent_view_projection_supported = negotiation.supports_capability( + crate::protocol::endpoint::AGENT_VIEW_PROJECTION_CAPABILITY, + ); let frame = state.shell.as_mut().and_then(|shell| { shell.set_endpoint_methods_for(&endpoint_id, Some(negotiation.methods())); + shell.set_endpoint_agent_view_projection_supported( + &endpoint_id, + agent_view_projection_supported, + ); shell.compose(state.reported_size.0, state.reported_size.1) }); let reader_quit = writer.stop_handle(); @@ -1829,6 +1847,18 @@ async fn run_client_loop( } let snapshot = match endpoint::decode_endpoint_control(&kind, &data) { Ok(endpoint::EndpointControlMessage::HealthPong) => continue, + Ok(endpoint::EndpointControlMessage::AgentViewProjection( + projection, + )) => { + if let Some(shell) = state.shell.as_mut() { + shell.set_endpoint_agent_view_projection_for_generation( + &endpoint_id, + generation, + projection, + ); + } + continue; + } Ok(endpoint::EndpointControlMessage::Ignored) => { debug!(%kind, "ignoring unknown endpoint control message"); continue; -- cgit v1.2.3