Skip to content

fix(mcp): retry transient bootstrap failures - #32468

Closed
hereswilson wants to merge 1 commit into
anomalyco:devfrom
hereswilson:bootstrap-retry
Closed

fix(mcp): retry transient bootstrap failures#32468
hereswilson wants to merge 1 commit into
anomalyco:devfrom
hereswilson:bootstrap-retry

Conversation

@hereswilson

Copy link
Copy Markdown

Issue for this PR

Closes#32379

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Desktop can see transient fetch and MCP startup failures after sleep/wake or network changes, such as Failed to fetch, net::ERR_NETWORK_CHANGED, and net::ERR_NETWORK_IO_SUSPENDED. When that happened during MCP bootstrap, affected MCP tools could stay unavailable until restart.

This adds bounded retries for transient MCP bootstrap failures. The app-side MCP status query uses the shared retry helper and disables TanStack Query's outer retry so the retry budget is not multiplied. The backend MCP startup path retries transient connect and tools/list failures with a bounded Effect schedule, then degrades to the existing failed MCP status if the retry budget is exhausted.

Failed MCP status now flows through the existing status popover path. The popover uses the same MCP severity policy in both status indicator variants and shows the failed server detail in the MCP row.

How did you verify your code works?

From packages/app:

  • bun test --preload ./happydom.ts src/components/status-popover-policy.test.ts src/context/server-sync.test.ts
  • bun typecheck

From packages/core:

  • bun test test/util/retry.test.ts
  • bun typecheck

From packages/opencode:

  • bun test --timeout 30000 test/mcp/lifecycle.test.ts
  • bun typecheck

Also ran:

  • git diff --check
  • pre-push hook: bun turbo typecheck

Screenshots / recordings

N/A. This uses the existing MCP status popover surface.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@hereswilson
hereswilson marked this pull request as ready for review June 15, 2026 18:35
@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Built-in tools (context7, grep_app, ast_grep) fail to register on startup due to bootstrap network race

1 participant

@hereswilson