Home

mweinbach / agent-coworker

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

fix: preserve newer child-agent states during wait replay

6 months ago

5e1eb3e
Authored
mweinbach4/13/2026, 6:51:47 PM
The any/all wait change made  carry full agent snapshots, which exposed a stale-overwrite path in the server projector and desktop reducers. Agent summary merges now reject older snapshots so delayed wait results cannot roll a child back after a fresher agent_status has already been applied.

Constraint: The public wait contract needed to keep returning full latest snapshots for requested ids.
Rejected: Trim agent_wait_result back to terminal-only agents | would undo the orchestration semantics added in the previous change.
Confidence: high
Scope-risk: narrow
Directive: Any future consumer that folds agent summaries into state must preserve monotonicity by updatedAt or an equivalent causal order.
Tested: bun run typecheck; bun test
Not-tested: Remote MCP integration tests remain skipped by default.

Parentb6f45e8

5 files changed
  • apps/desktop/src/app/store.feedMapping.ts+30−1
  • apps/desktop/src/app/store.helpers/threadEventReducer.ts+1−6
  • apps/desktop/test/store-feed-mapping.test.ts+91−0
  • src/server/session/SessionSnapshotProjector.ts+29−0
  • test/sessionSnapshotProjector.test.ts+85−0