Skip to content

Getting "Unauthorized: token expired" during conversation #4992

@grahamcropley

Description

@grahamcropley

Description

During normal interaction while the agent is working / responding, it will occasionally abruptly stop with a red bordered message that just says "Unauthorized: unauthorised: token expired". I'm using Github Copilot as the provider, and seen it happen on Claude-Sonnet-4.5 for certain.

All I have to do is say "carry on" or similar, and it continues fine.

Image

Only observed this in the last couple of days, I believe it only started since around the version that introduced support for GPT-5.1-codex via Githob Copilot (i.e., the API endpoint change)... nnot that I'm using that model at the moment.... hope that helps?!

I appreciate this is intermittent, perhaps only 2-3 times today of pretty much constant use. Is there any useful settings or command line parameters that I could use, to help catch some details when/if it happens again?

OpenCode version

1.0.126

Steps to reproduce

Talk to the agent. I can't say if there is any specific trigger, it has happened while delegating to a sub-agent as well as a straight forward single agent interaction.

Screenshot and/or share link

Image

Operating System

Windows 11 > WSL 2 > Ubuntu 24.04

Terminal

Windows Terminal WSL

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions