GeezerVison is showing github.com — fix(core): keep MCP prompts when a refresh fails by Tarquinen · Pull Request #62266 · anomalyco/opencode
Conversation
Tarquinen
commented
Nov 6, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Issue for this PR
Closes #50918
Type of change
- Bug fix
- New feature
- Refactor / code improvement
- Documentation
What does this PR do?
If an MCP server says its prompts changed and the follow-up prompts/list fails, all of that server's prompts vanish from the command list, while the server still shows as connected. A failed refresh now keeps the previous prompts, the same way tools already work. If the very first listing fails, there are still no prompts. Same approach as #50920 by @feiiiiii5.
How did you verify your code works?
Ran opencode serve with a local MCP server whose second prompts/list fails. On dev its prompt disappeared from the command list after the refresh; on this branch it stays. Typecheck and the MCP tests pass.
Visual
<svg xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72" fill="none" font-family="ui-monospace,Menlo,monospace" font-size="12">
<style>
.ping{animation:ping 4s ease-in-out infinite;opacity:0}
@keyframes ping{0%,20%{opacity:0}35%,60%{opacity:.6}75%,100%{opacity:0}}
@media (prefers-reduced-motion:reduce){.ping{animation:none;opacity:0}}
</style>
<rect x="1" y="1" width="238" height="70" rx="10" stroke="currentColor" stroke-opacity=".2"/>
<text x="16" y="26" fill="currentColor" fill-opacity=".5">/commands</text>
<text x="16" y="50" fill="currentColor">/flaky:greet</text>
<g class="ping">
<text x="130" y="26" fill="currentColor">list_changed</text>
<text x="130" y="50" fill="currentColor">list failed</text>
<path d="M118 44l6 6m0-6l-6 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
</g>
</svg>
Checklist
- I have tested my changes locally
- I have not included unrelated changes in this PR
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix works. I ran the #50918 reproduction on the base and on this branch. A prompts/list_changed followed by a failing prompts/list wipes the server's prompts to [] on the base while it still shows connected. With this change, greet stays and the 'failed to list MCP prompts' warning is still logged. The MCP tests pass apart from one process-cleanup timeout, which fails the same way on the base. tsc -b for packages/core is clean.
A failed refresh now skips both the state update and mcp.prompts.changed, which matches refreshTools. The first listing after connect still starts from [], and stop still sends the change event on teardown, so reconnects aren't affected.
The public API is unchanged.
No concerns.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
autonull
pushed a commit
to autonull/opencode_spacegraph
that referenced
this pull request
Nov 7, 2026
This was referenced Nov 10, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|