You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My VS Code is connected to the VS Code Server on WSL. After installing the Codex plugin, when I try to log in, the browser opens the login page. After I log in, it can’t redirect back to the plugin. This seems to happen because the authorization callback URL is generated inside WSL and uses localhost. After logging in, the browser tries to call back to localhost to notify the plugin of success, but it fails since it points to the WSL host. Can this bug be fixed? Or could you implement the same authorization approach as Claude Code?
What is the expected behavior?
when i login in browser, should notify codex plugin, and can do work in plugin
What do you see instead?
No response
Additional information
No response
Reacted by chrisjvargo, Esteban A. Vidal, Fleating, schmatthes and NorLz
I also have this issue with attempting to log in to codex running on a remote headless server. I enter in the url in browser, log into openai, but it times out. There should be way to login when the machine the web browser is on is not the machine codex is running on.
I was having the same issue, suddenly, after it had been working fine for a few days.
I asked ChatGPT. It said I could try adding the following in my devcontainer.json:
I was able to fix this issue with the following steps
(assuming you already have the WSL extension installed in VS Code):
Open VS Code on Windows (do not open it via WSL yet) and install the Codex extension.
Sign in with OpenAI from the Windows VS Code. At this point Codex should work normally in the Windows environment.
Open PowerShell and navigate to:
$env:USERPROFILE\.codex\auth.json
Open that file and copy its JSON contents.
In your Linux (WSL) terminal, create the same directory and file: mkdir -p ~/.codex nano ~/.codex/auth.json
Paste the JSON you copied from Windows and save the file.
Now open VS Code in WSL (for example, with code . from your Linux terminal). Codex should be authenticated and working correctly.
Reacted by efinal, Wolff Bock von Wülfingen, BebopFox🦊, Beka Daniel Bonsa, Akira, valiant, ddqp, loitho, Mursalin Kabir, shenjingfs and 2 more
Reacted by efinal, Andy Wu, BebopFox🦊, Beka Daniel Bonsa and Mursalin Kabir
I was able to fix this issue with the following steps (assuming you already have the WSL extension installed in VS Code):
Open VS Code on Windows (do not open it via WSL yet) and install the Codex extension.
Sign in with OpenAI from the Windows VS Code. At this point Codex should work normally in the Windows environment.
Open PowerShell and navigate to: $env:USERPROFILE\.codex\auth.json
Open that file and copy its JSON contents.
In your Linux (WSL) terminal, create the same directory and file: mkdir -p ~/.codex nano ~/.codex/auth.json
Paste the JSON you copied from Windows and save the file.
Now open VS Code in WSL (for example, with code . from your Linux terminal). Codex should be authenticated and working correctly.
I was able to fix this issue with the following steps (assuming you already have the WSL extension installed in VS Code):
Open VS Code on Windows (do not open it via WSL yet) and install the Codex extension.
Sign in with OpenAI from the Windows VS Code. At this point Codex should work normally in the Windows environment.
Open PowerShell and navigate to: $env:USERPROFILE\.codex\auth.json
Open that file and copy its JSON contents.
In your Linux (WSL) terminal, create the same directory and file: mkdir -p ~/.codex nano ~/.codex/auth.json
Paste the JSON you copied from Windows and save the file.
Now open VS Code in WSL (for example, with code . from your Linux terminal). Codex should be authenticated and working correctly.
it works!
modify a little.
1-2、same
3、notepad $env:USERPROFILE.codex\auth.json
4、mkdir -p ~/.codex vi ~/.codex/auth.json
5、the same
it works +1
I was able to fix this issue with the following steps (assuming you already have the WSL extension installed in VS Code):
Open VS Code on Windows (do not open it via WSL yet) and install the Codex extension.
Sign in with OpenAI from the Windows VS Code. At this point Codex should work normally in the Windows environment.
Open PowerShell and navigate to: $env:USERPROFILE\.codex\auth.json
Open that file and copy its JSON contents.
In your Linux (WSL) terminal, create the same directory and file: mkdir -p ~/.codex nano ~/.codex/auth.json
Paste the JSON you copied from Windows and save the file.
Now open VS Code in WSL (for example, with code . from your Linux terminal). Codex should be authenticated and working correctly.
it works!
modify a little. 1-2、same 3、notepad $env:USERPROFILE.codex\auth.json 4、mkdir -p ~/.codex vi ~/.codex/auth.json 5、the same it works +1
It’s not working for me. It keeps showing “Reconnecting...”
Activity
vfk-rw commentedon Oct 10, 2025
I also have this issue with attempting to log in to codex running on a remote headless server. I enter in the url in browser, log into openai, but it times out. There should be way to login when the machine the web browser is on is not the machine codex is running on.
zsr71 commentedon Oct 12, 2025
i meet the same issue
2025-10-12 21:09:54.539 [error] Error fetching https://ab.chatgpt.com/v1/rgstr?k=client-sYWqzCYMRkUg4DqqiZcR5DGTNl2iD7zNJY0HoeDLzxR&st=javascript-client-react&sv=3.25.5&t=1760274592504&sid=a61a839f-fdc3-4143-9144-17a8eff3ff28&ec=1001&gz=1: TypeError: fetch failed
2025-10-12 21:09:55.983 [error] CLI: Token exchange error: error sending request for url (https://auth.openai.com/oauth/token)
23min commentedon Oct 14, 2025
I was having the same issue, suddenly, after it had been working fine for a few days.
I asked ChatGPT. It said I could try adding the following in my devcontainer.json:
No idea why it stopped working. I think it was when I tried using Codex in a second container.
e-yi commentedon Nov 12, 2025
Fixed the same issue by ensuring the WSL network works in the mirrored mode.
sharptornadoqsh commentedon Nov 20, 2025
I fix this buy follow steps:
1、shutdown wsl2 :this works for vscode、windsurf and cursor
vscode if you do this
in settins.json file turn off the wsl2 as follows:
in cursor setting as vscode
in windsurf
2、then login you can fix this rember do not turn on wsl ,do not turn on
Miunmn commentedon Nov 27, 2025
I was able to fix this issue with the following steps
(assuming you already have the WSL extension installed in VS Code):
Open VS Code on Windows (do not open it via WSL yet) and install the Codex extension.
Sign in with OpenAI from the Windows VS Code. At this point Codex should work normally in the Windows environment.
Open PowerShell and navigate to:
$env:USERPROFILE\.codex\auth.jsonOpen that file and copy its JSON contents.
In your Linux (WSL) terminal, create the same directory and file:
mkdir -p ~/.codex nano ~/.codex/auth.jsonPaste the JSON you copied from Windows and save the file.
Now open VS Code in WSL (for example, with
code .from your Linux terminal). Codex should be authenticated and working correctly.sharptornadoqsh commentedon Nov 27, 2025
efinal commentedon Dec 17, 2025
it works!
sharptornadoqsh commentedon Dec 17, 2025
sharptornadoqsh commentedon Jan 13, 2026
RektonLee commentedon Jan 24, 2026
shutdown wsl2 :this works for vscode、windsurf and cursor
This Method works for me . Thx~!
niuhuluzhihao commentedon Mar 17, 2026
modify a little.
1-2、same
3、notepad $env:USERPROFILE.codex\auth.json
4、mkdir -p ~/.codex vi ~/.codex/auth.json
5、the same
it works +1
sharptornadoqsh commentedon Mar 17, 2026
skye-12138 commentedon Apr 23, 2026
It’s not working for me. It keeps showing “Reconnecting...”
sharptornadoqsh commentedon Apr 23, 2026