Home

mweinbach / agent-coworker

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

fix: settle pre-ack codex turn/completed notifications that omit threadId

2 months ago

3cb50e3
Authored
Max Weinbach7/14/2026, 1:20:46 PM
The turn/start response and turn/completed notification can coalesce into
one stdout chunk, routing the completion before the response continuation
records the turn id. In that window the guard compared undefined !==
threadId and silently dropped the completion, stranding the turn until
the 30-minute timeout. Pre-ack, only a positively mismatched threadId now
marks a completion as foreign - matching the tolerance the known-turn-id
branch and the tokenUsage handler already have. The real app-server
always sends threadId, so conforming filtering is unchanged; the pinned
pre-ack test keeps its wrong-thread case and the threadless case moves to
a new regression test that drives the exact window.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Parentf773583

2 files changed
  • src/runtime/codexAppServer/notifications.ts+6−1
  • test/runtime/codex-app-server/turn.test.ts+76−42