Skip to content

Permit Codex delivery after terminal errors - #273

Merged
myobie merged 1 commit into
mainfrom
agent/issue-264-codex-error-delivery
Aug 23, 2026
Merged

Permit Codex delivery after terminal errors#273
myobie merged 1 commit into
mainfrom
agent/issue-264-codex-error-delivery

Conversation

@myobie

@myobie myobie commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Keep systemError held until the failed turn completes.
  • Convert the completed error to TerminalError { SystemError }.
  • Permit turn/start from that terminal diagnostic.
  • Keep notLoaded, review, compaction, human-wait, and conflicting-turn states blocked.
  • Add a focused deadlock regression.
  • Add a payload-minimized replay of all 23 inbound frames from the docs(vrs): record observed harness state experiments #263 usage-limit capture.
  • State the provider-native delivery rule in the Codex harness specification.

Why

Codex and st2 deadlock after a terminal system error. Codex clears the error only when a new turn starts. st2 refuses to start a turn while it holds SystemError. Each side waits for the action that only the other side can cause.

#270 fixed the false ConflictingTurn label. It correctly preserved the provider's reported SystemError, but it left the delivery gate shut.

The provider sends no later signal that can open that gate:

The upstream system_error_sets_idle_flag_until_next_turn test never asserts Idle. It asserts SystemError, starts the next turn, and then asserts Active.

Recorder limit

The two #263 capture files stop at turn/completed and have the same method sequence. Their endings cannot prove that Codex omits a later idle event. The replay test pins only the st2 state at that recorder boundary. The provider source above proves that no later idle notification arrives.

User impact

A failed Codex turn no longer wedges native inbox delivery. The next unread message can start the turn that clears the provider error.

Validation

  • cargo test -p st2 --lib codex_app_server::tests -- --nocapture: 40 passed.
  • cargo test -p st2 --lib -- --nocapture: 327 passed.
  • git diff --check origin/main...HEAD: passed.

Fixes #264

myobie commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

@schickling, was this close deliberate, or was it repository tidy-up?

If it was deliberate, what fix shape would you accept for #264 instead?

Should I continue with the unrelated draft #276? I will follow your preference.

@schickling schickling reopened this Aug 19, 2026
@myobie
myobie force-pushed the agent/issue-264-codex-error-delivery branch from c056cdf to 2567e7c Compare August 23, 2026 13:07
@myobie
myobie merged commit e848f1d into main Aug 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A failed Codex turn is reported as two conflicting turns and stops accepting messages until the next idle

2 participants