mcpcompat: reconcile removals in per-session resource/template/prompt sync
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
Direzione di ricerca
Inizia in mcpcompat/server/session.go con syncSessionTools e confronta la relativa riconciliazione delle rimozioni con syncSessionResources, syncSessionResourceTemplates e syncSessionPrompts. Traccia i percorsi in stile REPLACE di SetSessionResources, SetSessionResourceTemplates e SetSessionPrompts, quindi verifica che le voci omesse vengano rimosse e che venga emesso list_changed; i casi di guardia downstream si trovano in serve_session_test.go in stacklok/toolhive#5969.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Context
In mcpcompat/server/session.go, syncSessionTools reconciles the per-session go-sdk server against the overlay by both adding new tools and removing ones no longer present (srv.RemoveTools(removed...)). The sibling syncs for the other capability kinds are add-only:
syncSessionResourcessyncSessionResourceTemplatessyncSessionPrompts
None of them removes entries that are absent from the new overlay, even though go-sdk exposes RemoveResources / RemoveResourceTemplates / RemovePrompts.
Impact (downstream in toolhive)
toolhive's vMCP list_changed propagation (stacklok/toolhive#5965 for tools, stacklok/toolhive#5969 for resources/prompts) re-derives a session's advertised capabilities on a backend list_changed and applies them with the REPLACE-style SetSessionResources/SetSessionResourceTemplates/SetSessionPrompts. Because the underlying sync is add-only:
- Additions to a backend's resources/templates/prompts propagate to the client correctly.
- Removals do not — a resource/prompt the backend dropped stays registered on the session's go-sdk server and keeps appearing in
resources/list/resources/templates/list/prompts/listuntil the session re-initializes.
Tools do not have this problem because their sync reconciles removals.
Note: read-time access is unaffected downstream (toolhive re-derives admission per call), so this is a stale-list / name-disclosure issue, not an access bypass.
Proposed change
Mirror syncSessionTools' removal reconciliation in syncSessionResources, syncSessionResourceTemplates, and syncSessionPrompts: track the previously-synced names/URIs and call the corresponding go-sdk Remove* for entries absent from the new overlay.
Acceptance
- A REPLACE-style
SetSessionResources/SetSessionResourceTemplates/SetSessionPromptsthat omits a previously-present entry results in that entry being removed from the session's go-sdk server (and a downstreamlist_changedemitted). - After a toolhive-core release + bump, the add-only guard tests in stacklok/toolhive#5969 (
serve_session_test.go, which currently assert removed entries still appear) can be flipped to assert removal, and the NOTE comments atresyncSessionResources/resyncSessionPromptsremoved.
Reported from stacklok/toolhive#5969.
- Lingua principale
- Go
- Stelle
- 2
- Fork
- 6
- Merge medio
- 23h 44m
- PR unite (30g)
- 133
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di stacklok/toolhive-core
-
needs-triage
Difficoltà 4/5 3-5 giorni Idoneità per principianti 54/100
stacklok/toolhive-core#466 ·
I maintainer di solito rispondono entro 1 giorno
-
needs-triage
Difficoltà 3/5 1-2 giorni Idoneità per principianti 66/100
stacklok/toolhive-core#426 ·
I maintainer di solito rispondono entro 1 giorno
-
mcpcompat/server: refuse dispatch of a request whose per-request context is goneForse già presa @jhrozek l’ha presa 15 giorni fa. Apertaneeds-triage
Difficoltà 4/5 3-5 giorni Idoneità per principianti 54/100
stacklok/toolhive-core#414 ·
I maintainer di solito rispondono entro 1 giorno
-
needs-triage
Difficoltà 5/5 Più di una settimana Idoneità per principianti 8/100
stacklok/toolhive-core#343 ·
I maintainer di solito rispondono entro 1 giorno
-
needs-triage
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
stacklok/toolhive-core#342 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di stacklok/toolhive-core
Issue simili
-
Support kubevirt CRDsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
rancher/rancher-ai-mcp#206 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
open-telemetry/opentelemetry-go-compile-instrumentation#1743 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
tomasz-tomczyk/crit#1159 ·
I maintainer di solito rispondono entro 1 giorno
-
SelectOneHealthyInstance panics when instance weights are fractional (e.g. 0.5)Forse già presa @Ajax-1 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
nacos-group/nacos-sdk-go#929 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
google/osv-scanner#3270 ·
I maintainer di solito rispondono entro 1 giorno