Require Codex turn-completion evidence before reporting trigger success - #13
Draft
motonari728 wants to merge 49 commits into
Draft
Require Codex turn-completion evidence before reporting trigger success#13motonari728 wants to merge 49 commits into
motonari728 wants to merge 49 commits into
Conversation
Codex 0.153.2 emits an OSC 9 notification when a turn completes (agent-turn-complete). Previously, triggerCodex sent Ctrl-C as early as 4 seconds simply because the initial TUI screen rendering went quiet, terminating the process before Codex finished session initialization and submitted the prompt. By passing: -c tui.notifications=["agent-turn-complete"] -c tui.notification_method="osc9" -c tui.notification_condition="always" we can deterministically detect turn completion even in a focused PTY environment. In addition: - Fallback TERM to xterm-256color if unset or dumb, preventing TUI launch failures under cron or non-interactive daemon environments. - Maintain the 45s timeout fallback as a safety net. - Add regression test using mock codex script without external quotas. - Document the notification flags and updated output in README.
In Codex 0.153.2, selecting gpt-5.4-mini displays an interactive model migration dialog on startup, preventing automated turns from starting when relying on the default model without explicit configuration. Update the default Codex model from gpt-5.4-mini to gpt-5.6-luna in the built-in config defaults, template TOML, documentation, and tests.
# Conflicts: # README.md # README.zh-CN.md
# Conflicts: # README.md # README.zh-CN.md # docs/window-verification.md
# Conflicts: # README.md # README.zh-CN.md
# Conflicts: # .github/workflows/ci.yml
Open
7 tasks
…completion # Conflicts: # internal/cli/i18n.go # internal/provider/provider.go
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.
Summary
This PR bridges #11's Codex/Spark TUI completion detection and #12's quota verification and result reporting.
The changes are split this way so that #11 and #12 remain independently reviewable and mergeable. This PR connects their behavior, so parts of the problem and solution intentionally overlap with those PRs.
This PR cannot be merged on its own: both #11 and #12 must land first.
Kept as a draft until those prerequisites are merged. The current diff against
mainincludes both prerequisite PRs; afterward, it should show only the bridging changes. Maintainers: once #11 and #12 are merged and the diff is correct, please mark this PR ready for review and review it. If the prerequisites are squash-merged or rebased, this branch may need to be updated first to remove their changes from GitHub's comparison.Problem
A Codex TUI timeout or a clean exit without a completion notification can be reported as success even though turn completion was not confirmed.
When a completion notification and process exit arrive together, their handling order can also produce inconsistent results: a completed turn may be missed, or a process failure may be reported as success.
Solution
Claude behavior and quota scheduling/retry rules are unchanged.
Checks
gofmt -l .prints nothinggo build ./...go vet ./...go test ./...(also tested with-race)Safety