Summary
A Codex-backed thread emitted turn/completed while a command-execution item from that same turn was still running. The command later emitted output and item/completed after the terminal turn event. Every subsequent new-turn request then failed in one of two contradictory states:
thread <provider-thread> already has an active writer
No active codex session for thread <bb-thread>
Stopping the broken runtime and retrying the exact input did not recover the thread. Provider retry refused because the input had not been accepted, and edit-message could not apply because the rejected request was agent-origin rather than an editable user turn.
Native ordering evidence
For one exact turn/provider-thread:
item/started for a long-running commandExecution.
turn/completed with status=completed.
item/commandExecution/outputDelta for the still-running command.
item/completed for that command, reporting success and a multi-minute duration.
- A later
client/turn/requested was rejected as already has an active writer.
- A recovery new-turn request was rejected as
No active codex session.
- A further exact redelivery again rejected as
already has an active writer.
This is a native event/state contradiction: the turn was publicly terminal before all of its writer-owned items terminalized, leaving BB and the provider bridge disagreeing about whether a session/writer existed.
Expected behavior
- Do not emit
turn/completed until every command/tool/item belonging to that turn is terminal and no turn writer remains.
- If a provider sends premature completion, BB should delay/fail the terminal event or reconcile outstanding items deterministically.
- A terminal thread must not simultaneously report both active-writer and no-active-session states.
- Stop/restart should clear any orphaned writer ownership without deleting event history or replaying rejected input.
- Rejected agent-origin requests need a supported exact-redelivery recovery path; edit-message is not applicable.
Acceptance
- A fixture delays command completion beyond provider turn completion; BB does not publish terminal completion first.
- After true terminalization, one new-turn request is accepted exactly once.
- Stop/restart clears stale writer ownership while preserving interruption/history.
- Tests cover the contradictory
already has an active writer / No active codex session sequence and prove it cannot persist.
No repository or canonical-state mutation is needed to reproduce; this report is based on bounded native event reads.
Summary
A Codex-backed thread emitted
turn/completedwhile a command-execution item from that same turn was still running. The command later emitted output anditem/completedafter the terminal turn event. Every subsequent new-turn request then failed in one of two contradictory states:thread <provider-thread> already has an active writerNo active codex session for thread <bb-thread>Stopping the broken runtime and retrying the exact input did not recover the thread. Provider retry refused because the input had not been accepted, and edit-message could not apply because the rejected request was agent-origin rather than an editable user turn.
Native ordering evidence
For one exact turn/provider-thread:
item/startedfor a long-runningcommandExecution.turn/completedwithstatus=completed.item/commandExecution/outputDeltafor the still-running command.item/completedfor that command, reporting success and a multi-minute duration.client/turn/requestedwas rejected asalready has an active writer.No active codex session.already has an active writer.This is a native event/state contradiction: the turn was publicly terminal before all of its writer-owned items terminalized, leaving BB and the provider bridge disagreeing about whether a session/writer existed.
Expected behavior
turn/completeduntil every command/tool/item belonging to that turn is terminal and no turn writer remains.Acceptance
already has an active writer/No active codex sessionsequence and prove it cannot persist.No repository or canonical-state mutation is needed to reproduce; this report is based on bounded native event reads.