Skip to content

Stopped panicking on a tool call that never reported a result. - #3

Open
moedash wants to merge 1 commit into
mainfrom
moe/fix-missing-output-panic
Open

Stopped panicking on a tool call that never reported a result.#3
moedash wants to merge 1 commit into
mainfrom
moe/fix-missing-output-panic

Conversation

@moedash

@moedash moedash commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

What changed?

ensure_call_outputs_present fills in a missing tool output quietly for every kind of call. It previously called error_or_panic for a custom tool call and a local shell call, which panics in a debug build.

Why?

Code mode dispatches custom tool calls, so this is the ordinary case rather than an edge one. Kill codex during a tool and the thread could not be resumed at all: the panic took the runtime worker down while the process stayed alive holding the thread's writer lock, and every later resume then failed with already has an active writer. A release build only logged the error and carried on, so the two builds disagreed about whether this was recoverable.

A tool call with no result is expected, not a defect. An interrupt or a crash between dispatching a tool and writing its result leaves the call alone in the transcript, and a resumed thread has to be able to send that history to the model. The recovery code already sat directly after the panic, which is the tell.

How did you test it?

  • Unit Tests
  • Staging
  • End to End Tests

The two tests that asserted the panic now assert the filled-in output instead. cargo test -p codex-core --lib context_manager:: is 68/0.

End to end: crashed codex mid tool call and resumed the thread, which now completes instead of panicking.

Filling in a missing tool output was quiet for a function call but called error_or_panic for a
custom tool call or a local shell call, which panics in a debug build. Code mode dispatches
custom tool calls, so that is the ordinary case rather than an edge one: kill codex during a
tool and the thread could not be resumed at all, because the panic took the runtime worker down
while the process stayed alive holding the thread's writer lock.

A gap there is expected, not a defect. The recovery code already sat directly after the panic,
which is the tell.
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.

1 participant