Repository navigation
feat: streaming lifecycle, tenant-safe caching, client-scoped resilience - #119
Merged
Merged
Conversation
Reliability sweep across the open roadmap (#118). Compatible additions only; the next minor release carries the new public APIs. - #110 shared incremental SSE decoder for all six adapters with demand, cancellation, body deadlines and settled partial usage; managed streams via generateManagedResponseStream() - #108 versioned SHA-256 response-cache identities scoped by tenant, namespace, provider options and routing policy - #109 QuotaDeniedError terminates without fallback (first phase; atomic reservations remain) - #111 stateScope 'client' / ResilienceContext, breaker policy fixes - #113 explicit canonical/legacy normalization, planner-backed getRoutingInfo(), NoRouteError - #94 inlineSources in published JavaScript sourcemaps - #116 guarded quota/stream observers and fault tests (partial) Remaining scope per issue is recorded in docs/maintenance/issue-sweep.md. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review of #119 found the sweep changed existing behavior it claimed to preserve, and that failed stream opens billed tenants an estimate before failover billed them again. - Provider timeout covers stream opening only again; whole-stream deadline is opt-in via streamBodyTimeout. makeRequest composes a caller signal with its header timeout instead of replacing it. - Pre-output stream failures record only provider-reported usage, so 5xx/network errors and Workers AI estimates are no longer charged. - Ledger failures reject the managed completion only; delivered text is never errored and pre-output settlement failure no longer blocks fallback. - QuotaDeniedError extends QuotaExceededError (QUOTA_EXCEEDED) and is excluded from provider exhaustion. - Catalog getRoutingInfo/getGatewayRoutePlan never throw; only the client preflight throws NoRouteError. GatewayRoutePlan.executable is optional. - Factory breaker default is unset again; provider-level enableCircuitBreaker wins over the factory value. - onCache reports bypass when a request identity cannot be hashed. - CHANGELOG lists cache key v2, system-message joining and other behavior changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… configured host Round-2 review of #119: the open timer started at stream construction, so a direct-adapter caller who read later than `timeout` got a TimeoutError before any request was sent. Deadlines now start when the request is actually issued. A gateway plan that describes a host outside availableProviders is no longer reported executable. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merged
stackbilt-admin
added a commit
that referenced
this pull request
Oct 15, 2026
Minor release for the reliability sweep (#119) and hook isolation (#120): new public APIs for managed streaming, client-scoped resilience state, explicit request normalization, client routing preflight and local quota denial, plus the streaming, caching, breaker and hook fixes. The CHANGELOG entry was reviewed against the merged code, including the behaviour changes callers may notice. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reliability sweep across the open roadmap (#118). Compatible additions only; the new public APIs need a minor release. Version, lockfile and
VERSIONare not bumped in this PR.Part of: #94, #108, #109, #110, #111, #113, #115, #116 (this PR does not close them; see the remaining scope for each in
docs/maintenance/issue-sweep.md)What's in it
src/utils/provider-stream.ts) for all six adapters. Handles split UTF-8, CR/LF/CRLF, multiline data, demand-driven reads, cancellation, body deadline and partial-usage settlement. NewgenerateManagedResponseStream()returns{ stream, completion }. The legacygenerateResponseStream()keeps its shape.src/utils/response-cache.ts).QuotaDeniedErrorends regular, streaming and image requests without fallback or marking a provider exhausted. Atomic reserve/settle is still to do.stateScope: 'client'/ sharedResilienceContext. Disabled breakers are bypassed, rejected calls can no longer postpone recovery, and caller/auth/quota errors no longer count against provider health.normalizeCanonicalRequest()/normalizeLegacyRequest(), planner-backedgetRoutingInfo(),NoRouteError, andGatewayRoutePlan.executable.inlineSourcesin the published JS sourcemaps, plus a check in the package smoke test.New public exports
QuotaDeniedError,NoRouteError,ResilienceContext,normalizeCanonicalRequest,normalizeLegacyRequest,ManagedTextStream,StreamCompletion; client methodsgenerateManagedResponseStream,getRoutingInfo.Validation (Windows, Node 24.19.0)
npm test: 605 passed across 27 files (4 new suites, 101 tests)npm run typecheck: passednpm run test:worker-import: passedtest:packagescript (its artifact checks were run by hand per the checkpoint).🤖 Generated with Claude Code