Error: Token refresh failed: 401 #7904

Open
opened 2026-02-16 18:08:37 -05:00 by yindo · 3 comments
Owner

Originally created by @christophermowrey on GitHub (Jan 28, 2026).

Originally assigned to: @adamdotdevin on GitHub.

Description

Using GPT 5.2 Codex or 5.2 gives me:
Error: Token refresh failed: 401

No obvious way how to refresh token. /connect does not work in desktop app. Restarting app doesn't help. Deleting the cache folder doesn't help.

This was working previously a few days ago and no longer is working.

Using a different model like Big Pickle works.

Plugins

Unsure / NA

OpenCode version

Version 1.1.40 (1.1.40) Desktop for Mac

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

Version 15.4.1 (24E263)

Terminal

No response

Originally created by @christophermowrey on GitHub (Jan 28, 2026). Originally assigned to: @adamdotdevin on GitHub. ### Description Using GPT 5.2 Codex or 5.2 gives me: Error: Token refresh failed: 401 No obvious way how to refresh token. /connect does not work in desktop app. Restarting app doesn't help. Deleting the cache folder doesn't help. This was working previously a few days ago and no longer is working. Using a different model like Big Pickle works. ### Plugins Unsure / NA ### OpenCode version Version 1.1.40 (1.1.40) Desktop for Mac ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System Version 15.4.1 (24E263) ### Terminal _No response_
yindo added the bugweb labels 2026-02-16 18:08:37 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 28, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #10909: Error: Token refresh failed: 401 - Similar OpenAI OAuth token refresh issue
  • #9711: [BUG] GitLab OAuth token not auto-refreshed on 401 during session - Token refresh authentication failures
  • #9111: OAuth token expires after inactivity causing 'Token refresh failed: 400' - Token expiration and refresh issues

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 28, 2026): This issue might be a duplicate of existing issues. Please check: - #10909: Error: Token refresh failed: 401 - Similar OpenAI OAuth token refresh issue - #9711: [BUG] GitLab OAuth token not auto-refreshed on 401 during session - Token refresh authentication failures - #9111: OAuth token expires after inactivity causing 'Token refresh failed: 400' - Token expiration and refresh issues Feel free to ignore if none of these address your specific case.
Author
Owner

@christophermowrey commented on GitHub (Jan 29, 2026):

After selecting the model -> + -> "Connect Provider" -> OpenAI -> ChatGPT Pro/Plus (browser), was able to relogin and resolve the issue. Feel free to close, but probably implementing a system to auto login to refresh token or prompting the user how to resolve these steps would be helpful.

@christophermowrey commented on GitHub (Jan 29, 2026): After selecting the model -> + -> "Connect Provider" -> OpenAI -> ChatGPT Pro/Plus (browser), was able to relogin and resolve the issue. Feel free to close, but probably implementing a system to auto login to refresh token or prompting the user how to resolve these steps would be helpful.
Author
Owner

@pedropereira-cd commented on GitHub (Feb 13, 2026):

In windows, I had configured .config\opencode\opencode.jsonc in order to enable plugins and only after I deleted this file was I able to re-configure OpenAI login using the browser.
Before deleting the file there was no option to do that, only to setup OpenAI via API key.

@pedropereira-cd commented on GitHub (Feb 13, 2026): In windows, I had configured `.config\opencode\opencode.jsonc` in order to enable plugins and only after I deleted this file was I able to re-configure OpenAI login using the browser. Before deleting the file there was no option to do that, only to setup OpenAI via API key.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7904