GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(core): keep cached MCP prompts when a refresh fails by feiiiiii5 · Pull Request #50920 · anomalyco/opencode

Conversation

@feiiiiii5

@feiiiiii5 feiiiiii5 commented Sep 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Issue for this PR

Closes #50918 (#50918)

Type of change

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

What does this PR do?

Drops the Effect.orElseSucceed(() => []) in refreshPrompts (packages/core/src/mcp/index.ts:305-312). A failed prompts/list was converted into an empty list, which was then assigned over entry.prompts and announced through PromptsChanged, so one transient server error deleted a connected server's prompts and every reader was told the list is legitimately empty (packages/core/src/plugin/command.ts:18-24 re-reads and reloads commands on that event).

refreshTools immediately above (:298-303) already propagates the failure and therefore keeps the tools it had. Removing the swallow makes prompts behave the same way: the failed listing never reaches the Effect.map that writes the cache, the callers run it through live/whenLive, which log it (failed to list MCP prompts), and status stays untouched.

How did you verify your code works?

Test first, watched it fail on the base commit, then changed the source. All runs use the repo-pinned toolchain, [email protected] (the pre-push hook requires it).

Rebased onto 328f74c21 and re-run; the counts below are from that base.

  • bun test test/mcp.test.ts in packages/core: with the orElseSucceed put back, 78 pass / 1 fail — keeps cached MCP prompts when a prompts refresh fails. With the change, 79 pass / 0 fail.
  • bun run check from the repo root: 32/32 tasks (oxlint plus the workspace typecheck).

What I did not verify: I did not drive a live session against a real MCP server whose prompts/list flakes. The user-visible step — commands reloading to empty — is a code read of the PromptsChanged subscriber above.

Out of scope on purpose: resourceCatalog swallows resources/list and templates/list the same way (:671-672), so an unavailable catalog is indistinguishable from an empty one. Reporting that needs a shape decision, so it is not in this PR.

Screenshots / recordings

Not a UI change.

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.

All reactions
@github-actions github-actions Bot added the needs:issue label Sep 23, 2026
@github-actions

github-actions Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@feiiiiii5
feiiiiii5 force-pushed the prompt-cache branch from 9ed39c6 to 1d8e2d9 Compare September 24, 2026 12:44
@kvnloo kvnloo mentioned this pull request Sep 25, 2026
[origin-review] anomalyco/opencode#50920 — CHECK kvnloo/opencode#41
Open
@feiiiiii5 feiiiiii5 mentioned this pull request Sep 27, 2026
A failed resources/list is reported as an empty catalog while the server stays connected #51645
Open
@feiiiiii5 feiiiiii5 mentioned this pull request Oct 5, 2026
fix(ripgrep): retry failed binary resolution #51192
Closed
3 of 6 tasks
@feiiiiii5

feiiiiii5 commented Oct 6, 2026

Copy link
Copy Markdown
Author

Hi — three PRs of mine are sitting in the same state and I would rather ask once than three times: #50920, #51123 and #51314 are all blocked on needs:issue, and the bot comment on each says no linked issue. #51123 closes #51119 and #50920 closes #50918, so I read that as the check looking at a different branch than the one the PRs target: these target v2 while the repository default is dev, and GitHub only records closingIssuesReferences when a PR's base is the default branch.

Before I go change anything: is that the intended behaviour, or is needs:issue supposed to resolve against v2? If it is intended, then these three need a different way to be associated and I would rather know which before reworking them. If it is the branch thing, no PR change is needed and I will leave them as they are.

All three are green and small: #50920 drops one Effect.orElseSucceed(() => []) so a failed prompts/list stops overwriting the cached list (the sibling refreshTools directly above already propagates), #51123 propagates the three blocker-lookup failures instead of replacing them with undefined, and #51314 logs the missing provider/model before the title model falls back to the session model. Each has a regression test that fails on its base. I am not going to ping again after this.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thdxr
thdxr changed the base branch from v2 to dev October 10, 2026 19:15
@github-actions github-actions Bot removed the needs:issue label Oct 10, 2026
@feiiiiii5
fix(core): keep cached MCP prompts when a refresh fails
b4d80b4
@feiiiiii5
feiiiiii5 force-pushed the prompt-cache branch from 1d8e2d9 to b4d80b4 Compare October 15, 2026 01:43
@github-actions

github-actions Bot commented Oct 23, 2026

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot closed this Oct 23, 2026
@github-actions github-actions Bot added the automated-pr-cleanup label Oct 23, 2026
@Tarquinen Tarquinen mentioned this pull request Nov 6, 2026
fix(core): keep MCP prompts when a refresh fails #62266
Merged
3 of 6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

automated-pr-cleanup

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

MCP prompts/list failure wipes the cached prompt list and announces it as empty

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@feiiiiii5
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.