Repository navigation
Conversation
A health-driven (or list_changed) session resync re-derives the advertised tool set and REPLACES the session's tool store with it. When a backend that is still considered healthy fails its live capability query mid-sweep, best-effort aggregation omits that backend's tools, so the replacement would drop them until the next health transition (stacklok#6829). Report sweep completeness from the aggregator (AggregationMetadata.Partial), surface it through core.Discover, and have resyncSessionTools keep the existing tool store when the sweep was partial — the next health change or backend-notification resync retries with a fresh sweep. Co-Authored-By: Claude Code <noreply@anthropic.com>
HankGrimm
force-pushed
the
fix/vmcp-partial-tool-resync
branch
from
November 21, 2026 12:19
801bf5b to
8b6d70e
Compare
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
Fixes #6829.
When a backend flips unhealthy⇄healthy,
resyncSessionsOnBackendHealthChangefans a tools resync out to every live session, andresyncSessionToolsreplaces the session's tool store with the freshly aggregated set. Best-effort aggregation logs and continues on a per-backend query failure, so if a still-healthy backend fails its capability query mid-sweep (transient timeout/401), its tools are silently omitted from the re-derived set — and the replacement drops them from the session until the next health transition (-32602 tool not found).Change
AggregationMetadata.Partialreports whether the sweep was incomplete (at least one backend in the set failed its live query), set inAggregateCapabilitiesaslen(capabilities) < len(backends).core.Discoversurfaces it viaDiscoverCapabilities.Partial, from the sameaggregatedViewtheList*methods read.resyncSessionToolskeeps the existing tool store when the sweep was partial, instead of replacing it — the next health change or backend-notification resync retries with a fresh sweep.DiscoverandListToolsshare the capability cache key (identity + forwarded headers + health-filtered backend set), so the partial flagDiscoverreports comes from the same aggregationListToolsreads for the re-derived set.Tests
TestDefaultAggregator_AggregateCapabilities_Partial— a sweep where one backend fails is reported partial; a complete sweep is not.TestResyncSessionTools_KeepsExistingToolsOnPartialSweep— a partial sweep leaves the existing tool store untouched (noSetSessionToolscall).🤖 Generated with Claude Code