GeezerVison is showing github.com — mcpx: Phase 2 of #1554 — client task execution for taskSupport "required" tools (internal/mcpclient) · Issue #1556 · developing-today/code
mcpx: Phase 2 of #1554 — client task execution for taskSupport "required" tools (internal/mcpclient) #1556DescriptionPhase 2 of design #1554 (filed by the design architect, 2026-10-27). Design doc: files/designs/code-mcpx-tasks-one-store.md in the keep-the-four-repos-healthy goal workspace.
Decision in force (from #1554, do not re-litigate in triage): mcpclient executes a call as an upstream task when — and only when — the tool's declared execution.taskSupport is "required". "optional" stays a plain call; "forbidden" is untouched. An upstream task that parks in input_required returns a distinct named error in this phase; relaying questions downstream is an open question on #1554, not part of this phase. Origin: dezren39/darwin-nix#209 row TOOL-21 (client half) and CAP-26 (client direction — the extension is never declared upstream).
Scope
- Today:
internal/mcpclient/client.go:171-174 carries Tool.Execution raw for forwarding but nothing reads taskSupport; CallTool (client.go:1164) is a plain tools/call; the pool's call site is internal/pool/pool.go:1051; the client declares no tasks extension to upstreams. Client.Era already distinguishes legacy from modern (2026-07-28) upstreams.
- In
CallTool's path (or the narrowest seam above it that the pool and other callers share): when the named tool's listed execution.taskSupport is "required", run the call as an upstream task instead of a plain call:
- Legacy upstream: send
params.task with the call; on the {task} result, poll tasks/get at the task's poll interval until terminal; fetch the outcome via tasks/result (the underlying request's result, related-task meta included).
- Modern upstream: the client's initialize declares
extensions["io.modelcontextprotocol/tasks"]; on a flat Task result (resultType: "task"), poll tasks/get — the DetailedTask inlines the terminal result or error; there is no tasks/result in the extension.
- Honour the task's TTL as the outer bound; on context cancellation or deadline, send
tasks/cancel (best effort) and return the context error. A failed task returns its fault in the client's existing error shapes, so callers (pool, code mode) see a call failure, not a new protocol type.
- An upstream task that enters
input_required ends the call with a distinct, named error stating the upstream task asked a question this phase does not relay.
- A non-conforming task response (missing
{task}, wrong shape, unknown status) is a call error — never a hang and never an unbounded poll.
- Tools whose
taskSupport is absent, "optional", or "forbidden" follow today's plain-call path byte-for-byte.
Acceptance
- Defining tests against fake upstreams (the client's existing fake-server test rig):
- legacy upstream,
required tool: the call is sent with params.task, the result returned to the caller is the tasks/result payload, and exactly the expected get/result request sequence occurs;
- modern upstream,
required tool: initialize declared the tasks extension, the flat task is polled via tasks/get, and the inlined terminal result is returned;
optional tool on either era: plain call, no task methods issued;
- cancellation: cancelling the call context issues
tasks/cancel upstream and returns promptly;
- failed upstream task: the fault surfaces as the call's error;
input_required upstream task: the distinct named error is returned;
- malformed task response: call error, no hang (test completes under its deadline).
- No changes to the server side (
internal/mcpserver) or to pooled-call behaviour for non-required tools; the pool call site needs no signature change, or any change is justified on this issue.
- Verification via CI per fleet policy:
cd pkgs/mcpx && go test ./... on the PR.
Out of scope: Phase 1's store unification (independent — this phase does not depend on it); downstream relay of upstream inputRequests (open question on #1554); register truth-up and nix#209 closure (Phase 3, gated on Phases 1–2).
Acceptance criteria
-
CallTool on a taskSupport: "required" tool completes through the upstream's task machinery in both eras, returning the task's result as the call result.
- Modern initialize declares
extensions["io.modelcontextprotocol/tasks"]; legacy path uses params.task + tasks/result.
- Cancel, failure,
input_required, and malformed-response behaviours match the scope above and are covered by the defining tests in CI.
- Non-
required tools are byte-for-byte today's plain call; full mcpx suite green via CI.
Activitydeveloping-today commented on Oct 28, 2026 dezren39 commented on Oct 28, 2026 🤖 Agent note · filed
- Agent: design architect (repo-design-architect-code job)
- Session / ID: repo-design-architect-code cron run, 2026-10-27 20:25 CDT
- Found via: filed this run
- Task: Phase 2 implementation issue for design design(mcpx): tasks, finished — one task store for MCP and /v1, and a client that can call task-required tools #1554 (mcpx tasks — client task execution for taskSupport "required" tools, internal/mcpclient). Linked as a sub-issue of design(mcpx): tasks, finished — one task store for MCP and /v1, and a client that can call task-required tools #1554. Enqueued as a triage packet in repo-health-code-pilot this run (queue task 1613) — first fleet step is triage/confirmation of scope and the CallTool seam, then implementation. Independent of Phase 1.
- Expectation: effort/l; done = acceptance criteria in the body, defining tests = fake legacy + modern upstreams (required completes via task, optional stays plain, cancel propagates, input_required named error), in pkgs/mcpx/internal/mcpclient.
- Links: design design(mcpx): tasks, finished — one task store for MCP and /v1, and a client that can call task-required tools #1554; design doc
files/designs/code-mcpx-tasks-one-store.md (goal workspace); queue task 1613 (repo-health-code-pilot); origin mcpx: tasks — the 2026 extension is advertised and not implemented; core tasks are unbound and live in two stores dezren39/darwin-nix#209
dezren39 commented on Oct 31, 2026 dezren39 commented on Oct 31, 2026 dezren39 commented on Oct 31, 2026
Agent note — done: PR #2934 merged
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|