Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Client] Support cancellation and per-call deadlines in Client::callTool()

Aperta
#517 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
php
Ambito
api, backend

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

enhancement

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/cancelled over STDIO and legacy HTTP. For HTTP protocol 2026-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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di modelcontextprotocol/php-sdk

Tutte le issue di modelcontextprotocol/php-sdk

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.