GeezerVison is showing github.com — mcpx: Phase 1 of #1834 — typed sampling errors (-1 on rejection, -32602 tool-shape, expiry stays -32603) · Issue #1835 · developing-today/code
mcpx: Phase 1 of #1834 — typed sampling errors (-1 on rejection, -32602 tool-shape, expiry stays -32603) #1835DescriptionPhase 1 of #1834 — typed sampling errors
Design: #1834 (mcpx sampling trust boundary). Design doc: files/designs/code-mcpx-sampling-trust-boundary.md in the keep-the-four-repos-healthy goal workspace. Origin: dezren39/darwin-nix#256.
Problem
Every sampling failure reaches the upstream as -32603. The 2025-11-25 sampling error table assigns -1 to user rejection and -32602 to tool-shape violations (tool result missing in a request; tool results mixed with other content), but mcpx produces neither: a declined sampling answer becomes errors.New("the sampling request was " + action) in sampleViaBroker (pkgs/mcpx/internal/daemon/hooks.go), an expired/cancelled wait becomes the raw broker Await error, and Client.answer's handler wrap (pkgs/mcpx/internal/mcpclient/modern.go ~L296-303) flattens every handler error to &rpcError{Code: -32603}. Gap: sampling-client-errors-user-rejected-and-tool-shape in pkgs/mcpx/internal/conformance/coverage_clientfeatures.go.
Scope
- A typed sampling-rejection error in the daemon sampling path, carrying its JSON-RPC code.
- Answerer decline or cancel of a sampling question surfaces to the upstream as
-1 with the action named in the message.
- Expiry / no answerer stays
-32603, with a message explicitly naming expiry — nobody chose, so it is not a rejection. Do not map it to -1.
Client.answer's handler-error wrap preserves a typed error's code instead of flattening it to -32603 (typed errors pass through; untyped handler errors keep today's -32603).
- Define the
-32602 tool-shape error type here so Phase 2 (mcpx: design — sampling trust boundary (reviewable, validated, honestly error-coded) #1834's validation phase) raises it; Phase 1 does not itself add content checks.
Out of scope: any message/result validation (Phase 2), CLI rendering (Phase 3), elicitation error paths (untouched), sampling rate limits (nix#257).
Tests (defining)
- Declined sampling answer → upstream sees
-1 naming the decline.
- Cancelled sampling answer → upstream sees
-1.
- Expired wait (broker TTL) → upstream sees
-32603 with expiry named in the message.
- Untyped handler failure → still
-32603.
- Elicitation decline/cancel behaviour unchanged (existing tests pass).
Acceptance criteria
- Declined/cancelled sampling reaches the upstream as
-1; expired waits as -32603 naming expiry; the typed-error passthrough in Client.answer is covered by tests in both the legacy wire path and the modern input_required path (the answer path is shared — verify both).
- Gap
sampling-client-errors-user-rejected-and-tool-shape is retired for its -1 half; the -32602 half is exercised end-to-end by Phase 2.
- No elicitation error behaviour changes.
Activityadded kind/bugSomething isn't working (prefixed form of the classic bug label) task/triageQueue packet kind: verify, reproduce, and route this item app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo) effort/mMedium: expected under 1 day of work on Oct 28, 2026developing-today commented on Oct 28, 2026 dezren39 commented on Oct 28, 2026
Phase 1 of design #1834, filed by the design architect (2026-10-28). Triage packet enqueued to repo-health-code-pilot as task 2718 (verified: queue=repo-health-code-pilot, status=queued, last_error=null). dezren39 commented on Oct 29, 2026
🤖 Agent note · parked (Lane C shift, gate recheck 23:01Z)
- Task: 3050 (mcpx Phase 1 typed sampling errors). PR mcpx: typed sampling errors — -1 on rejection, expiry stays -32603 (#1835) #2440 OPEN, MERGEABLE/CLEAN, head 8e5c00d, no failing/pending checks; prior verification: all basic checks PASS, Codex completed with no findings.
- Gate unchanged: main still 5a34fa7; ci: merge queue ejects every PR — no merge since #2233 (10:57Z), entries dropped 2-6 min into AWAITING_CHECKS #2403 still OPEN (merge-queue freeze; admin config decision pending). Ejection of this PR was already verified earlier today.
- Action: re-parked 1h without an enqueue cycle. Resume when ci: merge queue ejects every PR — no merge since #2233 (10:57Z), entries dropped 2-6 min into AWAITING_CHECKS #2403 fix lands: re-enqueue mcpx: typed sampling errors — -1 on rejection, expiry stays -32603 (#1835) #2440, merge, complete fixed_merged.
dezren39 commented on Oct 29, 2026
Lane D (queue task 3050) gate recheck: PR #2440 still OPEN/CLEAN/MERGEABLE at 8e5c00d, no failing or pending checks; #2403 still OPEN; main still 5a34fa7. Gate unmet — re-parked without another enqueue cycle (four enqueue attempts by this shift on sibling PRs were all ejected within minutes; evidence on #2403). Resume verbatim: main advances past 5a34fa7 or #2403 closes → disposition any Codex findings on #2440 → re-enqueue → merge → complete fixed_merged + close this issue. dezren39 commented on Oct 30, 2026 🤖 Agent note · done
- Agent: queue worker (repo-worker-code), lane C shift
- Session / ID: queue task 3050, shift 2026-10-29 19:14 CDT
- Found via: queue claim (resume of merge_ready park)
- Task: Merge PR mcpx: typed sampling errors — -1 on rejection, expiry stays -32603 (#1835) #2440 (typed sampling errors, Phase 1 of mcpx: design — sampling trust boundary (reviewable, validated, honestly error-coded) #1834) once the merge queue recovered
- Result: PR mcpx: typed sampling errors — -1 on rejection, expiry stays -32603 (#1835) #2440 MERGED at 2026-10-30T00:34:46Z, merge commit 1ddc772. Codex gate checked fresh this shift: the Codex review summary on head 8e5c00d reports no findings and none unresolved, and the PR has zero review threads; basic checks (proxy port fallbacks, spec parity, test) all pass. This issue auto-closed on merge; its in-flight queue/work/status labels were stripped (the
task/triage label was also removed — this was an implementation fix, not a triage item).
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|