Repository navigation
Conversation
An embedder that wraps the vMCP core with a per-identity view has a change that neither a backend list_changed nor a health flip reports, so connected clients keep the tool list they got at registration. ResyncTools triggers the registered sessions' tools resync workers for the sessions whose registration-time identity satisfies a match function. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
reyortiz3
requested review from
ChrisJBurns,
JAORMX,
amirejaz,
jerm-dro,
jhrozek,
rdimitrov and
tgrunnagle
as code owners
November 6, 2026 22:26
reyortiz3
marked this pull request as draft
November 6, 2026 22:30
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7072 +/- ##
==========================================
- Coverage 80.89% 80.84% -0.05%
==========================================
Files 864 864
Lines 88634 88647 +13
==========================================
- Hits 71699 71669 -30
- Misses 16930 16973 +43
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
An embedder that wraps the vMCP core with a per-identity view has a change that nothing reports. For example, a user loses the credential for one backend and that user's tool list should change, while the backend and its health do not. Neither a backend
notifications/tools/list_changednor a backend health change fires, so an already-connected client keeps the tool list it got at registration until it reconnects.Serveralready re-derives a live session's tools (runListChangedResync) and replaces its tool store, and the SDK then sendsnotifications/tools/list_changeddownstream. Only two things trigger it today, and both entry points are unexported. This adds an exported trigger for the embedder.Server.ResyncTools(match func(*auth.Identity) bool) int. It schedules the registered sessions' tools resync workers for the sessions whose registration-time identity satisfiesmatch(nil selects all), and returns how many it scheduled.listChangedResyncWorker, which already closes over it, so the registry signature and its callers stay unchanged.matchselects no session. Per-session coalescing is unchanged.Type of change
Test plan
go test -race ./pkg/vmcp/server/(whole package, including the existing resync and list_changed tests)golangci-lint run ./pkg/vmcp/server/...reports 0 issuestask test(the full repo) was not runNew tests in
serve_session_resync_test.gocover: only matching sessions are resynced, a nilmatchselects all, an anonymous session reachesmatchas nil, no match does nothing and does not purge, and optimizer mode does nothing. Removing thematchfilter makes the first and fourth fail.Does this introduce a user-facing change?
A new exported method on
Server. Existing behavior is unchanged.Special notes for reviewers
ResyncToolsis deliberately notResyncSessionTools, which would differ from the existing unexportedresyncSessionToolsonly by case.matchruns on the caller's goroutine over a snapshot of the registry, outside its lock, and receives the identity the session was registered for. It must not mutate it.Generated with Claude Code