mcpcompat: reconcile removals in per-session resource/template/prompt sync
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
mcpcompat/server/session.go の syncSessionTools から始め、その削除の再調整処理を syncSessionResources、syncSessionResourceTemplates、syncSessionPrompts と比較します。SetSessionResources、SetSessionResourceTemplates、SetSessionPrompts の REPLACE-style のパスを追跡し、省略されたエントリが削除され、list_changed が発行されることを確認します。下流のガードケースは stacklok/toolhive#5969 の serve_session_test.go にあります。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Go
- スター
- 2
- フォーク
- 6
- 平均マージ
- 23時間 44分
- マージ済み PR(30日)
- 133
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
stacklok/toolhive-core のほかの issue
-
needs-triage
難易度 4/5 3〜5日 初心者へのやさしさ 54/100
stacklok/toolhive-core#466 ·
メンテナーはふだん 1 日以内に返信
-
needs-triage
難易度 3/5 1〜2日 初心者へのやさしさ 66/100
stacklok/toolhive-core#426 ·
メンテナーはふだん 1 日以内に返信
-
mcpcompat/server: refuse dispatch of a request whose per-request context is gone対応中かも @jhrozek が 15 日前に担当しました。 オープンneeds-triage
難易度 4/5 3〜5日 初心者へのやさしさ 54/100
stacklok/toolhive-core#414 ·
メンテナーはふだん 1 日以内に返信
-
needs-triage
難易度 5/5 1週間以上 初心者へのやさしさ 8/100
stacklok/toolhive-core#343 ·
メンテナーはふだん 1 日以内に返信
-
needs-triage
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
stacklok/toolhive-core#342 ·
メンテナーはふだん 1 日以内に返信
stacklok/toolhive-core の issue をすべて見る
似ている issue
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
fabriziosalmi/secure-proxy-manager#619 ·
メンテナーはふだん 1 日以内に返信
-
bug needs-triage P1 tier:1-mechanical
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
krakenhavoc/cmd_and_ctrl#5434 ·
メンテナーはふだん 1 日以内に返信
-
go good first issue help wanted up-for-grabs
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
andrewsiah/agentswarm-data-tasks#117 ·
メンテナーはふだん 1 日以内に返信
-
openshell image: provide /sandbox so the workspace path can be uniform across OpenShell driversオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
C:dataplane
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
yanet-platform/yanet2#3395 ·
メンテナーはふだん 1 日以内に返信