Repository navigation
fix(cli): call a taskSupport: required tool via the task path - #2699
Merged
Merged
Conversation
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]>
There was a problem hiding this comment.
🟢 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.
Member
Author
|
Copilot review loop closed: round 1 was clean (0 inline comments, 0 findings, nothing suppressed), so no further round was requested. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2649
Problem
Against a legacy server, a tool declaring
execution.taskSupport: "required"could not be called from the one-shot CLI:runMethodonly took thecallToolStreampath whentaskwas requested, the CLI has no--taskflag, andcallTool()refuses such a tool (Tool "simple_task" requires task support…), exiting 1.Fix
core/cli/handlers/run-method.tsnow uses the task path when the tool requires it, as well as whentaskis requested. This is the issue's "automatic" option. The CLI prints the task's result, and mcpdo, which sharesrunMethod, no longer needs--taskfor 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 servingsimple_task, and asserts a zero exit and a result payload. Verified it fails with the core change reverted.npm run local:gategreen.🤖 Generated with Claude Code