Implement client-session routing for Agent Web Socket Server#2175
Draft
GeorgeNgMsft wants to merge 21 commits intomainfrom
Draft
Implement client-session routing for Agent Web Socket Server#2175GeorgeNgMsft wants to merge 21 commits intomainfrom
GeorgeNgMsft wants to merge 21 commits intomainfrom
Conversation
Set exit code instead of calling exit directly. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…be a critical exception
…icrosoft/TypeAgent into dev/georgeng/fix_as_easddr_use
…, rather than naive incremental retries
…icrosoft/TypeAgent into dev/georgeng/fix_as_easddr_use
…, IPC bridge) Implements /session slash commands (list, new, switch, rename, delete) in the renderer, a dropdown session selector in the chat header, and the main-process IPC bridge with a local backend stub for in-process dispatcher mode. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…om/microsoft/TypeAgent into dev/georgeng/websocket_session_map
Contributor
Author
|
This is a bigger change, we'll want to review this when working on the shell/browser extension clients |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
AgentWebSocketServer is a process-level singleton, but updateBrowserContext() was assigning its invoke handlers and connection/message callbacks as direct fields — overwriting them on every call. With multiple concurrent TypeAgent sessions, each new enable call would silently reroute all client traffic to the most recently activated session context, causing the wrong session to handle browser actions, web agent messages, and client connect/disconnect events.
Solution
Replace the shared callback fields with a Map<sessionId, SessionHandlers> so each session owns its own isolated handler set. Client connections are routed to the correct session by embedding sessionId in the WebSocket connection URL as a query parameter.
Notes
Added Architecture section documenting the WebSocket server, connection URL format, session routing, client type detection, and channel multiplexing