Skip to content

mcpx: Phase 1 of #1753 — server-side sampling relay gating (tools/includeContext checked against the host's declaration) #1755

Closed

Description

@dezren39

Phase 1 of #1753 — server-side sampling relay gating

Design: #1753 (mcpx sub-capability gating). Design doc: files/designs/code-mcpx-subcapability-gating.md in the keep-the-four-repos-healthy goal workspace. Origin: dezren39/nix#210.

Problem (verified on main f6760a69)

Peer.CanSample (pkgs/mcpx/internal/mcpserver/conn.go ~L251-252) is Declared("sampling") and nothing more. Question.Sendable (~L448-458) therefore offers any sampling question to any host that declared the parent capability, and Question.paramsFor (~L466+) shapes elicitation params per era but passes sampling params verbatim — tools and includeContext reach a host that never declared sampling.tools or sampling.context. Conformance gaps (both internal/conformance/coverage_clientfeatures.go, tagged #210): sampling-server-no-tools-without-capability, sampling-server-includecontext-only-with-context-capability.

Scope (decision recorded on #1753)

In pkgs/mcpx/internal/mcpserver:

  • Peer gains sub-capability reads: whether the peer's sampling declaration carries tools / context keys. Malformed declaration values behave as undeclared (the tolerance CanElicit's url branch already uses).
  • Question.Sendable for sampling/createMessage returns false for a tools-carrying question (tools or toolChoice present) when the peer declared no sampling.tools. The question then follows the existing unsendable path (sendableTo / broker fallback) — it is not offered to this host, and it is NOT degraded by stripping: a stripped toolChoice: "required" request is a different request.
  • Question.paramsFor drops includeContext from a relayed sampling question when the peer declared no sampling.context (context inclusion is expressly ignorable; dropping preserves the plain completion). When the peer did declare context, the field passes unchanged in this phase.
  • CanSample keeps its parent meaning (other callers, e.g. AnswersInline, ask "can this peer sample at all"); shape logic lives in Sendable/paramsFor, where the question's shape is known.

Out of scope

Acceptance criteria

  • Host declaring bare sampling receives a plain sampling question unchanged; a tools-carrying question is not offered to it; includeContext is absent from what it receives.
  • Host declaring sampling.tools + sampling.context receives the question verbatim.
  • Malformed sampling declaration behaves as undeclared in tests.
  • Conformance gaps sampling-server-no-tools-without-capability and sampling-server-includecontext-only-with-context-capability retired from coverage_clientfeatures.go with passing conformance rows.
  • CI green (GitHub Actions; per fleet rule, no builds on the sandbox).

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued task in the Supabase agent queue
    app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)
    effort/mMedium: expected under 1 day of work
    on Oct 28, 2026
  2. developing-today commented on Oct 28, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Oct 28, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

  4. dezren39 commented on Oct 28, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up — triage of Phase 1 sampling relay gating

  5. removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Oct 28, 2026
  6. 99 remaining items

  7. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    on Oct 29, 2026
  8. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · parked

  9. added
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Oct 29, 2026
  10. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  11. added a commit that references this issue on Oct 29, 2026
  12. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)effort/mMedium: expected under 1 day of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/design-architectFiled by the repo design architect jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions