Skip to content

fix: apply TypeScript SDK timeouts to response bodies - #18356

Open
Hanabi9248 wants to merge 3 commits into
PaddlePaddle:mainfrom
Hanabi9248:codex/typescript-response-body-timeout
Open

Hanabi9248 wants to merge 3 commits into
PaddlePaddle:mainfrom
Hanabi9248:codex/typescript-response-body-timeout

Conversation

@Hanabi9248

Copy link
Copy Markdown

The TypeScript SDK clears its request timer and removes the caller abort listener as soon as fetch receives response headers. Reading the body happens afterwards, so a slow body can outlive requestTimeout, and cancellation after headers is ignored.

Keep JSON, JSONL, resource, and HTTP error body reads inside the request deadline, with cleanup after consumption. Preserve the existing API error types and caller-provided abort reason.

Five regression cases use a local HTTP server that sends headers immediately and delays the body. They cover successful and error status responses, JSONL, binary resources, and caller cancellation. All five fail before the fix.

Validation on Windows with Node 24.19.0: npm run prepublishOnly in api_sdk/typescript passes (TypeScript check, ESM/CJS/declaration builds, and all 46 SDK tests). Hosted OCR inference and other language SDK suites were not run. Please squash on merge.

Signed-off-by: Hanabi <317387557+Hanabi9248@users.noreply.github.com>
Signed-off-by: Hanabi <317387557+Hanabi9248@users.noreply.github.com>
Signed-off-by: Hanabi <317387557+Hanabi9248@users.noreply.github.com>
@CLAassistant

CLAassistant commented Sep 12, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants