Skip to content

fix(cli): call a taskSupport: required tool via the task path - #2699

Merged
cliffhall merged 1 commit into
v2/mainfrom
v2/fix/2649-cli-task-required-tool
Oct 12, 2026
Merged

cliffhall merged 1 commit into
v2/mainfrom
v2/fix/2649-cli-task-required-tool

Conversation

@cliffhall

Copy link
Copy Markdown
Member

Closes #2649

Problem

Against a legacy server, a tool declaring execution.taskSupport: "required" could not be called from the one-shot CLI: runMethod only took the callToolStream path when task was requested, the CLI has no --task flag, and callTool() refuses such a tool (Tool "simple_task" requires task support…), exiting 1.

Fix

core/cli/handlers/run-method.ts now uses the task path when the tool requires it, as well as when task is requested. This is the issue's "automatic" option. The CLI prints the task's result, and mcpdo, which shares runMethod, no longer needs --task for these tools. No new flag is added.

Tests

  • clients/cli/__tests__/tools.test.ts: drives the real CLI (--transport http) against an in-process legacy task server serving simple_task, and asserts a zero exit and a result payload. Verified it fails with the core change reverted.
  • npm run local:gate green.

🤖 Generated with Claude Code

A legacy tool declaring execution.taskSupport: "required" refuses a plain
callTool(), and the one-shot CLI has no --task flag, so it could never call
one. runMethod now uses callToolStream for such a tool whether or not task
was requested; mcpdo shares runMethod and no longer needs --task for it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: cliffhall <[email protected]>
@cliffhall cliffhall added the v2 Issues and PRs for v2 label Oct 12, 2026
@cliffhall cliffhall linked an issue Oct 12, 2026 that may be closed by this pull request
@cliffhall
cliffhall requested a balanced review from Copilot October 12, 2026 19:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused fix satisfies the linked issue and includes appropriate end-to-end regression coverage.

0 open findings

What changed in this PR

Automatically routes task-required tools through callToolStream, fixing one-shot CLI and mcpdo calls against legacy servers.

Changes:

  • Detects execution.taskSupport: "required" in shared CLI handling.
  • Documents automatic task-path behavior.
  • Adds an in-process HTTP regression test.
File Description
core/​cli/​handlers/​run-method.ts Automatically selects the task call path.
core/​cli/​handlers/​method-types.ts Documents task-routing semantics.
clients/​cli/​__tests__/​tools.test.ts Tests a task-required legacy tool call.

🧠 Review effort: Balanced


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@cliffhall

Copy link
Copy Markdown
Member Author

Copilot review loop closed: round 1 was clean (0 inline comments, 0 findings, nothing suppressed), so no further round was requested.

@cliffhall
cliffhall merged commit 622a073 into v2/main Oct 12, 2026
8 checks passed
@cliffhall
cliffhall deleted the v2/fix/2649-cli-task-required-tool branch October 12, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Issues and PRs for v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

One-shot CLI cannot call a legacy tool with taskSupport: "required"

2 participants