GeezerVison is showing github.com — fix(server): Codex skills sent during a running turn run as their own turn by juliusmarminge · Pull Request #34138 · pingdotgg/t3code
Conversation
Codex loads skills only on turn/start, so a $skill mention sent as turn/steer reaches the model as plain text. The Codex adapter checks a user's steer for enabled skill mentions (skills/list for the turn's cwd). If one matches, it refuses the steer with requiresNewTurn. ProviderTurnControlService passes the flag on, and the effect worker's existing missed-steer fallback re-dispatches the message as its own next turn. I kept the author's approach and merged origin/main with a merge commit. Conflicts were in ProviderTurnControlService (kept both requiresNewTurn and main's unresponsive) and in both test harnesses (the new parameters go after main's new positional ones). After the merge the adapter tests also needed NodeCrypto.layer. I fixed both open findings. (1) Reversed order: every re-dispatched steer took queuePosition 1 and stopRunForQueuedCommand pushed the earlier one behind it. A re-dispatched steer keeps the user_message turn item it got when steered, and ordinary queued messages only get one when they start. The orchestrator counts queued runs that have such an item and places the new steer after them, still ahead of ordinary queued messages. stopRunForQueuedCommand takes an optional queuePosition that defaults to 1, so the /goal and promote callers are unchanged. (2) The skills/list lookup is bounded with Effect.timeout('5 seconds') and falls back to a plain steer through the existing orElseSucceed. I extended the existing 'queues a steer the provider can only run as its own turn' test to queue a message and then send two skill steers, expecting [steer1, steer2, queued]. It failed with the steers swapped before the fix. I merged the two 'still steers' adapter tests into one table and added a stalled skills/list row, which hangs without the timeout. The push to fix/issue-9317 was refused because another run had already pushed its own merge and the same two fixes there (65de896). I did not overwrite it, and pushed to the fallback branch.
Fixes #9317
Supersedes https://git.cafe/pingdotgg/t3code/pulls/26357. The change is @juliusmarminge's; their commits are kept.
Reproduction on main
Not executed during screening. Install a skill with a recognizable response instruction and set policy.allow_implicit_invocation: false in its agents/openai.yaml. Open a Codex thread in T3 Code and ask it to run sleep 45 before replying DONE. While it is running, select that skill from the composer skill menu and submit it using Steer. On main, the mention enters the existing turn as plain text without skill injection; with this change, it waits and starts a separate turn that invokes the skill. Repeat from an idle thread as a control.
Evidence
Real web app and Codex provider; fresh isolated data on each commit; Chromium, 1280×800, light theme. Install an explicit-only skill whose instruction is to reply EXPLICIT_SKILL_CONFIRMED. In a fresh thread, request sleep 45 followed by DONE; while running, select the skill from the composer menu and submit with Steer. Repeat in another fresh thread and press Stop. As an idle control, invoke the same skill after READY.
| Before — b883156e26 |
After — baf5d13b8c |
Skill remains a Steer; turn finishes without confirmation. Recording |
Skill queues, then invokes after DONE. Recording |
Stop leaves the consumed Steer with no pending invocation. Recording |
Stop holds the pending invocation. Recording |
Idle control succeeds.  |
Idle control succeeds.  |
Synthetic skill seed script · Reproduction instructions
Private provider and environment labels were hidden or redacted. AI-assisted; verified with the tests and tools listed above.
Not shown:
- Multiple refused steers retaining their relative order and the stalled skills/list timeout fallback were not exercised; the visual reproduction covered one explicit-only skill, normal completion, Stop, and idle invocation.
Tests
vp test run src/orchestration-v2/SteeringCompletion.integration.test.ts: 49 passed (the extended ordering case failed before the Orchestrator fix with the two steers swapped). vp test run src/orchestration-v2/Adapters/CodexAdapterV2.test.ts -t 'steering a skill mention': 4 passed (the stalled skills/list row timed out without the timeout). vp run check:changed: format, lint, knip, typecheck (27 packages) and tests (8 files, 236 tests) all passed. Not run: a real Codex session.
Not in this change
- nextTurnSelectionHarness in SteeringCompletion.integration.test.ts now takes seven positional arguments; an options object would read better, but it is shared with many main tests.
- skills/list is requested on every user steer containing a $word mention, with no caching.
- An earlier run's competing head on fix/issue-9317 (65de896) carries its own merge and fixes for the same two findings; the pipeline must choose one head.
AI-assisted; verified with the tests and tools listed above.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…never invoked
Codex only loads skills on turn/start, so a `$skill` steered into a running
turn reaches the model as plain text. The new test fails on main because the
adapter sends turn/steer for `$zebra-probe` while skills/list reports it
enabled. The `$PATH` control still steers and passes.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…turn
Codex loads skill instructions only on turn/start, so a `$skill` steered
into a running turn reached the model as plain text and explicit-only
skills never ran. The Codex adapter now refuses such a steer when the
text names an enabled Codex skill, and the steer follow-up path queues
the same message as the next turn.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…steers stay steers
A steer redispatched because it could not join its turn was already sent, so
it no longer releases a queue Stop held while the adapter decided. Only user
messages are checked for skill mentions; delegated results and agent messages
keep steering as before.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e queue
Send now on a queued skill message, or a skill steered while other messages
wait, used to land behind everything already queued.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e queued
The requeued message waits held behind the run Stop reached, whether or not
other messages were queued and whether or not that run has already ended.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
# apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts
# apps/server/src/orchestration-v2/ProviderTurnControlService.ts
# apps/server/src/orchestration-v2/SteeringCompletion.integration.test.ts
…okup still steers
A second steer that had to wait for a new turn jumped ahead of the first one, since every
re-dispatched steer took queue position 1. It now goes behind the re-dispatched steers already
waiting and still ahead of ordinary queued messages. The skills/list lookup a steer waits on is
bounded at 5 seconds and falls back to a plain steer.
AI-assisted; verified with the tests and tools listed above.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Approvability
Verdict: Approved at baf5d13
Macroscope's review found this PR approvable — Explicit Codex skill mentions sent during a running turn now wait for their own turn, where skills can load. The change preserves queue order and Stop holds, with a bounded lookup that falls back to ordinary steering.
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.
Thread transfer impact
✅ Thread transfer remains within every enforced ceiling.
| Provider |
Metric |
Main baseline |
This PR |
Impact |
PR ceiling |
|
| Codex |
Total thread wire |
5.0 KiB |
5.0 KiB |
0 B (0.0%) |
6.8 KiB |
✅ |
| Codex |
Thread snapshot wire |
3.8 KiB |
3.8 KiB |
0 B (0.0%) |
4.9 KiB |
✅ |
| Codex |
Live turn WebSocket wire |
1.2 KiB |
1.2 KiB |
0 B (0.0%) |
2.0 KiB |
✅ |
| Codex |
Live turn WebSocket decoded |
21.5 KiB |
21.5 KiB |
0 B (0.0%) |
24.4 KiB |
✅ |
| Codex |
Live turn messages |
1 |
1 |
0 (0.0%) |
8 |
✅ |
| Claude |
Total thread wire |
5.0 KiB |
5.0 KiB |
0 B (0.0%) |
6.8 KiB |
✅ |
| Claude |
Thread snapshot wire |
3.8 KiB |
3.8 KiB |
0 B (0.0%) |
4.9 KiB |
✅ |
| Claude |
Live turn WebSocket wire |
1.2 KiB |
1.2 KiB |
0 B (0.0%) |
2.0 KiB |
✅ |
| Claude |
Live turn WebSocket decoded |
21.9 KiB |
21.9 KiB |
0 B (0.0%) |
24.4 KiB |
✅ |
| Claude |
Live turn messages |
1 |
1 |
0 (0.0%) |
8 |
✅ |
Baseline: 768f17c · PR result: baf5d13 · Source CI: success
Scenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 108.5 KiB
- Claude decoded thread snapshot: 108.8 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 11, 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 detects enabled skill mentions in user steers and marks matching messages as requiring a new turn. The orchestration path propagates this condition, redispatches the message, and positions it with queued work.
Changes: Codex skill steering
| Layer / File(s) |
Summary |
Detect enabled skills in user steers packages/provider-core/src/server/ProviderAdapter.ts, apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts, apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts |
The adapter checks user-authored skill mentions against enabled skills for the active working directory. Matching steers require a new turn. Tests cover agent messages, non-skill expressions, and stalled skill lookups. |
Propagate separate-turn steer errors apps/server/src/orchestration-v2/ProviderTurnControlService.ts, apps/server/src/orchestration-v2/EffectWorker.ts |
The control error carries requiresNewTurn when the provider steer error sets it. The worker accepts this flag as a steer recovery condition. |
Redispatch and order queued steers apps/server/src/orchestration-v2/Orchestrator.ts, apps/server/src/orchestration-v2/SteeringCompletion.integration.test.ts |
Redispatched steers receive queue positions based on queued user work. The orchestration path keeps messages held when Stop reached the associated run. Integration tests cover delivery order, Stop races, and promotion. |
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Bug fix · Severity of issue fixed: Medium
Sequence Diagram(s)
sequenceDiagram
participant User
participant CodexAdapterV2
participant CodexAppServer
participant ProviderTurnControlService
participant EffectWorker
participant Orchestrator
User->>CodexAdapterV2: Submit user steer
CodexAdapterV2->>CodexAppServer: Request skills/list for active cwd
CodexAppServer-->>CodexAdapterV2: Return enabled skills
CodexAdapterV2-->>ProviderTurnControlService: Raise steer error with requiresNewTurn
ProviderTurnControlService-->>EffectWorker: Propagate control error
EffectWorker->>Orchestrator: Recover and redispatch steer
Orchestrator->>Orchestrator: Place steer in queue order
Loading
Possibly related issues
Possibly related PRs
- pingdotgg/t3code#26526: Configures Codex skills for a session, affecting the enabled-skill inventory checked by this change.
- pingdotgg/t3code#26357: Implements the same skill-steering detection, separate-turn error propagation, redispatch, and queue handling.
Suggested labels: bugfix
Suggested reviewers: yash-singh1, macroscopeapp
Merge Risk: Minimal · up to baf5d
-
Enabled skill mentions in steers now run as a separate next turn, with queued message order preserved. No concrete merge-blocking risk was identified. A real Codex session was not exercised.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title clearly and concisely describes the main change: Codex skill steers during an active turn run as a separate turn. It uses a conventional commit format. |
| Linked Issues check |
 |
