Report selected environment connection transitions (#33251)

## What changed

- Track connected and disconnected states across initial remote exec-server connections and reconnection attempts.
- Emit experimental `thread/environment/connected` and `thread/environment/disconnected` app-server notifications for each thread selecting the environment. Each payload identifies the thread and environment; current state is not replayed when a thread starts.
- Stop forwarding connection events when an environment selection is removed or replaced.

## Testing

- Cover connection, disconnection, reconnection, shared-environment notifications, and replacement of a selected environment.

GitOrigin-RevId: 5dd767372363c4a2a8319fc16164be117d5bd20c
This commit is contained in:
sayan-oai authored and copyberry committed 2026-07-15 05:21:13 +00:00
1 parent 8aae858958
commit 3afbd8dd45
28 files changed
+672 -32

No files matched your search

+3 -3
View File
@@ -298,7 +298,7 @@ impl Inner {
ConnectionStatus::Connected(current)
if Arc::ptr_eq(current, &failed_rpc_client) =>
{
connection.status = ConnectionStatus::Recovering;
connection.set_status(ConnectionStatus::Recovering);
true
}
ConnectionStatus::Connected(_)
@@ -411,7 +411,7 @@ impl Inner {
{
false
} else {
connection.status = ConnectionStatus::Connected(rpc_client);
connection.set_status(ConnectionStatus::Connected(rpc_client));
true
}
};
@@ -512,7 +512,7 @@ impl Inner {
match &connection.status {
ConnectionStatus::Failed(existing) => (existing.clone(), false),
ConnectionStatus::Connected(_) | ConnectionStatus::Recovering => {
connection.status = ConnectionStatus::Failed(message.clone());
connection.set_status(ConnectionStatus::Failed(message.clone()));
(message, true)
}
}