mcpcompat: reconcile removals in per-session resource/template/prompt sync
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 72/100
Línea de trabajo
Empieza en mcpcompat/server/session.go con syncSessionTools y compara su reconciliación de eliminaciones con syncSessionResources, syncSessionResourceTemplates y syncSessionPrompts. Traza las rutas de estilo REPLACE de SetSessionResources, SetSessionResourceTemplates y SetSessionPrompts; después, verifica que las entradas omitidas se eliminen y que se emita list_changed; los casos de protección posteriores están en serve_session_test.go en stacklok/toolhive#5969.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Go
- Estrellas
- 2
- Forks
- 6
- Merge medio
- 23 h 44 min
- PR fusionados (30 d)
- 133
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de stacklok/toolhive-core
-
needs-triage
Dificultad 4/5 3-5 días Aptitud para principiantes 54/100
stacklok/toolhive-core#466 ·
Los mantenedores suelen responder en 1 día
-
needs-triage
Dificultad 3/5 1-2 días Aptitud para principiantes 66/100
stacklok/toolhive-core#426 ·
Los mantenedores suelen responder en 1 día
-
mcpcompat/server: refuse dispatch of a request whose per-request context is gonePosiblemente ocupada @jhrozek la tomó hace 15 días. Abiertoneeds-triage
Dificultad 4/5 3-5 días Aptitud para principiantes 54/100
stacklok/toolhive-core#414 ·
Los mantenedores suelen responder en 1 día
-
needs-triage
Dificultad 5/5 Más de una semana Aptitud para principiantes 8/100
stacklok/toolhive-core#343 ·
Los mantenedores suelen responder en 1 día
-
needs-triage
Dificultad 5/5 Más de una semana Aptitud para principiantes 12/100
stacklok/toolhive-core#342 ·
Los mantenedores suelen responder en 1 día
Todos los issues de stacklok/toolhive-core
Issues similares
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
fabriziosalmi/secure-proxy-manager#619 ·
Los mantenedores suelen responder en 1 día
-
bug needs-triage P1 tier:1-mechanical
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
krakenhavoc/cmd_and_ctrl#5434 ·
Los mantenedores suelen responder en 1 día
-
go good first issue help wanted up-for-grabs
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
andrewsiah/agentswarm-data-tasks#117 ·
Los mantenedores suelen responder en 1 día
-
openshell image: provide /sandbox so the workspace path can be uniform across OpenShell driversAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
C:dataplane
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
yanet-platform/yanet2#3395 ·
Los mantenedores suelen responder en 1 día