Skip to content

fix(server): handle engine stopping during MCP settle readiness wait - #7660

Open
sentry[bot] wants to merge 2 commits into
devfrom
seer/fix-mcp-settle-engine-stopped
Open

sentry[bot] wants to merge 2 commits into
devfrom
seer/fix-mcp-settle-engine-stopped

Conversation

@sentry

@sentry sentry Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

What is this about?

Removing or disconnecting an MCP server in a workspace can fail with an error when the OpenCode v2 engine stops during the change.

What problem does it solve?

The request fails even though the configuration change was already saved. The mutation is reported as broken when the change itself succeeded.

What was the situation before?

flowchart TD
  A[v2 sidecar stops or leaves chat routing while provider push is pending] --> B[ensureWorkspaceReady throws: OpenCode v2 is not running]
  B --> C[settleWorkspaceMcp awaits it without catching]
  C --> D[Mutation request fails, e.g. DELETE /workspace/:id/mcp/:server]
  E[Config change already saved] --> D
Loading

How is this implemented?

  • settleWorkspaceMcp wraps the ensureWorkspaceReady call in server.ts.
  • If the v2 sidecar has stopped or is no longer routing chats, it returns early instead of throwing.
  • The saved config is reconciled by v2 when it next starts or opens the folder.
  • Any other error is rethrown unchanged.

What else changed?

none

Release note

You can now remove or disconnect an MCP server while the OpenCode v2 engine is stopping, without seeing an error. The change is saved and applied when the engine next starts.

Fixes DESKTOP-APP-4G

@sentry <feedback>: Autofix iterates on these changes
@sentry stop iterating: Autofix stops iterating on this run

This PR was automatically generated by Sentry at no cost. You can adjust this setting at any time.

@vercel

vercel Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated
openwork-app Skipped Skipped Nov 22, 2026 11:03pm UTC
openwork-den Skipped Skipped Nov 22, 2026 11:03pm UTC
openwork-landing Skipped Skipped Nov 22, 2026 11:03pm UTC

Request Review

@vercel
vercel Bot temporarily deployed to Preview – openwork-den November 22, 2026 22:59 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-landing November 22, 2026 22:59 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-app November 22, 2026 22:59 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-landing November 22, 2026 23:03 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-app November 22, 2026 23:03 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-den November 22, 2026 23:03 Inactive

This branch was previously deployed

3 inactive deployments
Preview – openwork-landing — 35ef169a Deployed Nov 22, 2026 by vercel[bot]
Preview – openwork-app — 35ef169a Deployed Nov 22, 2026 by vercel[bot]
Preview – openwork-den — 35ef169a Deployed Nov 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants