2 months ago
3cb50e3The 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