GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — mcp: remote server stays failed after system wake, retries stop after ~1.3s · Issue #62405 · anomalyco/opencode

mcp: remote server stays failed after system wake, retries stop after ~1.3s #62405

New issue
Copy link
New issue
Copy link
Closed as duplicate
Closed as duplicate
mcp: remote server stays failed after system wake, retries stop after ~1.3s#62405
Copy link
Labels
pending closetriaging

Description

@armin-pirislabs
armin-pirislabs
opened on Nov 6, 2026
Issue body actions

Summary

Remote MCP servers get stuck in failed when the machine wakes from sleep. OpenCode reconnects right after wake, before Windows DNS is back. Every attempt fails with getaddrinfo ENOTFOUND, OpenCode stops retrying after ~1.3 seconds, and the server stays failed until I reconnect it by hand.

Environment

  • opencode version: 2.2.5
  • OS: Windows NT 10.0.26300 (win32 x64), Modern Standby
  • Terminal: Unavailable: terminal environment variables are not set
  • Shell: cmd.exe
  • Install/channel: latest
  • Active plugins: github:PirisLabs/opencode-provider#13d02816762a764dccdba5fbbdb41a731762eb3f

Reproduction

  1. Configure a remote MCP server, for example notion with type: remote and url: https://mcp.notion.com/mcp, OAuth. opencode mcp list shows connected.
  2. Put the machine to sleep with the TUI and the background service running.
  3. Wake it with the power button.
  4. The TUI reconnects. The service tears down the old MCP session and opens a new one.
  5. Windows Wi-Fi and DNS need a few seconds after wake. The connect attempts run before DNS is back and fail with getaddrinfo ENOTFOUND mcp.notion.com.
  6. opencode mcp list shows failed. It stays that way.

Expected Behavior

A short DNS failure after wake should not fail the server for good. Retry with backoff for 30-60s, or retry a failed server every few minutes, so it recovers by itself.

Actual Behavior

3 attempts over ~1.3 seconds, then the server goes to failed and nothing retries it. It stayed failed for 28+ minutes, until I reconnected it by hand. DNS was back within a minute of wake.

Log excerpt (UTC, trimmed):

18:01:19.570Z INFO  location services evicted
18:01:19.984Z WARN  mcp http request failed method=DELETE durationMs=253
                   errors=[{"type":"TypeError","message":"getaddrinfo ENOTFOUND mcp.notion.com","code":"ENOTFOUND","errno":4}]
18:01:20.009Z WARN  failed to terminate MCP session server=notion error="getaddrinfo ENOTFOUND mcp.notion.com"
18:01:25.374Z WARN  mcp http request failed method=POST durationMs=26 (same ENOTFOUND)
18:01:25.376Z WARN  retrying MCP connect server=notion
18:01:25.630Z WARN  mcp http request failed method=POST durationMs=1 (same ENOTFOUND)
18:01:25.631Z WARN  retrying MCP connect server=notion
18:01:26.649Z WARN  mcp http request failed method=POST durationMs=4 (same ENOTFOUND)
18:01:26.651Z WARN  mcp connect failed server=notion status.status=failed status.error="getaddrinfo ENOTFOUND mcp.notion.com"

Retry gaps: 0s, +0.26s, +1.02s. Nothing after that.

Windows event log confirms the wake at the same moment:

Kernel-Power 42          01:34:32Z    system entering sleep (button or lid)
Kernel-General 1         18:01:19.5Z  system time changed from 01:34:37Z to 18:01:19.5Z, delta 59,202,477 ms (~16.4h)
Power-Troubleshooter 1   18:01:19.5Z  returned from low power state, wake reason: power button

I checked DNS a minute later: Resolve-DnsName and Node dns.lookup both resolve the host, and a plain curl POST to the endpoint returns HTTP 401 in 0.22s.

Additional Context

  • Config, OAuth credential, and endpoint are all fine. The token refresh worked on the manual reconnect and the server connected with 78 tools.
  • Workarounds: /mcps in the TUI then connect, POST /api/experimental/mcp/{server}/connect with a location[directory] query param, or opencode service restart.
  • Re-saving opencode.json does not reconnect a failed server. The config.updated event fires but there is no new connect attempt.
  • No retry or backoff config for MCP connections in 2.2.5, only startup/catalog/execution timeouts.
  • Not just sleep/wake. Any short DNS outage hits this. On Oct 22 this machine had ~1h with no DNS and every network call in the log failed the same way. MCP is the one that never recovers, because nothing retries it.

Activity

  1. opencodejr commented on Nov 6, 2026

    @opencodejr
    opencodejrBot
    on Nov 6, 2026
    Contributor
    More actions

    Thanks for the detailed report. The timestamps and the Windows event log make the timing very clear.

    I think this is a duplicate of #52237. It reports the same problem: a remote MCP server fails while the network is briefly down after sleep/wake, then stays failed. Nothing retries it until you reconnect it by hand or run opencode service restart. Its comments already include Windows reproductions with the same pattern: a few fast retries, then connect failed, then nothing.

    Possible duplicates and related issues, most likely first:

    • mcp: remote MCP servers that fail once are never retried until service restart #52237: the same problem. Remote MCP servers that fail once during a network outage are never retried.
    • mcp: remote server latched as failed after one transient DNS error (no retry/backoff) #62369: opened today with the same getaddrinfo ENOTFOUND after wake from sleep, on Linux with 2.2.5.
    • mcp: failed-at-init servers are never retried for the session lifetime #61105: closed as a duplicate of mcp: remote MCP servers that fail once are never retried until service restart #52237. Remote servers fail on timeouts while the network is down after wake and are never retried.
    • fix(mcp): recover remote servers without unnecessary sign-in #61762 and fix(mcp): reconnect dropped servers with backoff #54378: open pull requests that add recovery with backoff for failed or dropped MCP servers.

    Your finding that re-saving opencode.json does not reconnect a failed server would be useful as a comment on #52237. So would the ~1.3s retry window.

    Until then, the workaround you found still applies: open /mcps in the TUI and reconnect the failed server.

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.

  2. opencodejr
    added
    pending close
    triaging
    on Nov 6, 2026
  3. opencodejr
    closed this as duplicateon Nov 7, 2026
  4. opencodejr commented on Nov 7, 2026

    @opencodejr
    opencodejrBot
    on Nov 7, 2026
    Contributor
    More actions

    No reply came in, so I'm closing this as a duplicate of #52237. That issue covers the same problem: a remote MCP server fails while the network or DNS is briefly down after sleep/wake, then stays failed with no further retries. Please follow it for updates. Open pull requests #61762 and #54378 both aim to add reconnects with backoff.

    Your timing details (3 attempts within ~1.3s) and the finding that re-saving opencode.json does not reconnect a failed server would be useful as a comment on #52237.

    Until then, you can reconnect the failed server without restarting the service: open /mcps in the TUI and connect it. If your problem turns out to be different, reply here and we can reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pending closetriaging

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.