anomalyco / anomalyco/opencode

MCP servers fail to connect when a session starts during self-upgrade

Open
#44,291 2 comments 0 reactions 1 assignee View on GitHub

@rekram1-node is already working on this.

Since Aug 23, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

Started opencode while it was auto-upgrading from an older 1.18.x to 1.18.21. Every configured MCP server (a mix of local stdio servers and remote HTTP servers) failed to connect at startup, and the session never recovered — MCP status stays red with no retry/reconnect. The self-upgrade ran after MCP init:

01:07:14 <remote-mcp>   failed
01:07:20 <remote-mcp>   needs_auth
01:07:45 <local-mcp>    failed
01:07:47 <local-mcp>    failed
01:07:47 <local-mcp>    failed
01:07:47 <local-mcp>    failed
01:07:47 init count=5
01:08:01 upgraded method=npm target=1.18.21

Corroborating: three simultaneous sessions against the same user-scope config showed three different MCP states (all green / one remote server red / all red) — each captured a different startup moment, confirming MCP connection state is a one-shot startup snapshot with no reconnect path.

Plugins

opencode-openai-codex-auth

OpenCode version

1.18.21 (self-upgraded mid-session from an older 1.18.x)

Steps to reproduce

  1. Open a session while a newer opencode release is available (auto-upgrade pending).
  2. Let the session launch during the upgrade window.
  3. Observe all MCPs fail at init and never reconnect.

Operating System

Windows 10

Terminal

Windows Terminal

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.