opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Claude subscription token expires after a period of time

Open leeweisern opened this issue 2 weeks ago • 4 comments

Description

Usually it happens when i stopped using for a while. e.g: 12 hours. The first session i talk to Claude, I will get Error: Token refresh failed: 400

i have to type something random, and then it works. This is a minor issue, but i am using opencode as a remote agent. So it affects the user experience.

From what i am seeing, the token expires, it throws the errors but the refresh token actually succeeds.

So the user have to manually send another message for it to continue.

Image

OpenCode version

1.0.220

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

leeweisern avatar Jan 01 '26 03:01 leeweisern

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

  • #4992: Getting "Unauthorized: token expired" during conversation - Similar token expiration issue during active sessions
  • #6083: Token refresh failed: 403 failed with github copilot - Token refresh failures with Anthropic/GitHub Copilot providers

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

github-actions[bot] avatar Jan 01 '26 03:01 github-actions[bot]

I got the same error after around 10 hours, laptop and my self went to sleep. And then I get this error at first prompt. Image

aldaw avatar Jan 03 '26 08:01 aldaw

Same for me for new sessions after a while (usually next day)

Image

I have to re-prompt for it to actually refresh the token.

n2k3 avatar Jan 05 '26 14:01 n2k3

I have the same issue. Re-Prompting did not help.

drjagan avatar Jan 13 '26 12:01 drjagan

Just had this issue - re-prompting did not help, had to re-connect provider (claude - opencode dekstop win11 25H2)

mehow28 avatar Jan 14 '26 07:01 mehow28

Encountered the same, Image

Now my morning routine includes re-login.

pranshuchittora avatar Jan 14 '26 07:01 pranshuchittora

I hit this most days too, which unfortunately is often followed by #8529 which makes it a bit more of a chore to re-login

bzbetty avatar Jan 14 '26 19:01 bzbetty

how long does it last? is this meant to happen from Anthropic's side? that it expires?

simonsankar avatar Jan 16 '26 21:01 simonsankar