SIGN IN SIGN UP

agentHost: add diagnostic tracing for session disconnect errors (#312078)

* agentHost: add diagnostic tracing for session disconnect errors

Add logging at key decision points to diagnose 'Session not found'
errors after WebSocket reconnect. The logs will reveal:

- Whether the stale in-memory SDK session is reused (cachedEntry=true)
- Whether isOutdated correctly detects clientId changes
- The exact error code from the SDK when send() fails
- Client disconnect/reconnect lifecycle with old/new clientIds

Also adds a retry path in sendMessage: if entry.send() fails with
code -32603, dispose the stale entry and retry via _resumeSession.

Also adds clientId comparison to ActiveClient.isOutdated() so the SDK
session is proactively refreshed when a different client takes over.

* Update src/vs/platform/agentHost/node/agentSideEffects.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
O
Osvaldo Ortega committed
a76a61ceb357833f9e996d453759ae5a75f0269d
Parent: 8cd56dd
Committed by GitHub <noreply@github.com> on 4/23/2026, 5:12:00 AM