Retry Codex messages across turn boundaries - #2
Merged
Conversation
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.
Related issue
N/A
Summary
Fixes a timing race when someone sends a follow-up just as Codex finishes its previous answer. The runner could accept the follow-up while Codex was closing the old turn, then the app would show
codex_input_not_acceptedand ask the person to retry manually.ELI5: the message arrived while one door was closing. Omnigent now waits for that door to close and automatically sends the same message through the next open door. The original pending bubble stays visible until Codex confirms receipt.
The retry is capped at one attempt. Duplicate terminal notifications are idempotent, and if Codex genuinely cannot accept the retried message, Omnigent preserves it in history with a clear error instead of losing it.
Test Plan
python -m pytest tests/runtime/test_pending_inputs.py -q(17 passed)python -m pytest tests/server/integration/test_sessions_endpoints.py -q(197 passed)pre-commit run --files omnigent/runtime/pending_inputs.py omnigent/server/routes/sessions.py tests/runtime/test_pending_inputs.py tests/server/integration/test_sessions_endpoints.pyDemo
N/A — backend lifecycle fix with automated regression coverage.
Type of change
Test coverage
Coverage notes
The full sessions endpoint integration suite passed, covering message persistence, native transcript ownership, status publication, and runner forwarding around this path.
Changelog
Messages sent as a Codex reply finishes are now retried automatically instead of being rejected with a manual retry error.