Repository navigation
docs(mcpx): disposition the revision-conflicts register, sections A-E (#1974) - #8652
Conversation
…1974) Sweep of the 54 Undisposed items in docs/spec/revision-conflicts.md (task 14963), section A (lifecycle/versioning): all 10 items verified against current code and re-dispositioned with site evidence — C2 recorded reading (client request IDs are a monotonic atomic counter, never reused), C6 recorded reading (finishLegacy aborts with UnsupportedVersionError: the schema MUST in effect), C7 peer-settled (advertised-capability gate #2436), C9 recorded reading (fixed named _meta keys taken at face value), C16 peer-settled (peerFor builds caps per request on the modern path), C18 peer-settled (cancelled(): modern HTTP cancels by stream close), C10 recorded reading (emissions audit: no server -32000..-32019), C12 peer-settled (withMeta always sends required _meta; server missingMeta rejects), C14 recorded reading (probe judge(): any non-modern 4xx is legacy), C22 recorded reading (resultType lenient fall-through in mcpspec validation). No code changes: every behaviour was already implemented; the register now records it. Sections B-E and headline items remain (44 Undisposed mentions incl. legend).
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 51 minutes. View limit details
Pre-merge checks:
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9c30fa4cde
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| **C22. `resultType` unknown-value rule vs open type, 2026-07-28.** | ||
| - **Disposition:** Undisposed — open question: how does mcpx's client treat an unrecognised `resultType`, and an absent one on a response to a request that carried `protocolVersion: 2026-07-28`? No site verified in Phase 1. | ||
| - **Disposition:** Recorded reading — verified 2026-11-11 (#1974 sweep): mcpx follows the schema's open type over the basic page's MUST. In response validation (internal/mcpspec/message.go), `resultType` is a discriminator only for the two shapes mcpx must tell apart — `input_required` validates as InputRequiredResult and `task` is an extension error; any other value, recognised or not, and an absent `resultType` alike fall through to validation against the method's own result definition (an absent field therefore behaves as `complete`). An unrecognised `resultType` whose payload matches the method's result is accepted, contrary to the basic page's "MUST be considered invalid"; the lenient reading is recorded here rather than silently chosen. |
There was a problem hiding this comment.
Record the client's actual rejection of unknown result types
For a modern response with an otherwise valid payload and an unknown resultType such as "partial", the client rejects the response rather than accepting it. Although internal/mcpspec/message.go falls through to method-specific schema validation, Client.callReissue in internal/mcpclient/client.go:1159–1180 subsequently returns InvalidResultError for unknown values; TestResultType in internal/mcpclient/conformance_client_test.go:247–253 explicitly covers this behavior. The disposition therefore records the opposite of the implemented client behavior and incorrectly resolves C22 in favor of the lenient reading. Describe the end-to-end client behavior instead of treating the schema validator as the final acceptance decision.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in df13292 — verified independently before editing: Client.callReissue (internal/mcpclient/client.go, resultType switch) returns InvalidResultError for any unrecognised resultType on the modern path, and TestResultType's resulttype-unknown-invalid subtest (internal/mcpclient/conformance_client_test.go) expects "partial" to be rejected.
The C22 disposition now records both layers: the mcpspec schema validator is lenient (fall-through to method-schema validation), but it is not the final acceptance decision — end-to-end the client follows the basic page's MUST, and the conflict resolves in favour of the basic page at the client layer. An absent resultType still behaves as complete at both layers.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 03a08d835f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| **C10. -32000..-32019: "legacy" (prose) vs "implementation-defined" (schema), 2026-07-28.** | ||
| - **Disposition:** Undisposed — open question: does mcpx emit any code in `-32000..-32019` of its own on a 2026-07-28 request (prose: SHOULD NOT; schema/changelog: grandfathered)? No emissions audit done in Phase 1. | ||
| - **Disposition:** Recorded reading — audited 2026-11-11 (#1974 sweep): mcpx's server emits no code in `-32000..-32019` on any era. The server's `-320xx` emissions are `-32002` (legacy resource-not-found, era-keyed — item C11), `-32020`/`-32021`/`-32022` (2026 spec-defined), and `-32042` (2025-11-25 era; see section E spec-internal item 2 for its server-side gap). The only `-32000` in the codebase is client-local and synthesized — `codeStreamLost` and the receive loop's "connection closed" (internal/mcpclient) — errors mcpx's client reports to its own host about a dead transport, never an answer sent to a peer, so the prose SHOULD NOT is satisfied where it binds and no grandfathering is needed. |
There was a problem hiding this comment.
Account for relayed errors in the reserved-code audit
For pass-through tool calls, client-local -32000 errors can be sent to a downstream peer, contrary to this disposition. internal/daemon/callerr.go's upstreamFault recognizes the client's synthesized rpcError by its package and fields, internal/cli/serve.go's relayedFault converts it into mcpserver.UpstreamError, and internal/mcpserver/ask.go relays that error without filtering -32000. Thus a closed upstream connection can produce this code even for a modern downstream request. Qualify the audit to distinguish directly generated server errors from relayed errors rather than concluding that these codes are never answers sent to peers.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Verified and fixed — thank you. You are right: upstreamFault (internal/daemon/callerr.go) passes any mcpclient rpcError code through, including the synthesized codeStreamLost -32000, and via relayedFault → UpstreamError the ask path relays it to the downstream peer unfiltered. The section A item C10 disposition now splits the audit exactly that way: directly generated server errors never use -32000..-32019; relayed errors pass the upstream's (or the client's synthesized) code through by design. Fixed in ce83436.
|
|
||
| C17. **`WWW-Authenticate` on 401.** | ||
| - **Disposition:** Undisposed — open question: does mcpx's server emit `WWW-Authenticate` on 401, publish Protected Resource Metadata at the well-known URI, or both? Not audited in Phase 1. | ||
| - **Disposition:** Recorded reading — verified 2026-11-11 (#1974 sweep, section B): the header only. When a bearer token is configured, the daemon's `requireBearer` middleware (internal/daemon/bearer.go) — which guards every /v1 and /mcp route — answers an unauthenticated request 401 with `WWW-Authenticate: Bearer`. mcpx publishes no Protected Resource Metadata: no well-known route for it exists on the daemon or the MCP server. That satisfies the 2025-06-18 MUST and the header branch of the 2025-11-25+ "one of the following" rule. |
There was a problem hiding this comment.
Distinguish a bare Bearer challenge from metadata discovery
When bearer authentication is configured, internal/daemon/bearer.go:68 emits only WWW-Authenticate: Bearer, without a resource metadata URL. That does not implement the discovery-header branch: the full requirement recorded under authz-401-www-authenticate in internal/conformance/requirements.json requires the header to indicate the resource server metadata URL, and the same register classifies authorization discovery as not implemented by choice. Since there is also no metadata endpoint, record this as a static-token challenge with OAuth discovery unimplemented, rather than claiming that it satisfies either era's discovery requirement.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Verified and fixed — thank you. A bare WWW-Authenticate: Bearer meets the 2025-06-18 MUST but implements neither 2025-11-25+ discovery branch (the header branch needs the resource_metadata URL; there is no well-known document either). Section B item C17 now records it as a static-token challenge with OAuth discovery unimplemented, matching authz-401-www-authenticate in the conformance registry. Fixed in ce83436.
…ender non-object structuredContent for object-only hosts; refuse non-augmented legacy calls to required tools with -32601
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e8739ac846
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if s.legacyTaskSupport(ctx, req.Params) == supportRequired { | ||
| return &response{JSONRPC: "2.0", ID: req.ID, Error: &rpcError{Code: codeMethodNotFound, | ||
| Message: "this tool requires task-augmented execution (execution.taskSupport is required)"}} |
There was a problem hiding this comment.
Restrict required-task refusal to revisions that define tasks
For clients using 2024-11-05, 2025-03-26, or 2025-06-18, this now rejects previously working calls to raw or pass-through tools declaring taskSupport: "required". !peer.Modern includes all those revisions, and dispatch invokes maybeTask without a task-feature gate. Meanwhile, downgradeItems removes execution from their tool listings, so those clients cannot discover the requirement and their protocol does not define task augmentation. The upstream client already handles required-task execution transparently in internal/mcpclient/tasks.go. Gate this new refusal on Defines(peer.Version, FeatTasks) so the 2025-11-25 requirement does not break older clients.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Verified and fixed — thank you, this was a real bug in the headline-13 implementation from this PR. The refusal in maybeTask now binds only a peer whose revision defines core tasks: AtLeast(peer.Version, "2025-11-25"). Earlier legacy peers (whose listings have execution stripped by downgradeItems) run their plain calls as before. Tests: the refusal test now initializes a real 2025-11-25 session, and new TestPreTaskEraCallToRequiredToolStillRuns covers 2025-06-18; both pass, as does the full internal/mcpserver package. The register texts (headline 13, section C item C10) are updated to match. Fixed in ce83436.
|
|
||
| **C13 — tool name guidance vs aggregator reality.** | ||
| - **Disposition:** Undisposed — open question: when mcpx prefixes upstream tool names for disambiguation, what happens to names that would exceed 128 chars or leave the charset? No site verified in Phase 1. | ||
| - **Disposition:** Moot — verified 2026-11-11 (#1974 sweep, section D): mcpx never prefixes. Pass-through tool names are served verbatim from the merged surface (`lookupPass`, internal/mcpserver/passthrough.go), and the collision the 2026 note's prefixing strategy exists to solve is handled the other way: two upstreams offering the same name are refused with an error naming both, and the operator chooses — drop one from `mcp.passthrough`, or reach it through `mcpx_call` under its namespace (where the name travels as an argument, not as a listed tool name). No listed name is ever lengthened by mcpx, so the 128-char/charset squeeze the prefixing strategy creates does not arise; an upstream name that itself violates the guidance arrives and leaves unchanged. |
There was a problem hiding this comment.
Account for prefixed raw names before closing the naming audit
For requests to /mcp?codemode=false, mcpx does prefix listed tool names: lookupRaw in internal/mcpserver/codemode.go:117–125 constructs nt.Namespace + "_" + nt.Tool.Name, and rawSurface returns those names to tools/list. TestCodemodeFalseListsRawToolsInsteadOfTheGatewaySurface explicitly expects db_greet,db_query,up_greet. Consequently, an upstream name already at 128 characters becomes longer when exposed through this supported surface, contradicting both “never prefixes” and “No listed name is ever lengthened.” Restrict the no-prefix conclusion to pass-through mode and account for raw-surface naming before marking the length/charset question moot.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Verified and fixed — thank you. I missed the raw surface: lookupRaw (internal/mcpserver/codemode.go) does prefix as <namespace>_<name> for /mcp?codemode=false, with projected-name collisions refused, and nothing truncates or re-checks the projected name against 128 chars. Section D item C13 now records the two surfaces separately — pass-through verbatim + refusal; raw prefixed, with the unhandled length squeeze named. Fixed in ce83436.
|
|
||
| C3. **Relatedness of messages on a POST's SSE stream: SHOULD → MUST.** | ||
| - **Disposition:** Undisposed — open question: does mcpx's server scope every notification on a POST's SSE stream to the originating request on a 2026-07-28 connection (MUST), and only by default on legacy (SHOULD)? No site verified in Phase 1. | ||
| - **Disposition:** Recorded reading — verified 2026-11-11 (#1974 sweep, section B): yes, by construction in both eras. Request handling is bound to that POST's own exchange sender (`withSender(ctx, ex.send)` in serveModern/serveLegacy, internal/mcpserver/server.go), so a notification emitted while handling a request can only go on that request's stream; there is no code path that writes an unrelated notification to a POST exchange. Session-level notifications take the other home: `streamPush` (internal/mcpserver/transport.go) writes only to the session's GET stream and drops the message when none is open — mcpx keeps no redelivery buffer and never reroutes one onto a POST stream. On modern connections the unrelated-message home is `subscriptions/listen`, as the 2026 text prescribes. |
There was a problem hiding this comment.
Include cross-request log delivery in the relatedness audit
When two modern HTTP tool calls share an upstream instance and both request logs, a log belonging to one call can reach the other call's POST stream. Although the upstream HTTP transport retains the originating context, Client.dispatch discards it for notifications, and relayNotification in internal/mcpclient/relay.go:234–241 sends each log to every active relay whose level matches. Those callbacks flow through the daemon and CLI to each request's CallRelay.Notify, which writes to its own POST sender in internal/mcpserver/relay.go:78–81. Binding each sender to a request therefore does not establish that its notifications belong to that request. Record this implementation gap instead of concluding that no unrelated notification can enter a POST exchange.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Verified and recorded — thank you. relayNotification fans notifications/message out to every active relay on the shared upstream client whose level matches, so with two concurrent calls on one upstream instance, one call's log can reach the other's POST stream via its CallRelay. Section B item C3 no longer claims relatedness by construction for relayed logs: mcpx's own notifications are exchange-bound, and the cross-call relay fan-out is recorded as a gap needing per-call relay scoping in the client (not implemented here — this PR is the register sweep; the gap is now on the record in C3, headline 9, and section C item C8). Recorded in ce83436.
…rrect five register dispositions on review (#1974)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ce83436ea0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - **Disposition:** Peer-settled — verified 2026-11-11 (#1974 sweep, section E): yes, and deliberately not era-scoped. internal/mcpclient/ratelimit.go enforces per-server and per-session per-minute limits on sampling and elicitation at the entry of `Client.answer` — the one function both eras converge on (wire request or MRTR input request) — so an over-limit question reaches no handler on either path; refusal is a -32603 naming the setting that set the limit, never a fabricated answer. 2026 dropping the SHOULD changes nothing: the limit is mcpx's own cost/attention control (#2192, design #2333), not an era behaviour. | ||
| 16. **New 2026-only sampling MUSTs**: "Sampling messages **MUST** contain a `role` ... and a `content` field", "The client | ||
| - **Disposition:** Undisposed — open question: does mcpx's client enforce the 2026 sampling MUSTs (`role` and `content` present, `maxTokens` respected, no retention between requests) on MRTR-carried sampling? Not audited in Phase 1. | ||
| - **Disposition:** Peer-settled — verified 2026-11-11 (#1974 sweep, section E): yes. Presence: the relay validator (internal/elicit/sampling.go) decodes every message and fails a missing `content` ("content is missing") or an undecodable role/content shape as -32602 before the question reaches a handler, on MRTR-carried requests exactly as on wire ones (both converge on `Client.answer`). `maxTokens`: the local sampler treats the request's `maxTokens` as a bound, capped by the model budget (internal/daemon/sampling_local.go), and a relayed answer is the answering client's own result. Retention: mcpx keeps no sampling state between requests — each answer is produced per call and nothing is carried into the next request. |
There was a problem hiding this comment.
Account for persisted sampling data in the retention audit
On the default broker-backed sampling path, the full sampling params are persisted as Request.Schema (internal/daemon/hooks.go:342–353), and requests and answers remain in SQLite after Await returns. pruneTerminal explicitly documents that sampling rows share its age/count retention policy (internal/elicit/elicit.go:221–232), rather than being deleted after each request. Thus “mcpx keeps no sampling state between requests” incorrectly closes the retention question; distinguish no conversational reuse from no retention and account for the implemented persistence.
Useful? React with 👍 / 👎.
|
|
||
| **C2. Request-ID uniqueness scope.** | ||
| - **Disposition:** Undisposed — open question: does mcpx's client reuse request IDs after completion on a 2026-07-28 connection, and can a stale `subscriptions/listen` notification then collide with a new listen reusing the ID? No site verified in Phase 1; check request-ID allocation in internal/mcpclient. | ||
| - **Disposition:** Recorded reading — verified 2026-11-11 (#1974 sweep): mcpx's client never reuses request IDs. Every allocation is `nextID.Add(1)` on a monotonic `atomic.Int64` (internal/mcpclient/client.go:79, :1328; listen.go:145; probe.go:74), so the stricter legacy rule (never reuse within a session) holds on every era and the 2026 relaxation is simply not exercised; a stale listen notification cannot collide with a later listen, whose ID is always fresh. |
There was a problem hiding this comment.
Account for resumed sessions in the request-ID audit
When a daemon hands off or cold-restores an existing upstream session, request IDs are reused: Client.session() in internal/mcpclient/handoff.go does not preserve nextID, and Resume() constructs a new client with a zero counter. The production cold-resume path explicitly reinstalls the same HTTP session ID and then calls Ping (internal/pool/upstream_sessions.go:462–466), restarting allocation at ID 1 within that legacy session. Monotonicity therefore holds only for one Client instance, not for the session-wide invariant this disposition declares satisfied. Qualify the conclusion and record the resume-path gap rather than closing the audit as universally compliant.
Useful? React with 👍 / 👎.
| in substance, differing in which date is "deprecated". | ||
| 9. **Elicitation sensitive information.** 2025-06-18: "Servers **MUST NOT** use elicitation to request sensitive | ||
| - **Disposition:** Undisposed — open question: does mcpx gate elicitation modes per era — form mode barred from sensitive information from 2025-11-25, URL mode required for it, the 2025-06-18 all-modes ban before that? The elicitation path (internal/mcpserver/ask.go) was not audited for this in Phase 1. | ||
| - **Disposition:** Recorded reading — verified 2026-11-11 (#1974 sweep, section E): the ban binds the server that *originates* an elicitation, and in this path that server is the upstream, not mcpx: mcpx relays questions and originates none, so there is no era-scoped sensitive-mode gate in the relay to find. What mcpx does control, it controls era-independently: mode gating is by declared capability (`Question.Sendable`/`Peer.CanElicit(mode)`, internal/mcpserver/conn.go; an undeclared mode is answered -32602 by the client, internal/mcpclient/modern.go), and credential-shaped form fields are routed to a human, never the agent, and masked in the answer review (`Route`/`IsSensitiveField`, internal/elicit/elicit.go) in every era. |
There was a problem hiding this comment.
Distinguish broker audience labels from inline question routing
When a credential-shaped form question belongs to an active call whose downstream client supports form elicitation, the inline relay does not enforce the broker's human-only audience. elicitViaBroker attaches the question unconditionally (internal/daemon/hooks.go:268), attach constructs a Question without carrying its audience (internal/daemon/routes_proto.go:315–324), and Question.Sendable checks only elicitation capability and schema compatibility (internal/mcpserver/conn.go:584–594). Consequently, an agent-backed MCP client can receive the question inline even though Route labeled its broker row ToHuman. Qualify “routed to a human, never the agent” as broker routing only and record the inline-path gap instead of asserting an end-to-end guarantee.
Useful? React with 👍 / 👎.
state: in-progress
task: 14963
updated: 2026-11-11
What this PR does
Dispositions the undisposed items of the mcpx revision-conflicts register (
pkgs/mcpx/docs/spec/revision-conflicts.md, from #2209 Phase 1) — sections A–E plus the headline index — for #1974. Section A landed first (lane code-c); this update completes B–E and headlines 7, 9, 13.Every disposition names its site evidence (file + what the code does). Two items were real conflicts and are implemented here, with tests:
downgrade()now renders a non-objectstructuredContentintocontentfor 2025-06-18..2025-11-25 (object-only) hosts instead of passing a value their schema forbids; decided by the suite's own conformance rows. New testTestNonObjectStructuredContentIsRenderedForObjectOnlyHosts.taskSupport: "required"tool is now refused with-32601(the tool-level MUST beats the error list's -32600). New testTestLegacyNonAugmentedCallToRequiredToolIsRefused.Also dispositioned on this PR: the Codex P2 finding on section A item C22 (register had the unknown-
resultTypebehaviour backwards; the client returnsInvalidResultErroron the modern path) — corrected with site evidence.Excluded, deliberately left Undisposed: headline 5 (serve-seam
isErrorera-split) and its section D counterpart — both gated on the #1481 decision, named on both items.Verification
go test ./internal/mcpserver/passes (incl. both new tests); codemode task tests pass.go test ./internal/tasks/: 2 failures verified pre-existing on clean main (0566f38), unrelated to this diff — filed as mcpx internal/tasks: two reopen/retention tests fail on clean main (TestRetentionAcrossReopenRunsFromCompletion, TestTaskTouchMetadataPersistsAcrossReopen) #8685.