[Client] Support cancellation and per-call deadlines in Client::callTool()
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 45/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- PHP
- Estrelas
- 1.6k
- Forks
- 173
- Merge médio
- 19h 19min
- PRs com merge (30d)
- 8
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de modelcontextprotocol/php-sdk
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
modelcontextprotocol/php-sdk#516 ·
Mantenedores costumam responder em até 1 dia
-
[Server] Handler type uses bare Closure, hard to decorate RegistryInterface under strict PHPStanAbertaServer
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 78/100
modelcontextprotocol/php-sdk#468 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
needs confirmation needs maintainer action Server
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
modelcontextprotocol/php-sdk#398 · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
modelcontextprotocol/php-sdk#370 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
modelcontextprotocol/php-sdk#522 · 1 reação ·
Mantenedores costumam responder em até 1 dia
Todas as issues de modelcontextprotocol/php-sdk
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 2 dias
-
UX
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
ProfessionalWiki/NeoWiki#1573 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
endoflife-date/endoflife.date#11194 ·
Mantenedores costumam responder em até 1 dia