Let a resumed turn carry on without a new prompt. - #4
Open
moedash wants to merge 1 commit into
Open
Conversation
An external driver that retries a turn after a crash has nothing to send: the prompt is already in the rollout, and sending it again asks the same thing twice. The empty-input turn that turn/start already supports does the right thing, so this exposes it through the CLI and the SDK rather than adding a mechanism.
3 tasks
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.
What changed?
codex exec resume <id> --continueruns a turn with no new user message, andThread.continueTurn()/Thread.continueTurnStreamed()do the same from the TypeScript SDK.The flag maps to the empty-input
turn/startthat already exists and is already tested. The SDK method reuses the turn collector thatrun()had, extracted into a privatecollect().Why?
An external driver that retries a turn after a crash has nothing to send: the prompt is already in the rollout, and sending it again asks the model the same thing twice.
Empty input already does the right thing at the protocol level, so this is about reach rather than mechanism:
codex exec resumealways resolves a prompt, falling back to stdin and erroring when nothing is piped, so there was no way to get at it from the CLI or the SDK.How did you test it?
Two CLI tests cover the flag parsing and its conflict with a prompt.
cargo test -p codex-exec --libis 63/0.End to end: ran a thread, interrupted it, and carried the turn on with
--continue. The rollout holds one copy of the prompt, so it was not asked twice.