Home

mweinbach / agent-coworker

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

Harden persistence, parsing, and protocol handling

8 months ago

7e6df6d
Authored
mweinbach2/23/2026, 6:17:06 PM
Improve robustness across desktop, server, and CLI subsystems: sanitize and backward-compatibly load persisted desktop state, skip invalid workspaces/orphan threads, and recover from invalid JSON on disk; make transcript reading resilient to malformed lines and map legacy reasoning aliases into the feed; relax OAuth/device flow parsing for forward-compatible extra fields; make MCP auth-store and CLI state reads recover from malformed files and rewrite sanitized state; change set_model / set_enable_mcp persistence failures to apply runtime updates (fail-open) while emitting non-fatal internal_error events; add/expand tests for state recovery, transcript parsing, websocket server-event parsing, binary client decode, and auth-store behavior; update websocket protocol docs and bump server_hello.protocolVersion to 7.0.

Parenta35e377

22 files changed
  • apps/desktop/electron/services/persistence.ts+94−86
  • apps/desktop/src/app/store.actions/thread.ts+21−8
  • apps/desktop/src/app/store.feedMapping.ts+20−2
  • apps/desktop/src/lib/desktopSchemas.ts+36−5
  • apps/desktop/test/desktop-schemas.test.ts+53−0
  • apps/desktop/test/persistence-state-sanitization.test.ts+103−63
  • apps/desktop/test/thread-reconnect.test.ts+28−10
apps/desktop/test/ws-protocol-parse.test.ts
+62
−0
  • docs/websocket-protocol.md+6−4
  • src/cli/repl/stateStore.ts+6−4
  • src/mcp/authStore/store.ts+15−4
  • src/providers/codex-oauth-flows.ts+2−2
  • src/server/session/ProviderAuthManager.ts+17−9
  • src/server/session/mcp/McpRegistryFlow.ts+12−3
  • tasks/todo.md+29−0
  • test/agentSocket.parse.test.ts+60−0
  • test/connect.test.ts+42−12
  • test/decode-client-message.test.ts+54−0
  • test/mcp.auth-store.test.ts+14−14
  • test/repl.state-store.test.ts+72−0
  • test/server.test.ts+18−4
  • test/session.test.ts+9−10