Skip to content

mcpx: correlate -32042 retries with the suspended call via requestState (#2897) - #8999

Merged
dezren39 merged 1 commit into
mainfrom
queue/8931-2897-32042-retry-state
Nov 13, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/8931-2897-32042-retry-state

Conversation

@dezren39

@dezren39 dezren39 commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

What

Correlates -32042 (UrlElicitationRequired) retries with the suspended call so a host retry cannot start a second upstream operation (#2897):

  • mcpserver: both -32042 triggers (entry trigger and the in-loop ErrNoPush trigger) now mint a signed requestState — bound to the call id and to the request binding (method + parameter digest), expiring — and urlRequiredResponse carries it in the error data next to elicitations. If no state can be minted, no -32042 is answered at all rather than inviting an uncorrelated retry. The broker still keeps the pending questions; no Abandon is introduced (mcpx: Phase 3 of #2077 — produce -32042 where it is true, register truth-up (ELI-04/09/12), and #1935 closure #2080 behaviour preserved).
  • mcpclient: mcpx's own client reads the requestState out of a -32042 error's data and echoes it on its out-of-band retry (withRequestState), so the retry resumes the original call via the existing beginAsk/verifyRound path.
  • A retry that echoes no requestState remains indistinguishable from a new call and starts one — that is the documented contract: the host must echo the token, exactly as the MRTR flow already requires.

Provenance

The core of this change was found as uncommitted changes parked in the laptop primary clone (a prior session for this issue had recorded "no code changed"); it was salvaged verbatim into this branch, completed (in-loop trigger test coverage), and verified here.

Tests

  • TestURLRequiredWhenNoChannelToAskOn — entry-trigger -32042 carries requestState; a pre-completion retry with the token stays -32042 on the original call; a post-completion retry resumes it; the upstream operation begins exactly once.
  • TestURLRequiredWhenPushFailsInLoop — extended: the in-loop -32042 also carries requestState and a correlated retry after out-of-band completion begins the operation exactly once.
  • Client-side -32042 retry test in url_elicitation_32042_test.go (mcpclient).
  • Laptop (this branch, commit 6b36ff5): go build ./... OK; go test ./internal/mcpserver/ -count=1 ok (17.6s); go test ./internal/mcpclient/ -count=1 ok (13.4s); go test ./internal/daemon/ -run '32042|URLElicitation' -count=1 ok (3.3s). CI to follow on this PR.

Closes #2897


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…te (#2897)

Both -32042 triggers (entry and in-loop ErrNoPush) mint a signed requestState bound to the call and the request binding and carry it in the error data; no state mintable means no -32042 rather than an uncorrelated retry invitation. The broker keeps the pending questions (no Abandon, #2080 preserved). mcpx client echoes the token on its out-of-band retry in params._meta under dev.mcpx/requestState -- 2025-11-25 defines no requestState parameter and strict frame validation rejects one -- and mcpserver resumeOf accepts that vehicle alongside the top-level field. Exactly-once proven by tests: post-completion and pre-completion retries resume the original call (began == 1) on both server triggers, and the client retry carries the token.

Core salvaged verbatim from uncommitted changes found parked in the laptop primary clone; completed and verified by lane any-a, task 8931.
@dezren39
dezren39 requested a review from a team as a code owner November 12, 2026 19:29
@coderabbitai

coderabbitai Bot commented Nov 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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 39 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2b2eb6f1-ce57-43d0-9a38-926add07511c
Commits

Reviewing files that changed from the base of the PR and between a5318f8 and 6b36ff5.

Files selected for processing: 5

  • pkgs/mcpx/internal/mcpclient/client.go
  • pkgs/mcpx/internal/mcpclient/url_elicitation_32042_test.go
  • pkgs/mcpx/internal/mcpserver/ask.go
  • pkgs/mcpx/internal/mcpserver/url_required.go
  • pkgs/mcpx/internal/mcpserver/url_required_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T19:31:49.610873Z 6b36ff5 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39

Copy link
Copy Markdown
Member Author

Conductor duplicate-pair salvage comparison against PR #8995 (full diffs compared, not just file lists):

#8995 is being closed as the duplicate now that this note is posted. No merge requested.

@dezren39
dezren39 merged commit 55e9701 into main Nov 13, 2026
29 of 38 checks passed
@dezren39
dezren39 deleted the queue/8931-2897-32042-retry-state branch November 13, 2026 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mcpx: correlate -32042 retries with the suspended call (no double execution)

1 participant