GeezerVison is showing github.com — fix(server): a Codex steer no longer hangs when its session closes during a capacity retry by only21mil · Pull Request #32706 · pingdotgg/t3code
Conversation
only21mil
commented
Nov 7, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Problem
A steer sent to a Codex turn can wait on one of two background steps: the backoff before a capacity retry (serverOverloaded), or the 5 s grace before Codex continues a /goal turn. Both steps are forked into the session's scope. If the session closes during the capacity-retry backoff, the step is interrupted and never settles the Deferred the steer is waiting on. The steer then waits forever. The goal grace gets the same guard. When the Codex app-server really exits during the grace, main already releases that hold through interruptTurn, so there the guard matters only when the session scope closes without that cleanup, as in the replay tests.
The steer runs in the effect worker, and the outbox runs one effect at a time per thread. A hung steer can therefore also hold up that thread's later effects, Stop included, until the server restarts.
To reproduce on main: start a Codex turn, let it fail with serverOverloaded so a retry is scheduled, send a steer, then close the session during the backoff. The steer never settles.
Change
Both background steps now settle their Deferred with undefined when they are interrupted (Effect.onInterrupt on the forked fiber in CodexAdapterV2.ts). undefined already means "no next turn": the normal paths use it when a retry or goal continuation does not happen. The steer then fails at once with the existing "is not active and cannot be steered" error.
Two more cases are covered. The setup from registering each wait through the fork runs uninterruptibly, so a session close is seen only after the fork. And when the session scope is already closed, forkIn returns a fiber that never starts, so the setup settles the Deferred right after the fork when the fiber has already ended.
steerTurn itself is unchanged. Deferred.succeed on a Deferred that is already done does nothing, so the normal retry and goal paths behave as before.
This fixes the cause instead of adding a timeout to steerTurn. A timeout would have to be longer than the 30 s maximum backoff, and the Deferred would still never settle.
Scope and approval
This is a very small, focused fix for an obvious bug: a request that never returns. The source change is about 25 lines in one file, it adds no setting or behavior, and it only affects the Codex adapter. Other adapters have no capacity-retry or goal-hold wait.
Prior PRs: #25611 added the capacity retry and the steer's wait on it. #31060 changes only interruptTurn's handling of the same retry, and #26357 changes how skills are sent mid-turn; neither touches steerTurn's waits or the fibers that settle them. #23842 reworks the 429 retry path but does not settle the wait when the session closes.
Verification
Four cases in CodexAdapterV2.test.ts, all on it.effect with the TestClock and a replayed Codex transcript (no real provider):
- two rows in the existing
handles terminal Codex capacity failures when retries %s table: steer-session-closed (the steer is waiting during the 2 s backoff, then the session scope closes) and steer-session-closing (the session scope starts closing before the retry is scheduled);
fails a steer held for the next goal turn when the session closes %s, with during the grace and as the turn completes.
Each case checks that the steer fails with ProviderAdapterSteerRunError wrapping the "is not active and cannot be steered" protocol error. The wait is bounded by 1 virtual minute, so main fails with a TimeoutError instead of hanging the run.
On main's CodexAdapterV2.ts with the new tests, the new cases fail because the steer is still waiting:

With the fix, they pass:

vp test run src/orchestration-v2/Adapters/CodexAdapterV2.test.ts (from apps/server): 149 passed.
vp run check:changed 25bf84ab07f53f141c20239c63e383823a9d5ea0: format, lint, knip, typecheck (3 packages) and tests (2 files, 151 tests) pass.
No screen changes: this only changes when a server-side steer request returns, so the captures above are test runs.
Not checked:
- A real app-server exit during the capacity backoff. A real exit during the goal grace was tested in maria-rcks's run: the held steer failed with the existing "is not active and cannot be steered" error, and its effect ended as failed. The tests close the session scope at the adapter, the lowest layer where the hang happens.
- That a hung steer blocks the thread's later effects. This comes from reading the outbox claim rules, not from a test.
- A capacity backoff with a real provider. No real
serverOverloaded was triggered, so that path is covered by the replay tests only.
Generated with Claude Opus 5.5 in T3 Code Nightly
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…ring a capacity retry
A steer sent while a Codex turn waits out a capacity-retry backoff, or the
5-second grace before a /goal turn continues, waits for that background
step to finish. Both steps run in the session's scope, so when the session
closed first they were interrupted without settling that wait, and the
steer hung. It runs in the effect worker, so it can also hold up that
thread's later effects, Stop included.
Both background steps now settle their wait with no next turn when they
are interrupted, the same value they already use when no retry or
continuation happens. The steer then fails at once with the existing
"not active and cannot be steered" error.
Generated with Claude Opus 5.5 in T3 Code Nightly
Approvability
Verdict: Approved at 899a26d
Macroscope's review found this PR approvable — Interrupted Codex retry and goal-continuation work now releases waiting steer requests rather than leaving them hanging. The change is limited to in-memory cancellation cleanup and preserves normal provider behavior.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 7, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
The Codex adapter now settles pending continuation and capacity-retry waiters when their fibers are interrupted or already complete. Tests cover steering attempts after session closure during capacity retry and goal continuation.
Changes: Codex steering lifecycle
| Layer / File(s) |
Summary |
Settle pending waiters apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts |
Goal-continuation and capacity-retry scheduling retain their fibers and settle pending waiters if a fiber is interrupted or already complete. The scheduling blocks are uninterruptible. |
Test steering after session closure apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts |
Capacity-retry and goal-continuation tests cover session closure during steering and assert an inactive-session protocol error. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related PRs
- pingdotgg/t3code#26185: Changes the capacity-retry fiber and pending-startup lifecycle in the same adapter path.
Suggested reviewers: yash-singh1, t3dotgg
Merge Risk: Minimal · up to 97744
-
This change stops a Codex steer from hanging when its session closes during a capacity-retry backoff or the goal-continuation grace period. The steer now fails with the existing "not active" error. Regression tests cover both paths, and no remaining merge-blocking risk is evident.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the main change: a Codex steer no longer hangs when its session closes during a capacity retry. The changeset settles the steer's Deferred with undefined when the forked backoff or goa… |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
| Description check |
 |
