Repository navigation
[Schema] Keep Tool execution and the tasks server capability - #541
Merged
Merged
Conversation
chr-hertel
requested review from
CodeWithKyrian,
Nyholm and
soyuka
as code owners
October 7, 2026 07:47
chr-hertel
force-pushed
the
claude/tasks-schema-fields
branch
from
October 7, 2026 20:02
4c11fd4 to
104b6d7
Compare
Member
Author
|
This isn't caused by this PR. It's an intermittent server-side race, now root-caused and fixed in #545:
#545 has a deterministic test for it. This PR only touches Generated by Claude Code |
Both are part of the 2025-11-25 tasks feature. Tool::fromArray() and ServerCapabilities::fromArray() dropped them, so a client could not tell a tool that must be called as a task from one that must not, and the fields vanished when a result was encoded again. Found by running the client against the TypeScript SDK's reference server, which sets taskSupport on every tool; the interop suite listed both as known losses, which this removes.
chr-hertel
force-pushed
the
claude/tasks-schema-fields
branch
from
October 7, 2026 20:16
104b6d7 to
409d80c
Compare
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.
Two fields from the 2025-11-25 tasks feature were dropped when parsing:
Tool.execution.taskSupport("forbidden"|"optional"|"required"). A client could not tell a tool that must be called as a task from one that must not.ServerCapabilities.tasks({list, cancel, requests: {tools: {call}}}).Found by the round-trip check in #540. It runs our client against the TypeScript SDK's reference server, which sets
taskSupporton every tool and advertisestasks.Changes
Tool: newMcp\Schema\ToolExecutionholding a?TaskSupport $taskSupport(new enumMcp\Schema\Enum\TaskSupport). It's read byTool::fromArray(), written byjsonSerialize(), and taken as a new optional last constructor argument?ToolExecution $execution = null. An emptyToolExecutionencodes as{}. An unknowntaskSupportvalue is rejected.ServerCapabilities: new optional last constructor argument?array $tasks = null, kept as the spec's nested object. Every node is encoded as a JSON object, since PHP would otherwise turn the empty ones ({"list": {}}) into[].withExtensions()keeps it.interop / clientrun is the end-to-end proof: the round-trip check against the reference server now passes with no losses listed. Onmainwithout this PR, it would fail.Both additions are optional trailing parameters, so existing calls are unaffected. The server side doesn't set either field yet; this only stops the client from losing them.
Rebased onto
mainafter #540.🤖 Generated with Claude Code
https://claude.ai/code/session_014RjzbQfz2DVm9xHmGsqM7d