Repository navigation
Not planned
Description
Before submitting
- I searched existing issues and did not find an exact duplicate with logs (possibly related to [Bug]: ChatGPT Provider error #42729).
- I included enough detail to reproduce or investigate the problem.
Summary
On a Codex thread using Connect with ChatGPT (openai_token_sharing), a turn fails mid-flight with an opaque HTTP 400 Provider error:
{
"error": {
"message": "Bad Request",
"type": null,
"code": null,
"param": null
},
"status": 400
}Once this happens, the thread is permanently wedged:
- Sending a follow-up message (e.g.,
continue) fails immediately (~2s) with the exact same 400Bad Request. - Running compaction (
thread/compact/start/contextCompaction) retries 5/5 (responseStreamDisconnected) and then fails with the exact same 400Bad Request. - The only workaround is starting a fresh thread.
Environment
- T3 Code:
0.1.11(Beta, Desktop) - OS: Windows
- Provider:
codex(codex.app-server,modelProvider: "openai_token_sharing", Connect with ChatGPT /subscriptionSharing: true) - Codex CLI:
0.156.1 - Model:
gpt-6.2-sol(reasoningEffort: "low") - Context usage at failure:
111,689/258,400tokens (well below context window; noteModel metadata for gpt-6.2-sol not found. Defaulting to fallback metadatawarning was also logged)
Observed behavior & protocol timeline
From ~/.t3/userdata/logs/provider/events.<thread>.log (sanitized):
- During an active turn (
01a2139f-f6c0-7a23-b98a-d793fb251c19), twocommandExecutionitems were in-flight (one interactive/background process receivingterminalInteractionevents, plus a newly started command at17:00:47.539Z). - At
17:00:57.561Z,thread/tokenUsage/updatedreportedlast.totalTokens = 111689(modelContextWindow = 258400). - At
17:00:58.187Z, the turn failed withsystemErrorandcodexErrorInfo: "other":{"method":"thread/status/changed","params":{"threadId":"<thread>","status":{"type":"systemError"}}} {"method":"error","params":{"error":{"message":"{\"error\":{\"message\":\"Bad Request\",\"type\":null,\"code\":null,\"param\":null},\"status\":400}","codexErrorInfo":"other","additionalDetails":null,"misalignment":null},"willRetry":false}} {"method":"turn/completed","params":{"turn":{"status":"failed","error":{"message":"{\"error\":{\"message\":\"Bad Request\",\"type\":null,\"code\":null,\"param\":null},\"status\":400}","codexErrorInfo":"other"}}}} - 3–5 seconds after
turn/completed (status: failed), both in-flightcommandExecutionitems emitteditem/completed(17:01:01.746Zand17:01:03.124Z). - User sent
continue(turn/startat17:01:16.722Z):17:01:16.731Z:warning:Model metadata for \gpt-6.2-sol` not found. Defaulting to fallback metadata; this can degrade performance and cause issues.`17:01:19.034Z(~2.3s later): failed immediately with the exact same400 Bad Request(systemError).
- User triggered compaction (
thread/compact/startat17:03:57.505Z):17:03:57.526Z:item/started(type: "contextCompaction")17:03:59Z–17:04:04Z:Reconnecting... 1/5through5/5(codexErrorInfo: {"responseStreamDisconnected":{"httpStatusCode":null}},additionalDetails: "{\"error\":{\"message\":\"Bad Request\",\"type\":null,\"code\":null,\"param\":null},\"status\":400}")17:04:07.704Z: failed withsystemErrorand the same400 Bad Request.
Expected behavior
- The turn should not fail with an opaque 400
Bad Requestmid-session, or if a provider 400 occurs (e.g., due to orphaned/out-of-order tool call state or malformed history after a failed turn), T3 Code should surface the real cause and/or offer a recovery path (such as continuing in a fresh Codex session) rather than leaving the thread permanently broken on every subsequent message and compaction attempt.
Related issues
- Possibly the same issue as [Bug]: ChatGPT Provider error #42729 (also reported on
0.1.11with ChatGPTProvider errorcrashing the conversation until a new thread is created). - Similar permanent-wedging UX to [Bug]: ChatGPT sharing: Codex is still offered spawn_agent (agents.enabled not disabled), and one spawn permanently poisons the thread (0.1.10) #39101 (thread becomes permanently unusable on every retry).
Impact
Blocks work completely on the affected thread.
Workaround
Start a new thread (retrying, sending continue, or compacting the existing thread all fail with the same 400).
Metadata
Metadata
Assignees
Labels
No labels
Activity
juliusmarminge commentedon Nov 25, 2026
I tried to reproduce this on the current build and could not.
Commit b136053 (origin/main). The upstream 400 itself needs first-party ChatGPT OAuth (openai_token_sharing), which no VM has, so I did not run the app against real Codex. I reproduced T3's half, the thread never recovering after the rejection, in the orchestration integration harness. I added an
opaque-bad-requestcase torecovers invalid encrypted Codex history on the next promptin apps/server/src/orchestration-v2/testkit/ProviderSwitch.integration.test.ts. In that case run 2 fails with codeotherand the reporter's exact message{"error":{"message":"Bad Request","type":null,"code":null,"param":null},"status":400}, and the test expects run 3 to finish in a fresh native session with history carried over.vp test run src/orchestration-v2/testkit/ProviderSwitch.integration.test.ts -t "recovers invalid encrypted Codex history": the new case fails (expected 'failed' to equal 'completed': the follow-up resumes the same rejected native thread and fails again); the 6 existing cases pass. Pushed as factory/repro-42969 (088b67d).Closing as not planned. If it still happens for you, reply with the exact steps and the version you are on and it will be looked at again.
Max-202547 commentedon Nov 25, 2026
I'm having the same problem with Debian 13 and v0.1.11.
rasptum commentedon Nov 25, 2026
This just happened a second time on a brand-new thread in the same T3 Code
0.1.11(Windows) session, with an almost identical pattern — requesting a reopen, especially since:factory/repro-42969(088b67ddb6), andv0.1.11.Side-by-side comparison of both occurrences (same session,
openai_token_sharing,gpt-6.2-sol, Codex CLI0.156.1)16:05:34Z17:04:23Z400 Bad Request17:00:58Z18:01:17Z111,689/258,400tokens162,619/258,400tokens (2 prior compactions succeeded earlier in the thread)commandExecutionwas still in-flight past its 10s yield (item/started17:00:47.539Z→tokenUsage17:00:57.561Z→40017:00:58.187Z)commandExecutionwas still in-flight past its 10s yield (item/started18:00:50.608Z→tokenUsage18:01:00.627Z→40018:01:17.836Z)item/completed~5s afterturn/completed (status: failed)item/completed3m26s afterturn/completed (status: failed)400 Bad Request400 Bad RequestSanitized protocol excerpt from Occurrence 2
Notable patterns for investigation
400 Bad Request.commandExecutionat failure: In both cases, the 400 landed while a command was still running past the 10s yield, and itsitem/completedarrived afterturn/completed (status: failed).factory/repro-42969): Even if the initial 400 originates upstream or in Codex's native thread state, T3 currently resumes the poisoned native thread on every subsequent prompt instead of recovering into a fresh native session with history carried over (asrecovers invalid encrypted Codex history on the next promptalready does for other unrecoverable Codex history rejections).mschoen79 commentedon Nov 25, 2026
I hit the same repeated provider error on T3 Code Beta 0.1.12, macOS 27.2.1 (Apple Silicon), with the Codex provider and gpt-6.2-sol. I have had to restart T3 twice. In my case, fully restarting T3 let me continue the same thread with the same model.
What I observed on November 25, 2026 (UTC):
{"error":{"message":"Bad Request","type":null,"code":null,"param":null},"status":400}The thread history has no provider request ID or more specific error. I don't have a deterministic trigger for the initial 400. The quick retry failures and recovery after a full T3 restart are what I can confirm. Could you reopen this for the 0.1.12 recurrence and investigate whether T3 can recover the session automatically?
wallynm commentedon Nov 25, 2026
Another macOS reproduction on 0.1.11, with a likely root cause that I think explains this issue, and a request to reopen it.
Setup: T3 Code (Beta) 0.1.11, macOS (arm64), managed Codex 0.171.0 (
openai_token_sharing),gpt-6.2-sol, 4-5 Codex threads running at the same time.What I see: every
codex app-serverprocess that T3 spawns works for roughly an hour, then every/v1/responsesrequest from that process gets400 Bad Request, across all threads at once. Today it happened 7 times in a row. Time from process start to the first 400 (local time, UTC-3):Once a process starts failing, no request from it succeeds again (checked in
~/.codex/logs_2.sqlite). New turns on the same threads fail about 1 s after starting. A fresh process works immediately.The response is not a 401. Codex logs it as:
(request ids:
req_6cb4eab853e3445d9f4a16f4c305ba91,req_47194c69071844d19eed3729e62542fa)Likely cause: the managed provider is launched with
refresh_interval_ms=0(I confirmed it in the live process arguments). #33713 explains that with this value Codex keeps the token it fetched at launch for the whole life of the process and only re-runs the token helper after a 401 on the Responses path. Here the expired token is rejected with a 400 (x-openai-authorization-error), so that 401 recovery never runs and the process stays wedged. That matches the ~1 hour, the "all threads at once" pattern, and the fact that a new process fixes it. Other reports in this thread (55-57 min) fit too. I have not proven that the token is what expires, only that the evidence is consistent with it.Recovery without restarting T3: killing only the
codex app-serverchild (SIGTERM) while T3 stays open works every time. T3 spawns a new one on the next message and the same threads continue. That also suggests the thread is not poisoned, the process is.This looks like the same root cause as #33701, and the fix in #33713 (a positive
refresh_interval_msplus the larger broker renewal margin) should cover this 400 as well. Could this be reopened, or linked to #33701/#33713?I'm happy to help verify a fix: I'm on a real ChatGPT account on macOS, so I can run a build with #33713 across a full token expiry and report back. I'm also running a local workaround (a launcher that rewrites
refresh_interval_ms=0to 30000, plus a watchdog that restarts a wedged process) and will report whether processes started with it survive past one hour.Posted on behalf of @wallynm, investigated with AI assistance in T3 Code. No tokens, account identifiers or private conversation content are included.
Tstrife commentedon Nov 25, 2026
i'm having the exact same problem, macOS 27.2.1, T3 0.1.12.
JoranOmark commentedon Nov 25, 2026
This message is generated by Isak, Jöran Omark's AI buddy.
On Windows with T3 0.1.11 and Codex CLI 0.166.0 using
openai_token_sharing, I found this sequence on November 25, 2026. All times are UTC.CodexChatGptAuth.exchangeduring its periodic provider refresh.POST /v1/responses.x-openai-authorization-error: 400. OpenAI request IDreq_6504386278264778ac601d41b291a643.The 400 arrived 3,600.450 seconds after the first exchange and 14.961 seconds after the second. These are client-side completion timestamps. One possible explanation is that the conversation still used the earlier credential. The logs don’t identify which credential it sent or when that credential expired.
swwwamo commentedon Nov 26, 2026
I can confirm this on macOS with T3 Code Beta 0.1.12, managed Codex 0.166.0 (“Connect with ChatGPT”), and
gpt-6.2-astra. On Nov 25 I saw 11 failed Astra turns in three clusters roughly an hour apart. Retrying in the same thread kept returning “Bad Request.”In the clearest case, at 20:31:23 UTC,
POST /v1/responsesreturnedx-openai-authorization-error: 400. Codex loggedauth_retry_after_unauthorized="false". I restarted T3, continued the same thread with the same model, and at 20:31:55 UTC the replacement Codex process received HTTP 200. No new thread or sign-in was needed.Could you reopen this to investigate automatic recovery from this authorization 400?
JoranOmark commentedon Nov 26, 2026
This message is generated by Isak, Jöran Omark's AI buddy.
Two more failures from Windows add a timing detail to wallynm's root-cause comment. On this machine the 400 arrives a few seconds after T3's own credential exchange, not at an arbitrary point in the hour.
Setup: T3 Code 0.1.11 on Windows 11, managed Codex 0.166.0,
openai_token_sharing,gpt-6.2-astra. The livecodex app-serverhere was also launched withrefresh_interval_ms=0.Overnight on 2026-11-26, two long turns failed with the generic
{"error":{"message":"Bad Request","type":null,"code":null,"param":null},"status":400}. Each failure came 3 to 5 seconds after aCodexChatGptAuth.exchangespan ended in T3's server trace:CodexChatGptAuth.exchangeends (UTC)The retained trace covered 01:27 to 03:27 UTC. It contained only these two exchanges, 60 min 19 s apart. A new thread started within a minute of each failure and ran normally. Including the case in my earlier comment, where the 400 came 15 s after the newer of two exchanges, all three 400s I've timed came within seconds of an exchange.
One possible explanation: T3's exchange rotates or invalidates the credential that the long-lived process fetched at launch. That would explain why the rejection follows the exchange by seconds and why a fresh process works. With
refresh_interval_ms=0the old process never picks up the new credential. Because the rejection is a 400, not a 401, Codex's 401 recovery never runs. I have not seen which credential the failing requests carried, so this is inferred from timing only.andyjusa commentedon Nov 26, 2026
Another reproduction on T3 Code Beta 0.1.12, macOS (Apple Silicon), Codex CLI 0.172.0,
openai_token_sharing,gpt-6.2-sol. This one adds a timing detail: the failing process was only about 4 minutes old, so the trigger looks like the age of the credential, not the age of the process.Timeline (2026-11-26, UTC), from
~/.codex/logs_2.sqliteand~/.t3/userdata/logs/server.trace.ndjson:CodexChatGptAuth.exchangesucceedscodex app-server(launched withrefresh_interval_ms=0) makes its first/v1/responsesrequest → 200CodexChatGptAuth.exchangesucceedsRequest IDs:
req_7f3667a3b6fc4ed2814a5a097b590287,req_19ad555a038841d19987744a4425e817,req_8e108b8a967a4ea2a17ac154abd49998.The response is the same as in the earlier reports:
content-type: text/plain,x-openai-authorization-error: 400, opaqueBad Requestbody. Codex loggedauth_mode="ApiKey"andauth_retry_after_unauthorized="false", so the 401 recovery path never ran.Earlier the same day: a process failed at 08:26:40 UTC in the same way, and a fresh process at 08:28:16 UTC got 200 immediately on the same threads.
Interpretation (inferred from timing, not proven): the process apparently started with a credential minted by the 13:26:46 exchange and kept it under
refresh_interval_ms=0. That credential stopped working exactly one hour after it was minted, even though the process itself was only ~4 minutes old. The newer exchange at 14:25:48 did not reach the running process. If that's right, a process started shortly before a credential's 1h expiry fails within minutes. This fits the fix direction in #33701 / #33713: a positive refresh interval, or treatingx-openai-authorization-error: 400like a 401 and re-running the token helper.Could this be reopened?
Investigated with AI assistance in T3 Code; no tokens or account identifiers included.
debsagar commentedon Nov 26, 2026
Still happening here on Linux (Azure VM), Codex CLI 0.172.0, Connect with ChatGPT, models
gpt-6.2-solandgpt-6.2-astra(default and high reasoning effort), run as delegated child tasks.Same opaque error every time:
Pattern on 2026-11-26 (5 failures):
task_completewithcodex_error_info: "other",duration_ms: 458). So it is not only the old native thread being wedged: a fresh session failed immediately too.Model metadata for gpt-6.2-sol not found. Defaulting to fallback metadatais logged, as in the original report.features.enable_request_compression = falseis already set, so compression is not the cause here.Workaround we use: keep Codex tasks short and start a new task rather than resuming. Happy to provide sanitized provider event logs.
zoeyzzz316 commentedon Nov 27, 2026
Same issue here. T3 Code Beta 0.1.11, Windows 10 Pro 19045, Codex provider.
{"error":{"message":"Bad Request","type":null,"code":null,"param":null},"status":400}Geek-Cheth commentedon Nov 27, 2026
Same issue on Linux (Ubuntu 26.04.1), T3 Code
t3CLI 0.1.11, managed Codex 0.172.0,openai_token_sharing,gpt-6.2-sol. Adding a data point for the reopen request, since the failing process here was young and the 400 followed a network error.Timeline (2026-11-27, UTC+5:30), from
~/.codex/logs_2.sqlite:codex app-server(refresh_interval_ms=0); two long Codex turns in two threads run finePOST /v1/responsesfails at the network level:is_timeout=false is_connect=true.kill -TERM <codex app-server pid>only; T3 respawns it, next turn gets 200 and no errors sinceResponse headers on the first failures:
While the process was failing, I ran the same Codex binary with the exact
-cprovider config and environment copied from the running app-server (codex exec ... -m gpt-6.2-sol "Reply with just: ok", run from/tmpand from the project directory). It returned 200, because it runs the token-sharing auth command again. Tool payloads in the failing requests were byte-identical to those in the requests that succeeded earlier. That points to the credential the long-lived app-server was still sending, not the account, the model, the thread history, or the tools.Workaround that avoids restarting T3: kill only the
codex app-serverprocess (pgrep -af 'codex app-server'). T3 respawns it on the next Codex turn.Mateuss18 commentedon Dec 1, 2026
I hit the same opaque HTTP 400 on Windows x64 with T3 Code Nightly
0.1.14-nightly.20261201.5550and Codexgpt-6.2-solon Dec 1, 2026.OKprompt. At 16:45:51 UTC the original conversation also answered a minimal prompt, without resetting its history or changing its provider.{"error":{"message":"Bad Request","type":null,"code":null,"param":null},"status":400}I could reproduce the retry failure, but I couldn't confirm whether the recovery coincided with a credential refresh or an app-server restart.