[Client] Support cancellation and per-call deadlines in Client::callTool()
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- PHP
- Stelle
- 1.6k
- Fork
- 173
- Merge medio
- 19h 19m
- PR unite (30g)
- 8
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di modelcontextprotocol/php-sdk
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
modelcontextprotocol/php-sdk#516 ·
I maintainer di solito rispondono entro 1 giorno
-
[Server] Handler type uses bare Closure, hard to decorate RegistryInterface under strict PHPStanApertaServer
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
modelcontextprotocol/php-sdk#468 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
needs confirmation needs maintainer action Server
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
modelcontextprotocol/php-sdk#398 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
modelcontextprotocol/php-sdk#370 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
modelcontextprotocol/php-sdk#513 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di modelcontextprotocol/php-sdk
Issue simili
-
sync-en
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
bug Feature: Kiosk
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Infrastructure: actions Module: zmscitizenapi Module: zmsentities php Type: Bug unit tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
it-at-m/eappointment#3480 ·
I maintainer di solito rispondono entro 1 giorno
-
HttpClient
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
CI: composer install fails — league/flysystem 1.x blocked by security advisory GHSA-cxf4-7mrp-vvprApertadevops type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno