You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
server: auth and MCP connections fail after idle period #43444
After OpenCode remains running and the Mac is idle for several hours, returning to the session results in provider authentication failing and MCP servers not reconnecting. Restarting OpenCode usually takes multiple attempts before authentication works and all MCPs load again.
Recent logs show the provider failure:
Failed to drain Session ... Invalid API key.
At the same time, every remote MCP repeatedly fails to reconnect:
This started after a recent OpenCode update and happens consistently after leaving OpenCode idle for a few hours. Once recovery succeeds, opencode mcp list shows all six servers connected.
Plugins
./plugins/agent-arcade.tsx
OpenCode version
1.18.16 (release; issue began after an update)
Steps to reproduce
Start OpenCode with remote MCP servers configured.
Leave OpenCode running and the Mac idle for several hours.
Return to the existing session and send a prompt.
Observe provider authentication failing and MCP connection errors.
Restart OpenCode; multiple restarts may be required before MCPs reconnect.
Expected behavior
The existing provider session remains authenticated, and MCP servers reconnect automatically after the machine resumes or network access returns.
Screenshot and/or share link
Not available. Relevant redacted log excerpts are included above.
Activity
Tarquinen commentedon Oct 20, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