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 — fix(core): refresh MCP tools before session snapshots by Dante-dan · Pull Request #54942 · 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.
The change looks sound to me, and I have no blocking concerns.
How I checked it: the new regression test fails on the base and passes with this PR. test/mcp.test.ts has one failure, the descendant-cleanup timeout, and the base has the same one. Session tests and the packages/core type check pass. I could not run the ACP resume reproduction from #54794, because it needs the free hosted model, which rejects local builds, and a mock provider does not trigger the race. So I have only verified the fix at the registry level, not end to end over ACP.
On cost: flush runs before every step, and it now takes the reconcile lock and calls MCP.tools(). That is an in-memory read, so the extra work per step is small. The unchanged-list check by reference (===) is correct, because entries are only replaced with new objects when the server re-lists its tools.
Public API: unchanged.
Overlap: #52214 (open) adds a separate refresh that the MCP add/remove/connect/disconnect routes await, and it keeps flush limited to waiting for the initial registration. Folding the refresh into flush, as this PR does, also covers those routes for the next session snapshot, so the two PRs should be reconciled before both land.
Related: #39902
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for tracking this down, @Dante-dan. Your diagnosis was right: the resumed turn's tool snapshot ran before the 100 ms debounced MCP reload, so a reconnected tool showed up as removed. The same fix has since landed on This branch now conflicts with |
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.
ACP resume sometimes marks a reattached MCP tool as removed
There was an error while loading. Please reload this page.