GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||
GeezerVison is showing github.com — feat: Allow disabling failed MCP servers & persist the toggle by VlexWest · Pull Request #56452 · anomalyco/opencode Conversation
|
|
The following comment was made by an LLM, it may be inaccurate: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Works as described. In /mcps, space on a failed server now goes to Disabled (on the base it stayed Failed and only offered retry), and the core/server tests show the flag written to and removed from the defining config file with comments kept. I checked it by driving the TUI on the base and on this branch, and by running the core, server and tui tests plus typecheck for core, server, tui and protocol.
Public API: no new routes or fields, but the meaning of POST /api/experimental/mcp/{server}/connect and /disconnect changes. They now also write disabled: true / enabled: false into (or remove it from) the config file that defines the server. The desktop/web app (packages/app, gui-extensions) call these endpoints too, so their toggles will now save to config as well. The request and response shapes are unchanged. Config.Interface gains an optional setMcpDisabled.
Concerns:
packages/server typecheck and the new server test fail: test/mcp-toggle.test.ts imports jsonc-parser, which isn't a dependency of packages/server. JSON.parse is enough there.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
- add Config.setMcpDisabled for native and v1 MCP entries - add test for jsonc comments and enable/disable roundtrip
- change connect to clear the disabled flag in config - change disconnect to set the disabled flag in config - change route descriptions - add test for a failed server
- change space to disable failed, pending and connected servers - change space to enable disabled servers - add tests for every status
- change disconnect to interrupt a running connect attempt - change interrupted connect to skip the failed status - add test for a server that never answers
- change setMcpDisabled to stay runtime-only when managed config defines the server - add test for a managed server
- change connect to start the server even after a config edit - change toggle test to JSON.parse
d40ca8f to
2132536
Compare
|
@VlexWest Do you mind taking this PR over the finish line? 🙏 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
- fix conflicts with the MCP connection refactor - change disconnect to interrupt pending starts through startConnection - add pooled variant of the pending disconnect test
There was an error while loading. Please reload this page.
|
@eriktisme Done, merged dev & fixed the conflicts, should be good to go now. Now let's hope a maintainer sees & merges it 🙂 (@rekram1-node @kitlangton) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@VlexWest I think this would also fix the V2 location-eviction path in #62868. On 2.2.6 and dev, MCP.disconnect only sets status: "disabled" in memory. After a location services evicted sweep, the Location rebuilds from config and the server reconnects with a new connectionID, so the /mcps choice is silently undone. Writing the flag into the defining config file is what's missing for config-defined servers; mine use the V1 mcp. shape, so enabled: false is the relevant path. It also survives /reload, unlike the runtime toggle. This covers the toggle half of #62868. Would you mind mentioning it in the description as Related: #62868 (rather than Fixes), since the stateful-process loss is separate? It would also be good to add a regression test for the eviction path: disable via the mcp.disconnect endpoint, call LocationServiceMap.invalidate, boot the Location again, and assert the server is still disabled and the config still has the flag. I'm happy to help with that, or open a follow-up test-only PR after this lands if you'd rather keep this one more focused. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
- fix conflict in the MCP dialog test fixture
- add test that a disabled V1 server stays disabled after a location reload - change toggle tests to share one setup
|
@kfunigeneral Ah yes, good catch, thanks! I've added "Related: #62868" to the description & a regression test: a disabled v1 server (mcp.) stays disabled after the Location is being rebuild + the config keeps enabled: false. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Thanks, that's the exact test I was after. The test shape matches my config. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
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:
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. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This was closed by the cleanup bot, not by a review. I'm still actively working on it: it's up to date with dev (merged it again on Nov 9), conflict-free & has a regression test for #62868 that @kfunigeneral asked for. Could a maintainer reopen it? @rekram1-node |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Can't disable an MCP server that failed or is stuck connecting
There was an error while loading. Please reload this page.