anomalyco / anomalyco/opencode
Copilot re-auth prompted every session despite stored credential — expires:0, refresh == access
Open
@rekram1-node is already working on this.
Since Aug 2, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
After completing the GitHub Copilot device-code login successfully(the student package), opencode still
prompts to reauthenticate on every new session, even though opencode auth list shows
a credential is stored.
Steps to reproduce
opencode auth login→ GitHub Copilot → GitHub.com → complete device code flowopencode auth listconfirms a credential exists- Close and reopen opencode (or start a new session) → prompted to reauth again
Observation
Contents of ~/.local/share/opencode/auth.json after a fresh login:
{
"github-copilot": {
"type": "oauth",
"access": "gho_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"refresh": "gho_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"expires": 0
}
}
Two things stand out that may or may not be related to the reauth prompts:
expiresis0right after a successful loginaccessandrefreshhave identical values
Not sure if this is expected behavior for how Copilot's device flow issues tokens, or a
storage bug — flagging in case it's useful for reproducing the reauth issue.
Environment
- OpenCode version: [
1.18.11] - OS: Linux(ubuntu 24.04 LTS)
- Shell: fish
-terminal-emulator: alacritty - Auth: GitHub Copilot, device code flow, GitHub.com
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.