The description covers the required Problem, Change, Scope and approval, and Verification sections. It explains the failure, the fix, why the change qualifies as a focused fix, and the tests run and l… |
Full details: Title check
-
Explanation
The title names the main change: a Codex steer no longer hangs when its session closes during a capacity retry. The changeset settles the steer's Deferred with undefined when the forked backoff or goal-continuation grace fiber is interrupted, so the steer fails instead of waiting forever. The title covers the capacity-retry case but not the /goal grace-period case, which is a related part of the same fix. It also follows the conventional commit format from the repository template.
Full details: Description check
-
Explanation
The description covers the required Problem, Change, Scope and approval, and Verification sections. It explains the failure, the fix, why the change qualifies as a focused fix, and the tests run and limitations. It also identifies the model and harness used.
Finishing Touches
-
Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between 899a26d and 9774460.
Files selected for processing: 2
-
apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts
apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts
Limit details: You’ve used all 10 included reviews currently available.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…fore its wait is forked
A steer waits on a Deferred that the capacity-retry backoff or the goal grace
fiber settles when it is interrupted. Two cases left it unsettled:
- The retry setup registered the wait, then ran several steps before forking
the backoff. An interrupt in between left nothing to settle it.
- When the session scope is already closed, forkIn returns a fiber that never
starts, so its onInterrupt never runs. The session can still handle a
notification in that state while the rest of the scope closes.
The setup from registering the wait through the fork is now uninterruptible,
so a session close is seen only after the fork. When the forked fiber has
already ended, the wait is settled with undefined right there.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
maria-rcks
commented
Nov 10, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Note Written by gpt-6.1-sol on behalf of Maria
Verified in a real dev environment
checked exact head 97744600d7fc6e98fd60fff573a035bb705cccf6 on a linux boat vm, using repository playwright, /usr/bin/google-chrome, a background vp run dev, fresh unseeded app state, and real codex gpt-6.1-sol through the local proxy. the project and turns were created through the web ui against a real git checkout.
- goal-grace shutdown: codex completed a real goal turn while its goal remained active. a native stdout observer paused that dev codex process immediately after
turn/completed, preventing automatic continuation. i clicked the actual Steer message control, then terminated that process during the five-second grace. no protocol events were injected. the pending steer returned the existing is not active and cannot be steered error. its outbox effect reached terminal failed status after normal retries, with no hung running effect.
- ordinary steer: while a real shell command ran, a ui steer changed the final answer from
ORIGINAL_RESULT to STEER_RECEIVED.
- stop: stopping a separate active goal showed
Run interrupted and Goal paused; its interrupt effect succeeded on the first attempt.
- recovery: after the provider crash,
/goal clear and a fresh turn in the same thread returned RECOVERED_AFTER_EXIT, without restarting the dev server.
15 selected existing adapter regression cases passed through blacksmith-check, including capacity-retry and goal-close cases. existing hosted ci has 28 successful checks. no source changes or pushes were needed.
commands, event timestamps, and outbox results



Not verified
the reported hang did not reproduce on current github/main (934c7f8d8e), tested first in a separate worktree with the same goal, held steer, and real provider shutdown. its event-ingestion cleanup invokes interruptTurn, which releases the goal hold. main also settled the steer and outbox. this verifies the pr's observable shutdown behavior, but does not establish a before/after fix to the reported race.
no natural serverOverloaded response occurred, so real-provider capacity-backoff shutdown remains unverified. already-closed-scope scheduling races were exercised only by the existing replay-based tests. native desktop/mobile, other operating systems, and relay/tunnel connections were not exercised on this linux vm.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Note 🤖 Opus 5.5 replying on behalf of Victor.
Thanks, Maria, for testing exact head 9774460 against a real Codex. Your goal-grace run is the end-to-end check the PR body listed as not done: a steer held during the grace failed with the existing "cannot be steered" error after a real provider exit, and its outbox effect reached failed instead of staying running. The ordinary steer, Stop and same-thread recovery runs also show the change leaves the normal paths alone.
Your note on main is fair. A real exit there already releases the goal hold through interruptTurn, so your run shows the shutdown behavior rather than a before/after for the race. The capacity-backoff close, and the case where the session scope is already closed, are still covered only by the replay tests in CodexAdapterV2.test.ts.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Note 🤖 Opus 5.5 replying on behalf of Victor.
We could not reproduce the hang through the real path either. On main (fa2f4ff2a2), a real Codex app-server started the capacity backoff after a server_is_overloaded 503, injected by a local proxy in front of the real provider. A steer sent during that backoff settled every time the session closed: after Stop, after the Stop button, and after the app-server was killed, including while the retry's turn/start was in flight. Each close reaches interruptTurn or the retry's own error handling, and both release the steer. The state the tests cover never happens above the adapter, so we are closing this PR.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:S
10-29 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|