Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

fix(desktop): gate workspace JSON-RPC socket on generation

7 months ago

0579dab
Authored
mweinbach3/22/2026, 6:12:09 PM
Replace map-entry identity checks with per-workspace socket generation so
retired sockets cannot clear control state, disconnect threads, or route
events after URL swap or explicit workspace teardown.

- Track workspaceJsonRpcSocketGenerations in RUNTIME; bump on URL change
  and workspace remove/restart
- Stamp sockets and gate onOpen/onClose/onNotification/onServerRequest
- Extend control-socket, thread-reconnect, and protocol-v2-events tests

Made-with: Cursor

Parent7109c51

8 files changed
  • apps/desktop/src/app/store.actions/workspace.ts+5−0
  • apps/desktop/src/app/store.helpers.ts+6−0
  • apps/desktop/src/app/store.helpers/jsonRpcSocket.ts+25−6
  • apps/desktop/src/app/store.helpers/runtimeState.ts+16−0
  • apps/desktop/test/control-socket.test.ts+2−0
  • apps/desktop/test/protocol-v2-events.test.ts+81−0
  • apps/desktop/test/thread-reconnect.test.ts+57−0
  • tasks/todo.md+16−0