[Client] Support cancellation and per-call deadlines in Client::callTool()
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start at Client::callTool() and trace the STDIO, legacy HTTP, and HTTP 2026-07-28 transport paths it uses. Check how interruption is handled around synchronous I/O and suspended requests. Done means per-call cancellation and deadlines work across the described transports, interrupted results and pending state are cleared, the connection remains usable, and notification failures do not replace the original interruption.
索引モデルが issue の本文から書いたものです。
説明
Client::callTool() does not accept a cancellation signal or a per-call timeout. Applications cannot abandon an individual tool call when a user cancels it without closing the connection or waiting for the configured request timeout.
Expected behavior
- Accept an optional cancellation token and per-call timeout.
- Check interruption before sending, after synchronous I/O returns, and after a suspended request resumes.
- Discard interrupted results, clear pending state, and keep the connection usable.
- Send
notifications/cancelledover STDIO and legacy HTTP. For HTTP protocol2026-07-28, use response-stream closure. - Log cancellation-notification failures without replacing the original interruption.
Async behavior and limitations
The client API remains synchronous. Cancellation is cooperative; this proposal does not add an async API, event loop, or framework-specific HTTP client.
- STDIO: cancellation and deadlines are checked while polling for responses. An interrupted request sends
notifications/cancelled. - HTTP: checks run when control returns from blocking PSR-18 requests or PSR-7 body reads. Cancellation cannot interrupt a wait for headers or the next body chunk.
- Legacy HTTP: a best-effort cancellation POST can itself block. Delivery failures are logged without replacing the original interruption.
- HTTP
2026-07-28: cancellation uses response-stream closure rather than a separate notification.
Per-call deadlines are not hard HTTP wall-clock limits. Applications still need network timeouts on their HTTP client. An async-capable underlying client does not change this when accessed through its synchronous PSR-18 interface.
Cancellation discards the result locally, but does not guarantee that server-side work stops or rolls back.
- 主要言語
- PHP
- スター
- 1.6k
- フォーク
- 173
- 平均マージ
- 19時間 19分
- マージ済み PR(30日)
- 8
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
modelcontextprotocol/php-sdk のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
modelcontextprotocol/php-sdk#516 ·
メンテナーはふだん 1 日以内に返信
-
[Server] Handler type uses bare Closure, hard to decorate RegistryInterface under strict PHPStanオープンServer
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
modelcontextprotocol/php-sdk#468 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
needs confirmation needs maintainer action Server
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
modelcontextprotocol/php-sdk#398 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
modelcontextprotocol/php-sdk#370 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
modelcontextprotocol/php-sdk#513 ·
メンテナーはふだん 1 日以内に返信
modelcontextprotocol/php-sdk の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
Awaiting Triage
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
WordPress/two-factor#1008 ·
メンテナーはふだん 1 日以内に返信
-
sync-en
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信