Skip to content

feat(prompts): react to upstream prompts/list_changed (F13) - #1007

Merged
Dumbris merged 1 commit into
mainfrom
feat/prompts-list-changed
Aug 19, 2026
Merged

feat(prompts): react to upstream prompts/list_changed (F13)#1007
Dumbris merged 1 commit into
mainfrom
feat/prompts-list-changed

Conversation

@Dumbris

@Dumbris Dumbris commented Aug 19, 2026

Copy link
Copy Markdown
Member

Follow-up to the PR #973 prompt-aggregation work (one of the deferred items). When aggregate_upstream_prompts is enabled, an upstream that adds/removes a prompt at runtime now refreshes mcpproxy's aggregated prompt set reactively, instead of staying stale until an unrelated servers.changed event.

How

Mirrors the existing tools/list_changed plumbing exactly:

  • core client dispatches the notification by method (the single OnNotification closure became a method switch) to a new onPromptsChanged callback;
  • managed + manager forward it to a manager-level callback (wired into every new client alongside the tool-discovery callback);
  • the runtime debounces a burst (1s trailing-edge) into a single EventTypeUpstreamPromptsChanged, which listenForRoutingModeRefresh turns into one RefreshPrompts — on the same goroutine servers.changed/config.reloaded already use, so there's no new reentrancy. The runtime callback short-circuits on a live config read when aggregation is off, so an opted-out proxy pays nothing.

Tests

  • Debouncer coalesces a burst to one fire (and re-arms after the window).
  • The core prompts/list_changed handler fires the callback (+ nil-safe).

End-to-end server→client push is covered by manual QA — the in-process test transport (NewTestStreamableHTTPServer) does not reliably deliver server-initiated notifications, so the automated tests assert the deterministic wiring instead.

🤖 Generated with Claude Code

Follow-up to the PR #973 prompt-aggregation work. When aggregation is enabled,
an upstream that adds/removes a prompt at runtime now refreshes the aggregated
prompt set reactively instead of waiting for an unrelated servers.changed event.

Mirrors the existing tools/list_changed plumbing: core client dispatches the
notification by method to a new onPromptsChanged callback (connection_lifecycle
refactored to a method switch), managed + manager forward it, and the runtime
debounces a burst (1s trailing-edge) into a single EventTypeUpstreamPromptsChanged
that listenForRoutingModeRefresh turns into one RefreshPrompts — on the same
goroutine servers.changed/config.reloaded already use, so no new reentrancy. The
runtime callback short-circuits (live config read) when aggregation is off, so an
opted-out proxy pays nothing.

Tests: debouncer coalesces a burst to one fire; core prompts/list_changed handler
fires the callback (+ nil-safe). End-to-end server->client push is covered by
manual QA (the test transport does not reliably push notifications).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H7J8Yv5zr4tMQZaY3ot3Za
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9f24ad6
Status: ✅  Deploy successful!
Preview URL: https://cabbe293.mcpproxy-docs.pages.dev
Branch Preview URL: https://feat-prompts-list-changed.mcpproxy-docs.pages.dev

View logs

@github-actions

Copy link
Copy Markdown

📦 Build Artifacts

Workflow Run: View Run
Branch: feat/prompts-list-changed

Available Artifacts

  • archive-darwin-amd64 (29 MB)
  • archive-darwin-arm64 (26 MB)
  • archive-linux-amd64 (17 MB)
  • archive-linux-arm64 (15 MB)
  • archive-windows-amd64 (28 MB)
  • archive-windows-arm64 (25 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (23 MB)
  • installer-dmg-darwin-arm64 (20 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 32246888728 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/server/server.go 0.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Dumbris
Dumbris merged commit 12575c6 into main Aug 19, 2026
39 of 40 checks passed
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.

2 participants