Dashboard › opencode-lore › Gateway request-stream sequencing, erro…
01a0a149-e56b-7083-bad3-3c39f4bccb88| Project | Hits | Last recalled |
|---|---|---|
| opencode | 1 | 8d ago |
Never await a queued request or producer before consuming a predecessor body when admission may depend on body consumption; retain pending promises, release predecessor streams, and use explicit gates. On malformed or stalled request/upstream bodies, return only sanitized errors and never await EOF indefinitely. Bound diagnostic reads and drains by timeout, abort, or connection close, then cancel/destroy readers and decoders without awaiting a hostile generator's return(). Decoder backpressure waits must settle on drain, error, close, or abort and remove all listeners. For invalid streamed JSON, use closingErrorResponse() with Connection: close so the 400 is delivered before Node cancels the upload. Test non-settling chunked uploads, malformed gzip under backpressure, prompt rejection, socket closure, and unlocked readers.