Auth keeps resetting #2649

Closed
opened 2026-02-16 17:36:36 -05:00 by yindo · 10 comments
Owner

Originally created by @frap129 on GitHub (Nov 6, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

Every few hours, I have to reauth all of my providers. Mid session, the model response will hang. I interrupt, and then all messages after that have an error about the API key being missing, forcing me to close an reauth.

OpenCode version

1.0.37. Has been happening since 1.x upgrade

Steps to reproduce

Unsure of the conditions that cause it. I have tried removing all plugins in case one was causing it, but issue persists.

Screenshot and/or share link

Image

Operating System

Arch Linux, but installed with bun -g

Terminal

Alacritty

Originally created by @frap129 on GitHub (Nov 6, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description Every few hours, I have to reauth all of my providers. Mid session, the model response will hang. I interrupt, and then all messages after that have an error about the API key being missing, forcing me to close an reauth. ### OpenCode version 1.0.37. Has been happening since 1.x upgrade ### Steps to reproduce Unsure of the conditions that cause it. I have tried removing all plugins in case one was causing it, but issue persists. ### Screenshot and/or share link <img width="763" height="713" alt="Image" src="https://github.com/user-attachments/assets/ebacdc3e-3062-4e18-8f10-3f12949fe3d7" /> ### Operating System Arch Linux, but installed with `bun -g` ### Terminal Alacritty
yindo added the bug label 2026-02-16 17:36:36 -05:00
yindo closed this issue 2026-02-16 17:36:36 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 6, 2025):

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

  • #1631: "AI_APICallError: No auth credentials found" despite providing credentials
  • #425: Claude session reset notifications - both involve auth issues mid-session
  • #1597: Improve provider and API key update workflow after initial setup - discusses auth workflow issues
  • #412: migrating from anthropic api key to max subscription doesn't work - similar auth persistence problems

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

@github-actions[bot] commented on GitHub (Nov 6, 2025): This issue might be a duplicate of existing issues. Please check: - #1631: "AI_APICallError: No auth credentials found" despite providing credentials - #425: Claude session reset notifications - both involve auth issues mid-session - #1597: Improve provider and API key update workflow after initial setup - discusses auth workflow issues - #412: migrating from anthropic api key to max subscription doesn't work - similar auth persistence problems Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Nov 6, 2025):

@frap129 are these oauth flows specifically?

@rekram1-node commented on GitHub (Nov 6, 2025): @frap129 are these oauth flows specifically?
Author
Owner

@frap129 commented on GitHub (Nov 6, 2025):

No, the three providers I use are Anthropic (OAUTH), Google, and OpenRouter. All get reset at the same time

@frap129 commented on GitHub (Nov 6, 2025): No, the three providers I use are Anthropic (OAUTH), Google, and OpenRouter. All get reset at the same time
Author
Owner

@rekram1-node commented on GitHub (Nov 6, 2025):

Okay now that's odd I haven't heard of this...

if u run opencode auth list are they showing up properly?

Are they authed using opencode auth login or are they api keys you have exported as env vars?

@rekram1-node commented on GitHub (Nov 6, 2025): Okay now that's odd I haven't heard of this... if u run `opencode auth list` are they showing up properly? Are they authed using `opencode auth login` or are they api keys you have exported as env vars?
Author
Owner

@frap129 commented on GitHub (Nov 6, 2025):

They return properly with opencode auth list. They were all done with opencode auth login. Edited the OP to mention that even though I'm on Arch, opencode is installed with bun -g, not the AUR package in case that matters. Not sure how to best help debug this, next time it happens I'll pop open the console and try to get a log.

@frap129 commented on GitHub (Nov 6, 2025): They return properly with `opencode auth list`. They were all done with `opencode auth login`. Edited the OP to mention that even though I'm on Arch, opencode is installed with `bun -g`, not the AUR package in case that matters. Not sure how to best help debug this, next time it happens I'll pop open the console and try to get a log.
Author
Owner

@rekram1-node commented on GitHub (Nov 6, 2025):

If it happens, you should try to do opencode run hello --print-logs and dump that output if u can

@rekram1-node commented on GitHub (Nov 6, 2025): If it happens, you should try to do `opencode run hello --print-logs` and dump that output if u can
Author
Owner

@rekram1-node commented on GitHub (Nov 6, 2025):

and prolly do opencode auth list again before u try authing again

@rekram1-node commented on GitHub (Nov 6, 2025): and prolly do `opencode auth list` again before u try authing again
Author
Owner

@frap129 commented on GitHub (Nov 6, 2025):

Caught it! Grabbed the log from ~/.local/share/opencode/log. Note that here I was using an opencode-gemini-auth plugin. After the issue occurred, opencode auth list reports 0 credentials.

2025-11-07T021324.log

@frap129 commented on GitHub (Nov 6, 2025): Caught it! Grabbed the log from `~/.local/share/opencode/log`. Note that here I was using an `opencode-gemini-auth` plugin. After the issue occurred, `opencode auth list` reports 0 credentials. [2025-11-07T021324.log](https://github.com/user-attachments/files/23407459/2025-11-07T021324.log)
Author
Owner

@rekram1-node commented on GitHub (Nov 6, 2025):

id imagine the plugin is wiping your config then maybe?

@rekram1-node commented on GitHub (Nov 6, 2025): id imagine the plugin is wiping your config then maybe?
Author
Owner

@frap129 commented on GitHub (Nov 7, 2025):

Yep, after some testing would appear so. Apologies for the confusion.

@frap129 commented on GitHub (Nov 7, 2025): Yep, after some testing would appear so. Apologies for the confusion.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2649