Codex owns the retry - #195
Merged
Merged
Conversation
A codex error notification says whether codex is retrying the turn itself, and the daemon ignored it: any message containing one of eight substrings was retried, will_retry or not. A response that completes carrying no assistant message is reported that way and is an ordinary thing to return, so one message became six turns, each under a new id, backing off 1s 2s 4s 8s, every one of them asking the same question and getting the same answer. A transient notification codex has stopped retrying now ends the turn the way an empty turn ends: nothing posted, message acked, one line logged. While codex is retrying, the daemon still resyncs behind it, and a notification matching none of the terms is still terminal.
vitramir
force-pushed
the
fix/codex-owns-its-retries
branch
from
August 19, 2026 03:31
030fc6c to
add2fae
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A codex error notification carries
will_retry— whether codex is retrying the turn itself. The daemon parsed it, logged it, and then ignored it, deciding instead by substring:What that cost
A response that completes carrying no assistant message is reported as
stream disconnected before completionwithwill_retry=false. That is an ordinary thing for a model to return — captured live on a platform VM, every stream reaching the proxy endedresponse.completedwith zerooutput_text.deltaevents, and metering recorded themsuccesswith real output tokens.The daemon matched
"stream disconn", overruled codex, and restarted the turn under a new id. Same request, same answer, again — six turns for one message, backing off 1s, 2s, 4s, 8s, ending inproduced no text:Change
will_retry=truewill_retry=falseScoped to the transient class on purpose: gating on
will_retryalone also swallows notifications matching none of the terms, which an existing test caught, so those stay terminal.Not in this PR
retryableCodexErrorNotificationTermsis an allowlist, so a transient failure codex words differently still exits the daemon.will_retryanswers that half too and would retire the list entirely — worth doing, deliberately not widened here.