Repository navigation
Description
Version: T3 Code Nightly 0.1.6-nightly.20261031.3956, headless t3 serve on Linux amd64. Codex CLI app-server, ChatGPT account.
What happened
A thread was created over MCP (t3_thread_launch) with an explicit Codex model the account cannot use (gpt-5-codex). Codex rejected the turn about 2 s after it started and reported the turn as failed. T3 never finalized the run:
- The thread
statusstayedrunning. - The run's
statusstayedrunning, withcompletedAt: null. - The thread got no error item. Its only items were the user message and "Workspace ready".
- So nothing watching the run, such as MCP wait/notification clients, saw a terminal state.
The run stayed like this until it was interrupted by hand about 2 minutes later.
Expected
The run ends as failed, with Codex's failure message shown on the thread ("The 'gpt-5-codex' model is not supported when using Codex with a ChatGPT account.").
Native event sequence (provider event log, abridged)
07:16:12.577 → turn/start
07:16:12.586 ← warning "Model metadata for `gpt-5-codex` not found. Defaulting to fallback metadata…"
07:16:12.616 ← thread/status/changed
07:16:12.616 ← turn/started turn 01a190d0-e8a6-7d81-98fa-60dfe00d8656
07:16:14.682 ← thread/status/changed
07:16:14.683 ← error {"error":{"message":"The 'gpt-5-codex' model is not supported when using Codex with a ChatGPT account.","codexErrorInfo":"modelNotFound"},"willRetry":false,"turnId":"01a190d0-e8a6-…"}
07:16:14.690 ← thread/readState/changed
07:16:14.690 ← turn/completed {"turn":{"id":"01a190d0-e8a6-…","status":"failed","error":{"message":"…not supported…","codexErrorInfo":"modelNotFound"},"durationMs":2098}}
… nothing for this run until …
07:18:05.981 → turn/interrupt (manual stop)
T3 thread state read about 70 s after turn/completed:
{"status":"running","activeRunId":"run:…:ordinal:1",
"recentRuns":[{"status":"running","startedAt":"2026-10-31T07:16:12.475Z","completedAt":null}],
"itemCount":2}Where it may be
apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts at the tag:
- The
turn/completedhandler returns early whenactiveTurnshas no context for the turn id. It doesn't log anything, and it never finalizes. - The
errorhandler (willRetry: false) only recordslatestProviderFailureafterawaitActiveTurn(turnId).
If the turn's context isn't in activeTurns when turn/completed arrives, the terminal event is dropped silently. That can happen if registration races the fast failure, or if the error handler is still waiting in awaitActiveTurn. Not verified; the event timing above is the evidence.
Related but different: #15197 (Claude run stays running after result/success), #27348 (OpenCode turn stuck).
Repro
- On a Codex instance signed in with a ChatGPT account, launch a thread with
modelSelection: {provider: "codex", model: "gpt-5-codex"}(any model the account rejects). - Observe the native
turn/completedwithstatus: "failed". - Observe that the T3 run remains
runningindefinitely.
Activity