Skip to content

fix(streaming): stop resumableStream from retrying client validation errors - #46

Open
wssab314 wants to merge 1 commit into
QoderAI:mainfrom
wssab314:fix/resumable-stream-non-retryable-client-errors
Open

wssab314 wants to merge 1 commit into
QoderAI:mainfrom
wssab314:fix/resumable-stream-non-retryable-client-errors

Conversation

@wssab314

Copy link
Copy Markdown

Summary

  • Throw QoderError instead of plain Error from APIClient.validateHeaders(), PATCredential, and Forward/Managed pathParam() helpers.
  • Eagerly validate sessionID via pathParam(sessionID, "session_id") in Forward and Managed SessionEvents.resumableStream(), matching SessionThreadEvents.resumableStream().
  • Add regression tests in tests/resumable-streaming.test.mjs and an [Unreleased] changelog entry.

Fixes #45

Why

isResumableStreamRetryable() treats any error that is not a QoderError or SyntaxError as retryable. Because missing credentials and empty path parameters previously threw plain Error (and SessionEvents.resumableStream() did not validate sessionID eagerly), calling resumableStream() without auth or with an empty sessionID entered an infinite retry loop instead of failing fast.

Verification

  • npm run build
  • npm run typecheck
  • npm test
  • npm run docs:check
  • Relevant examples run or import successfully
  • Account-backed integration tests not required (offline unit/streaming fix)

Commands and results:

npm run build -> pass
npm run typecheck -> pass
npm test -> 4523 passed, 0 failed
npm run docs:check -> docs-check: PASS
python3 .github/scripts/release_notes.py check -> Changelog is valid

Impact

  • Public API or behavior changed (bugfix: client-side auth/param errors now throw QoderError, which subclasses Error, and resumableStream fails fast)
  • User-facing changes added to CHANGELOG.md under Unreleased
  • CommonJS, ESM, and subpath exports remain valid
  • Generated API documentation updated (verified with npm run docs:check, no API doc drift)
  • Contract or wire-field fixtures updated (not applicable)
  • Go and Python parity considered (Go and Python already fail fast on missing credentials / invalid path params)
  • Migration notes added for a breaking change (non-breaking; QoderError extends Error)
  • No credentials, .env.live, logs, or generated test output committed

…errors

Throw QoderError from APIClient.validateHeaders, PATCredential, and Forward/Managed pathParam helpers, and eagerly validate sessionID in Forward and Managed SessionEvents.resumableStream so missing credentials or empty IDs fail fast instead of looping indefinitely.

Fixes QoderAI#45
@wssab314
wssab314 requested a review from moonyue-w as a code owner November 24, 2026 05:16

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(streaming): resumableStream loops indefinitely on missing credentials or empty sessionID

1 participant