codex - 💡(How to fix) Fix Codex VS Code extension cannot re-authenticate in Dev Container after successful initial login (token_exchange_failed)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

error sending request for url (https://auth.openai.com/oauth/token)

RAW_BUFFERClick to expand / collapse

What version of the IDE extension are you using?

26.519.32039

What subscription do you have?

Plus

Which IDE are you using?

VS Code

What platform is your computer?

Linux 6.6.114.1-microsoft-standard-WSL2 x86_64 x86_64

What issue are you seeing?

Codex connected successfully initially Session expired / disconnected Re-login fails permanently Chat shows Codex Reconnecting...

Sign-in flow fails with:

Token exchange failed: error sending request for url (https://auth.openai.com/oauth/token)

Container network is healthy:

curl -Iv https://auth.openai.com/oauth/token succeeds with TLS + HTTP response

From the log: 401 /wham/usage api key auth is not supported chatgpt authentication required for remote plugin catalog stream disconnected - retrying sampling request token_exchange_failed

What steps can reproduce the bug?

  1. On Windows 11, open project folder with VS Code.
  2. Make sure you have a working .devcontainer config and can re-open the project in a Dev Container.
  3. Confirm by running ctrl-shift-p, and re-open in container.
  4. Install openai.chatgpt extension, if not already installed. This will first install it at host level.
  5. Install the extension in the container. The option to do this shows on the listing of the extension at host level.
  6. After the extension is installed, a "CODEX" tab will show up in the Chat panel.
  7. Click the "Sign in With Chat GPT" button.
  8. A browser will open, login in to ChatGPT if not already.
  9. When the page "Sign in to Codex with ChatGPT appears, click Continue.

You will see either a failure or a freeze that lasts forever in both the chat window and the web page.

Failure case: <img width="764" height="358" alt="Image" src="https://github.com/user-attachments/assets/6773b7f0-b7e5-49b1-8c1d-06098d726a0b" />

Freeze case (never times out):

In this image I have clicked on the Continue button, and it goes gray and freezes. <img width="637" height="622" alt="Image" src="https://github.com/user-attachments/assets/187e9f55-b8a2-4a1d-8ccf-a72c081a9730" /> And this is what the chat window looks like:

<img width="498" height="665" alt="Image" src="https://github.com/user-attachments/assets/0e0e9c4f-c12b-4f51-900b-062dbcda8c90" />

What is the expected behavior?

Existing working login should recover Re-auth should succeed after disconnect Dev Container auth state should not become unrecoverable

Additional information

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Codex VS Code extension cannot re-authenticate in Dev Container after successful initial login (token_exchange_failed)