[Bug]: ChatGPT sharing (openai_token_sharing) returns authorization 400 for every Codex thread until the app-server is killed (0.1.11, Linux) #44218
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Related but closed: #42969 (closed as not planned on 2026-11-25, still getting new reports). Related open: #33701, #29927. This report adds Linux evidence and a second occurrence, and asks for the authorization failure to be handled, not only the wedged thread.
Area#
apps/server
Steps to reproduce#
Not deterministic. What I did see, on Linux with openai_token_sharing ("Connect with ChatGPT"):
- Use Codex with
gpt-6.2-solin a couple of long-running threads. A turn runs shell commands and edits files. - A
POST /v1/responsesfails at the network level (is_connect=true). - The next requests from every Codex thread in that app-server get
400 Bad Requestwithx-openai-authorization-error: 400. - New threads fail on their first request too, including one whose only message was
.. kill -TERMon only thecodex app-serverprocess. T3 Code starts a new one and the next turn succeeds.- About an hour and a half later, the replacement process (started 18:04:57) fails the same way (second occurrence, below).
Expected behavior#
When the Responses API rejects the managed ChatGPT credential with an authorization error, T3 Code should refresh the credential (run the token-sharing auth helper again) and retry the request once. If that doesn't work, it should show an authentication problem with a restart action. It should not keep every thread in that app-server failing until the process is killed by hand.
Actual behavior#
Every Codex turn in the app-server fails with the generic envelope {"error":{"message":"Bad Request","type":null,"code":null,"param":null},"status":400}. The UI shows only "Provider error: Bad Request", which points users at the thread or the model. Users usually try a new thread, a different model, or reinstalling, and none of those help.
Impact#
Major degradation or frequent failure
Version or commit#
T3 Code t3 CLI 0.1.11 (desktop app build not recorded), managed Codex 0.172.0, provider openai_token_sharing, model gpt-6.2-sol.
Environment#
Ubuntu 26.04.1 LTS, kernel 7.0.0-44-generic, x86_64. Launch args include -c model_provider="openai_token_sharing", -c features.multi_agent=false, -c features.multi_agent_v2=false, and the token helper with refresh_interval_ms=0. Helper arguments are omitted here because they look like session material.
Logs or stack traces#
Timeline, local time UTC+5:30, from ~/.codex/logs_2.sqlite and ~/.codex/sessions/:
17:10:35 T3 starts codex app-server (process A). Two long turns in two threads run fine.
17:26:44 POST /v1/responses fails: is_timeout=false is_connect=true
17:27:02 Next requests from both threads: status=400, content-type text/plain
17:35 New thread fails on first request (process A)
17:41 New thread fails on first request (process A)
17:53 New thread fails on first request (process A)
18:03 kill -TERM process A (only that process). T3 starts process B.
18:05 Process B: turns work. Two subagent spawns fail with
subscription_sharing_unsupported_capability (separate issue, see #39101)
18:04:57 Process B started
~18:32 Process B fails again with the same authorization 400 (second occurrence, reported by user)
~18:32 kill -TERM process B
Response headers from the first failures:
status=400
content-type: text/plain
content-length: 121
x-openai-authorization-error: 400
x-openai-internal-caller: unknown_through_ide
x-request-id: req_c43d5f8ebaab46429bfbff7bcd28e765
x-request-id: req_21f2807f1c7e4c6b9671d0effb657d15
Body decodes to: {"error":{"message":"Bad Request","type":null,"code":null,"param":null},"status":400}
Things I ruled out#
- Codex version: already on the latest, 0.172.0.
- Thread length: new threads fail too.
- Tool schemas: the tool payload is byte-identical to requests that succeeded before 17:27.
- Account and model: the same account and model worked at the same time through
codex exec, run with the same-cprovider config and environment as the running app-server. That run also executes the token helper, which is why it succeeds. - Reinstalling Codex or T3 Code: the bundled binary is the same one that fails; the problem is the credential the long-running process holds.
Workaround#
Kill only the codex app-server process: pgrep -af 'codex app-server', then kill -TERM <pid>. T3 Code starts a new one on the next Codex turn. This works, but it has to be repeated about an hour later.
Supporting files#
tanstack-source added labelsbug
juliusmarminge closed this
Sign in to join this conversation.
This is the same problem as #33701, so I'm closing it in favour of that one. If it is different, say how and it will be reopened.