Skip to content

[Schema] Keep Tool execution and the tasks server capability - #541

Merged
chr-hertel merged 1 commit into
mainfrom
claude/tasks-schema-fields
Oct 7, 2026
Merged

chr-hertel merged 1 commit into
mainfrom
claude/tasks-schema-fields

Conversation

@chr-hertel

@chr-hertel chr-hertel commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

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 taskSupport on every tool and advertises tasks.

Changes

  • Tool: new Mcp\Schema\ToolExecution holding a ?TaskSupport $taskSupport (new enum Mcp\Schema\Enum\TaskSupport). It's read by Tool::fromArray(), written by jsonSerialize(), and taken as a new optional last constructor argument ?ToolExecution $execution = null. An empty ToolExecution encodes as {}. An unknown taskSupport value 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 suite: removes both entries from the interop suite's known losses. Its interop / client run is the end-to-end proof: the round-trip check against the reference server now passes with no losses listed. On main without this PR, it would fail.
  • Tests: unit tests for parsing, round-trip and encoding of both.
  • CHANGELOG: new entry.

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 main after #540.

🤖 Generated with Claude Code

https://claude.ai/code/session_014RjzbQfz2DVm9xHmGsqM7d

Copy link
Copy Markdown
Member Author

integration (8.3) failed on 104b6d7: HttpClientCommunicationTest timed out after 30s.

This isn't caused by this PR. It's an intermittent server-side race, now root-caused and fixed in #545:

  • While the server waits for the client's sampling answer, the process holding the SSE stream saves the whole session on every 100 ms poll.
  • The answer arrives as a separate POST in another php -S worker.
  • A poll that straddles that store writes the old session back, and the answer is lost.

#545 has a deterministic test for it. This PR only touches Tool/ServerCapabilities parsing, not the server's session handling. I'm re-running the failed job once.


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
chr-hertel force-pushed the claude/tasks-schema-fields branch from 104b6d7 to 409d80c Compare October 7, 2026 20:16
@chr-hertel chr-hertel added the improves spec compliance Improves consistency with other SDKs such as TyepScript label Oct 7, 2026
@chr-hertel
chr-hertel merged commit 4c650d0 into main Oct 7, 2026
55 of 56 checks passed
@chr-hertel
chr-hertel deleted the claude/tasks-schema-fields branch October 7, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Client Issues & PRs related to the Client component improves spec compliance Improves consistency with other SDKs such as TyepScript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant