[v2] Expose per-request stream end (onRequestStreamEnd) in RequestOptions for custom long-lived requests
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
Direzione di ricerca
Start by reading RequestOptions in packages/core-internal/src/shared/protocol.ts and the transport.send(...) call in _requestWithSchemaViaCodec; compare how Client.listen() forwards onRequestStreamEnd. Check the existing tests for protocol requests and stream transports, then add coverage showing a request can detect its response stream ending before a JSON-RPC response. Done means the callback or chosen rejection behavior is exposed through request options and tested, while transports without per-request streams continue to work.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
Protocol.request() gives callers no way to learn that the per-request response stream ended. The client transport already supports this: TransportSendOptions.onRequestStreamEnd, which StreamableHTTPClientTransport fires when a request's SSE response ends. But only Client.listen() uses it (it calls transport.send() directly). RequestOptions has no equivalent, and _requestWithSchemaViaCodec passes requestSignal to transport.send() but not onRequestStreamEnd.
Why it matters
Extensions that define long-lived streaming requests can't detect a dead stream promptly. One example is events/stream from the Events extension (SEP-3415, see #2945). If the server restarts mid-stream, the POST's SSE body ends without a JSON-RPC response. The pending request then waits for its timeout, or for an application-level heartbeat watchdog. In @mastra/mcp we detect this through a 30s heartbeat window, so it takes up to 60s. subscriptions/listen gets immediate detection because it uses the transport option directly.
This is the request-level counterpart of #2739, which covers non-streaming requests left pending when their SSE response ends.
Proposal
Add an option to RequestOptions, for example onRequestStreamEnd?: () => void, and forward it to transport.send() the same way requestSignal is forwarded. Alternatively, reject the pending request with a distinct error when its stream ends before a response arrives. Transports with no per-request stream (stdio, InMemory) would keep ignoring it, as they do today.
Versions
We hit this on @modelcontextprotocol/[email protected]. It's still present on main (c05225a6): see RequestOptions in packages/core-internal/src/shared/protocol.ts and the transport.send(...) call in _requestWithSchemaViaCodec.
- Lingua principale
- TypeScript
- Stelle
- 13.8k
- Fork
- 2.5k
- Merge medio
- 6g 23h
- PR unite (30g)
- 2
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/typescript-sdk
-
v2
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
modelcontextprotocol/typescript-sdk#3270 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
`callTool` with `allowInputRequired: true` throws on an `input_required` result when the tool declares an `outputSchema`Forse già presa @mgoldsborough l’ha presa 6 giorni fa. Apertav2
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
modelcontextprotocol/typescript-sdk#3249 ·
I maintainer di solito rispondono entro 1 giorno
-
v2
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
modelcontextprotocol/typescript-sdk#3243 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
TypeScript client accepts an unknown `resultType` in the first `server/discover` replyForse già presa @Tidehyc l’ha presa 7 giorni fa. Apertav2
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
modelcontextprotocol/typescript-sdk#3235 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
UriTemplate.match() throws a TypeError on an empty expression it acceptsForse già presa @yunusemrejs l’ha presa 12 giorni fa. Apertav1 v2
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
modelcontextprotocol/typescript-sdk#3221 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di modelcontextprotocol/typescript-sdk
Issue simili
-
clawsweeper:intake:bug clawsweeper:intake:needs-environment
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
openclaw/openclaw#212827 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
KT-2245 e2e specs that call the backend directly fall back to the developer's own Kronn on :3140Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Use one constant for the 10,000-character input limitForse già presa @NginxL l’ha presa oggi. Apertagood first issue refactor
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
aniru-dh21/snap-validate#51 ·
I maintainer di solito rispondono entro 1 giorno
-
dependencies effort: small good first issue priority: low
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
TMHSDigital/screencast-mcp#509 ·
I maintainer di solito rispondono entro 1 giorno
-
from-review tech-debt testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
blamechris/chroxy#9520 ·
I maintainer di solito rispondono entro 1 giorno