diff --git a/pkgs/mcpx/docs/compare/register/elicitation.md b/pkgs/mcpx/docs/compare/register/elicitation.md index 30f85c9d37..3ec100d894 100644 --- a/pkgs/mcpx/docs/compare/register/elicitation.md +++ b/pkgs/mcpx/docs/compare/register/elicitation.md @@ -42,7 +42,7 @@ Status column: **mcpx @ 05c78b2**. Legend and citation conventions: [../README.m | ELI-18 | Naming the originating server in a relayed question | `mcpx missing` | spec: client MUST show who asks; mcpx: legacy path only | partial — legacy prefixed "(via mcpx)"; 2026 path raw (#201) | + med | S | med | | ELI-19 | Question from a shared upstream instance | `impl deferred` | mcpx only | partial — goes to the broker, never inline | + low | L | low | | ELI-20 | Questions raised inside `mcpx_exec` | `impl deferred` `opencode v2 has` `mcpx missing` | mcpx only | partial — always the broker, never the host (#77) | + low | L | low | -| ELI-21 | Answering an elicitation from inside a script | `opencode v2 has` `mcpx missing` | opencode v2 UI form; mcpx designed, not built | ✗ — no `onElicit`; broker and policy only (#214) | + med | M | low | +| ELI-21 | Answering an elicitation from inside a script | `opencode v2 has` `mcpx missing` | opencode v2 UI form; mcpx designed, not built | decided — broker-only by design (#1935): no `onElicit`; every answer flows through the broker | + med | M | low | | ELI-22 | Client with no elicitation answerer | `opencode v1 has` `lootbox has` | opencode v1 and lootbox: `-32601`; mcpx: `cancel` | ✓ — declares, answers `cancel` when nobody is asked | + low | S | low | | ELI-23 | Elicitation attributed to a session or a whole location | `opencode v2 has` | opencode v2: Location-global forms | n/a — mcpx is the server here | + low | S | low | @@ -435,7 +435,7 @@ Status column: **mcpx @ 05c78b2**. Legend and citation conventions: [../README.m for a human. - **Effort.** M — a long-poll or SSE from the generated client to `/v1/elicit?run=`, plus handler registration. - **Risk.** low: without it scripts depend on policy answers or a human at the CLI or TUI. -- **Detail.** The doc is ahead of the code, so the gap is a doc/code disagreement as well as a missing feature. +- **Detail.** The doc was ahead of the code, so the gap was a doc/code disagreement as well as a missing feature. Closed 2026-11-03 (#1935) as a deliberate design decision: broker-only. `Route` sends url-mode, credential-field, and confirmation questions to a human on purpose, and an inline script handler would bypass or duplicate that gate; question-to-call correlation for a multi-call script is also unsolved (ELI-20). Scripts answer through the broker instead (exit 75 + `mcpx elicit answer`, `/v1/elicit`, `mcpx_elicit_*`, the ops surface). `docs/elicitation.md` §5.2 carries the full decision and its revisit conditions. - **Sources.** `docs/elicitation.md:318-324` "onElicit(async (q) => {"; `internal/daemon/server.go:422-424`; `v2:packages/core/src/mcp/client.ts:143`. diff --git a/pkgs/mcpx/docs/elicitation.md b/pkgs/mcpx/docs/elicitation.md index 1505bb566b..41da46c9a0 100644 --- a/pkgs/mcpx/docs/elicitation.md +++ b/pkgs/mcpx/docs/elicitation.md @@ -4,7 +4,7 @@ id: elicitation-a-design since: pre-release created: 2026-09-28T18:00:00-05:00 -last-updated: 2026-09-28T18:00:00-05:00 +last-updated: 2026-11-03T12:00:00-06:00 status: partial tags: area:protocol, area:integration description: how a server asks a question, and how the answer gets back @@ -32,7 +32,7 @@ worth knowing before you read on: | `mcpx_elicit_pending` | the tool is `mcpx_elicit_list` | | `plumbing.elicitTTL`, `elicit.mode`, `elicit.rules` | none exist. The TTL is `elicit.ttl` in `defaults.json` and is not a setting; the shipped policy is `elicit.Route` (`internal/elicit/elicit.go:491`), which is not rule-based | | `MCPX_PLUGIN_ELICIT` | does not exist | -| `onElicit()` / `ask()` script globals, the TUI view, the `mcpx-elicitation` skill | none built | +| `onElicit()` / `ask()` script globals, the TUI view, the `mcpx-elicitation` skill | not built; `onElicit`/`ask` decided against (2026-11-03, #1935 / ELI-21): broker-only is the deliberate design, see §5.2. The TUI view and the skill remain unbuilt proposals | | a `202` with `Location` and `Retry-After`, an `Elicitation` OpenAPI component | not built. The retry shape that shipped is MCP-side `input_required` | --- @@ -393,22 +393,58 @@ const issue = await tools.github.create_issue({ title: "x" }); ``` By default the runtime answers from policy or cancels, and the call returns -whatever the server does with that. To participate -- **not built**: no +whatever the server does with that. + +**Decision (2026-11-03, #1935, register row ELI-21): broker-only is the +deliberate design. `onElicit` and `ask` will not be built** -- no `onElicit` and no `ask` are emitted into the script's globals -(`internal/codegen/emit.go`): +(`internal/codegen/emit.go`), and that absence is now a decision, not a +gap. The proposal that was considered, kept as the record: ```ts onElicit(async (q) => { - // NOT BUILT + // NOT BUILT -- decided against; see below if (q.mode === "url") return { action: "decline" }; if (q.schema.properties.repo) return { action: "accept", content: { repo: "me/thing" } }; return { action: "cancel" }; }); ``` -And for a script run on a terminal, `ask(q)` would prompt. The handler is -registered rather than passed per call, because the question arrives from -inside a call the script did not know would ask. +(For a script run on a terminal, `ask(q)` would have prompted. The handler +was to be registered rather than passed per call, because the question +arrives from inside a call the script did not know would ask.) + +Why the broker stays the only answer path: + +- **Consent and credentials are routed to a human on purpose.** + `elicit.Route` (`internal/elicit/elicit.go`) sends url-mode questions, + credential-shaped fields, and bare confirmations to a human -- "a + confirmation is consent, which is not the agent's to give". An inline + script handler answers from inside the call, ahead of that routing; + giving scripts first claim on a question would either bypass the human + gate or force every generated client to re-implement `Route`. Neither + is acceptable, so the routing lives in exactly one place: the broker. +- **A script cannot reliably know which call asked.** The correlation + the protocol has identifies a *call*, and a script is many calls, + possibly concurrent over one shared upstream instance; questions that + cannot be attributed are already marked `ambiguous` on the CLI path + (§5.1). A registered global handler would answer questions it cannot + attribute -- the failure mode the broker's claim-once, TTL-bound + answer path exists to prevent. +- **Scripts are not locked out; they answer through the broker like + every other surface.** A script run stops with exit `75` and the + `mcpx elicit answer` command (§5.1); anything that can speak HTTP or + MCP can list, inspect, and answer pending questions via + `GET /v1/elicit`, `POST /v1/elicit/{id}/{action}`, and the + `mcpx_elicit_*` tools, and the ops surface exposes the same as + `ops.elicitList()` / `ops.elicitAnswer()` (`docs/parity.md`). Whoever + sends the answer, it still passes `Route`, the TTL, and the + claim-once update. + +Revisit only if both change: run-scoped question correlation lands (a +question provably belongs to one script run and one call), and the hook +is restricted to questions `Route` already sends to the agent -- never +url mode, never credential fields, never confirmations. ### 5.3 REST and OpenAPI