Issue #9317 allows queuing the skill invocation as a distinct turn. CodexAdapterV2 checks enabled skills from skills/list, applies a five-second timeout, and raises requiresNewTurn for matching … |
| Out of Scope Changes check |
 |
The changes remain within issue #9317. Adapter logic implements distinct-turn handling and timeout fallback. Control-service and worker changes propagate the required error state. Orchestrator changes… |
| Description check |
 |
The description covers the problem, implementation, scope, linked issue, verification results, evidence, limitations, and AI assistance. It also states that a real Codex session and some edge cases we… |
Full details: Linked Issues check
-
Explanation
Issue #9317 allows queuing the skill invocation as a distinct turn. CodexAdapterV2 checks enabled skills from skills/list, applies a five-second timeout, and raises requiresNewTurn for matching user steers. ProviderTurnControlService, EffectWorker, and Orchestrator propagate and re-dispatch that steer. The tests cover active-turn skill steering, queue order, Stop handling, promotion, and the stalled lookup.
Full details: Out of Scope Changes check
-
Explanation
The changes remain within issue #9317. Adapter logic implements distinct-turn handling and timeout fallback. Control-service and worker changes propagate the required error state. Orchestrator changes preserve queued-steer order and existing queue behavior. Added harness and integration tests support these objectives.
Full details: Description check
-
Explanation
The description covers the problem, implementation, scope, linked issue, verification results, evidence, limitations, and AI assistance. It also states that a real Codex session and some edge cases were not tested.
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
- 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 768f17c and baf5d13.
Files selected for processing: 7
-
apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts
apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts
apps/server/src/orchestration-v2/EffectWorker.ts
apps/server/src/orchestration-v2/Orchestrator.ts
apps/server/src/orchestration-v2/ProviderTurnControlService.ts
apps/server/src/orchestration-v2/SteeringCompletion.integration.test.ts
packages/provider-core/src/server/ProviderAdapter.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 11, 2026
This branch has not been deployed
No deployments
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:M
30-99 changed lines (additions + deletions).
vouch:trusted
Author is trusted by repo permissions or the VOUCHED list.
Milestone
No milestone
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.
|