Home

mweinbach / agent-coworker

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

fix: make child-agent waits predictable across timeouts

6 months ago

b6f45e8
Authored
mweinbach4/13/2026, 6:42:02 PM
StatusBus wait results now support explicit any/all semantics and always return the latest known status snapshot for every requested child. The tool, session, JSON-RPC, websocket, raw-loop, and desktop parsing layers all default omitted mode to any while exposing readyAgentIds for consumers that need the terminal subset.

Constraint: Omitted wait mode had to remain backward compatible with the previous first-ready behavior.
Rejected: Add separate waitAny/waitAll APIs | would duplicate the tool and protocol surface for one behavior family.
Confidence: high
Scope-risk: moderate
Directive: Consumers that need terminal-only children should key off readyAgentIds instead of assuming agent_wait_result.agents are terminal-only.
Tested: bun run typecheck; bun test
Not-tested: Remote MCP integration tests remain skipped by default.

Parentbd63097

27 files changed
  • apps/desktop/src/lib/wsProtocol.ts+11−7
  • docs/generated/websocket-jsonrpc.d.ts+5−5
  • docs/generated/websocket-jsonrpc.schema.json+1−1
  • docs/websocket-protocol.md+16−6
  • scripts/run_raw_agent_loops.ts+2−2
  • src/server/agents/AgentControl.ts+3−2
  • src/server/agents/StatusBus.ts+24−13
  • src/server/agents/types.ts+11
−0
  • src/server/jsonrpc/routes/agents.ts+12−9
  • src/server/jsonrpc/schema.agents.ts+21−9
  • src/server/protocol.ts+4−1
  • src/server/session/AgentSession.ts+3−2
  • src/server/session/SessionAdminManager.ts+8−3
  • src/server/session/SessionContext.ts+3−1
  • src/server/session/TurnExecutionManager.ts+2−1
  • src/tools/context.ts+3−6
  • src/tools/persistentAgents.ts+6−4
  • test/agentControl.test.ts+5−0
  • test/harness.ws.e2e.test.ts+2−1
  • test/helpers/wsHarness.ts+1−0
  • test/jsonrpc.control-schemas.test.ts+56−1
  • test/persistentAgents.tool.test.ts+6−2
  • test/run_raw_agent_loops.test.ts+2−0
  • test/session.test.ts+1−1
  • test/spawnAgent.tool.test.ts+4−4
  • test/statusBus.test.ts+122−7
  • test/tools.test.ts+5−1