Title: mcpx: protocol follow-ups -- inline answers from scripts, cancellation, task status, call-scoped timeout · Issue #1864 · developing-today/code · GitHub
Open Graph Title: mcpx: protocol follow-ups -- inline answers from scripts, cancellation, task status, call-scoped timeout · Issue #1864 · developing-today/code
X Title: mcpx: protocol follow-ups -- inline answers from scripts, cancellation, task status, call-scoped timeout · Issue #1864 · developing-today/code
Description: Relocated from dezren39/darwin-nix#77 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue references inside it are historical (dezren39/nix...
Open Graph Description: Relocated from dezren39/darwin-nix#77 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue reference...
X Description: Relocated from dezren39/darwin-nix#77 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue refer...
Opengraph URL: https://github.com/developing-today/code/issues/1864
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"mcpx: protocol follow-ups -- inline answers from scripts, cancellation, task status, call-scoped timeout","articleBody":"Relocated from dezren39/nix#77 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue references inside it are historical (dezren39/nix numbering).\n\nParent: #181\n\n## Summary\n\nFour protocol gaps left after #61, each named in `docs/protocol.md` §6 and none tracked\nelsewhere. Re-verified at `05c78b2`: **all four are still true**, and §6 still lists them, which\nis the right place for them to live — a gap written down in the document that describes the\nsurface is worth more than a gap in an issue. What this issue adds is the ordering and the one\nreal design decision among them.\n\n## Original notes\n\nNot from the user's notes. Filed from the protocol work in #61:\n\n> Follow-ups from the protocol work (#61), each named in `docs/protocol.md` §6 but not tracked.\n>\n> - **Questions raised inside `mcpx_exec` cannot be answered inline.** Correlation identifies a *call*, and a script makes many upstream calls, so questions from a script go to the broker rather than back to the MCP client as `input_required`. A script-level correlation (the run id) would fix it.\n> - **Inbound `notifications/cancelled` does not interrupt the upstream call.** A client cancelling a long `tools/call` stops waiting; the upstream server keeps working.\n> - **`notifications/tasks/status` from upstream is dropped.** mcpx neither forwards nor records it.\n> - **`pool.callTimeout` is not call-scoped.** The most obviously wanted per-call setting: `--pool-call-timeout` on one command should bound that command's call, but a daemon started with a different value ignores it. Needs threading through `internal/pool` (#56 left it, reasonably).\n\n## Current state (at `05c78b2`)\n\n`docs/protocol.md` §6 \"What is still missing\" (`:368-382`) lists all four, plus two the notes did\nnot mention: url-mode elicitation raised by mcpx itself, and OAuth for remote servers (\"declared\nand not performed\"). The last one is a #177 instance — a declared capability that is not\ndelivered — and should be cross-linked there rather than quietly carried here.\n\n| Gap | Verified at `05c78b2` |\n| --- | --- |\n| Inbound cancellation does not interrupt the upstream call | `notifications/cancelled` is *sent* by mcpx as a client (`internal/mcpclient/client.go:715`) and accepted by the test servers, but nothing routes an inbound one to an in-flight upstream call. `internal/mcpclient/http.go:112` documents the decision: protocol-level cancellation was removed because `pool.callTimeout` was the bound that mattered. §6 states what is needed: \"the request id plumbed through the pool\". |\n| `notifications/tasks/status` is dropped | The string appears nowhere in `internal/`. §6: \"mcpx polls instead.\" |\n| A question from `mcpx_exec` cannot be answered inline | §3.4's correlation identifies a call; §6 restates the consequence. Unchanged. |\n| `pool.callTimeout` is not call-scoped | `internal/settings/registry.go:57` (`Default: \"120s\"`), read at `internal/config/poolsettings.go:43-44` into the pool's configuration. There is no per-call override path. |\n\n## Approaches\n\nThree of the four have no real choice; one does.\n\n**`pool.callTimeout` per call — no real choice, and it is the one to do first.** Thread an\noptional per-call deadline from the request through `internal/pool` and let the pool's configured\nvalue be the default. The *only* decision worth making is whether a caller may raise it or only\nlower it, and that decision is **not this issue's**: it is #185 (`ClampedBy` — a daemon sets a\nceiling, a caller may lower but not raise). Take #185's answer. A daemon operator who sets 120s to\nprotect the machine should not be overridden by a script asking for an hour; a script that wants\n30s should get 30s. Note the interaction the code already documents: `internal/mcpclient/http.go`\nremoved protocol-level cancellation *because* `pool.callTimeout` was the bound. Making the timeout\ncall-scoped therefore makes the cancellation gap below more visible, not less.\n\n**`notifications/tasks/status` — no real choice.** Record it and expose it. mcpx already polls;\nthe notification is strictly better information arriving earlier. It lands in the event store\n(#6), which is where anything with a `seq` belongs, and #6's gap semantics apply — a saturated\nconsumer must see a gap marker rather than silently miss a status change. Do it with or after #6.\n\n**Inbound cancellation — no real choice about *whether*, a real one about *scope*.** A client that\ncancels and an upstream server that keeps working is a resource leak with a user watching it. The\nplumbing is what §6 says: carry the inbound request id into the pool so the in-flight call can be\nfound and cancelled. The decision is whether cancellation is best-effort (send\n`notifications/cancelled` upstream, stop waiting, let the server finish in its own time — which is\nall the MCP spec promises) or enforced (also tear down the pooled instance when the scope makes\nthat safe). Best-effort is correct by the spec and cheap; enforced is what a user means by\n\"cancel\" when a runaway tool is eating the machine. Recommend best-effort by default with the\nteardown available where the scope is caller-private — which is the same isolation question #190\nand #191 are about.\n\n**The exec correlation gap — the one genuine design decision.**\n\n**A — least recommended: give a script's questions a synthetic call id and answer them as if they\nwere a call.** Cheapest, and it looks right in a demo. It breaks as soon as a script makes two\nconcurrent upstream calls that both ask: the client is answering a question it cannot attribute,\nand a wrong answer to an elicitation is worse than no answer. It also silently changes what §3.4's\ncorrelation means, which is a documented wire contract.\n\n**B — keep questions from scripts on the broker, and make the broker reachable from the client.**\nStatus quo plus a way for an MCP client to poll and answer broker questions in-band. No contract\nchanges, works today via `/v1/elicit` and `mcpx_ask_*`. The cost is that a modern client which\nimplements `input_required` correctly still gets a worse experience from `mcpx_exec` than from\n`mcpx_call`, for no reason the client can see.\n\n**C — recommended: add a second correlation level — the run — and declare it in §3.4.** A script's\nquestions correlate to the *run id*, which the exec surface already has and already exposes\n(`execsvc.Result.runId`). A question raised inside a run is answerable inline by whoever invoked\nthe run, because there is exactly one of those, and the run id disambiguates concurrent upstream\ncalls without pretending they are one call. This is what the original note proposes and it is\nright. It costs a documented change to §3.4's correlation rules and a revision-gated behaviour\n(only clients that understand the run-level correlation get inline answers; the rest fall back to\nB's broker), which is the pattern `internal/mcpserver/revisions.go` already implements for\n`FeatInputRequired`.\n\nRecommended because it is the only option that makes `mcpx_exec` a first-class citizen of the\nquestion protocol rather than a permanent exception, and because the fallback to B is free.\n\n## Open questions\n\n- Does the run-level correlation need to nest — a script that runs a recipe that runs a script?\n §3.4's rules should state the nesting or forbid it explicitly.\n- Cancellation and tasks overlap: cancelling a call that was promoted to a task\n (`/v1/tasks/{id}/cancel`) already exists. Is inbound `notifications/cancelled` on a task-backed\n call the same path? If so, the plumbing is smaller than §6 suggests.\n- `docs/protocol.md` §6 also lists **\"OAuth for remote servers. Declared and not performed\"**.\n That is a declared-but-undelivered capability and belongs in #177's inventory. It is out of\n scope here; it should not stay only in a §6 bullet.\n- Is `pool.callTimeout`'s interaction with `mcpx exec`'s own timeout defined anywhere? Two\n timeouts with no stated precedence is how the next \"flag accepted and ignored\" (#74) happens.\n\n## Ease · Impact · Related\n\n**Ease** M overall — S for `tasks/status`, M for the call-scoped timeout, M for cancellation\nplumbing, M–L for the run-level correlation and its revision gate.\n**Impact** med-high — the call-scoped timeout is the most obviously wanted per-call setting in the\nproduct, and a cancel that does not cancel is the kind of thing a user tells other people about.\n\n**Related:** #181 (parent), #185 (`ClampedBy` — decides whether a caller may raise the call\ntimeout), #6 (event store — where `tasks/status` records belong, and whose gap semantics apply),\n#112 (exec lifecycle hooks — shares the exec `Frame` ordering contract; #111 owns the rule for\nadding a frame kind, collision 7), #177 (OAuth \"declared and not performed\" belongs in its\ninventory), #78 (daemon state and caches), #56 (the settings pass that deliberately left the\nper-call path alone), #61 (closed — the work these follow).\n\n**In flight:** the PROTOCOL architect is working on these as this is written\n(`internal/mcpclient/**`, `internal/mcpserver/**`, `internal/pool/**`, `docs/protocol.md`).\nRe-check state before starting; parts of this may already be merged.\n\nSecurity/auth deferred; see tracker.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-28T22:07:32Z","url":"https://github.com/developing-today/code/issues/1864"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5fd2c8c8-0cc3-ed3e-7ddf-7629d478f42e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D1E4:3F83D3:310613:404D28:6B0616CC |
| html-safe-nonce | eb4ef9719a933df7692adf3c6de90c28f1383d03ee138a35ec08d30af594f265 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMUU0OjNGODNEMzozMTA2MTM6NDA0RDI4OjZCMDYxNkNDIiwidmlzaXRvcl9pZCI6IjYzMTk4MTcxNjk3OTQ2MzU0NjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f706674c9cc61eed1522a2c876ffc90a66c5e0db1b795067dd21af6344283991 |
| hovercard-subject-tag | issue:6088375746 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/1864/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2407025ea51907d523b4ab698735f3088113441153406ed8776ebdb59e03b97b/developing-today/code/issues/1864 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2407025ea51907d523b4ab698735f3088113441153406ed8776ebdb59e03b97b/developing-today/code/issues/1864 |
| og:image:alt | Relocated from dezren39/darwin-nix#77 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue reference... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 97d4714e567728e1f85f88b0cf68c89f0f8a3dc41e8869af7aeb8195ad990374 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 866f202ebf7ac5aff8f633417d9fd8a53818a977 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width