Skip to content

feat: streaming lifecycle, tenant-safe caching, client-scoped resilience - #119

Merged
stackbilt-admin merged 3 commits into
mainfrom
sweep/2026-10-reliability
Oct 15, 2026
Merged

stackbilt-admin merged 3 commits into
mainfrom
sweep/2026-10-reliability

Conversation

@stackbilt-admin

Copy link
Copy Markdown
Member

Reliability sweep across the open roadmap (#118). Compatible additions only; the new public APIs need a minor release. Version, lockfile and VERSION are 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

New public exports

QuotaDeniedError, NoRouteError, ResilienceContext, normalizeCanonicalRequest, normalizeLegacyRequest, ManagedTextStream, StreamCompletion; client methods generateManagedResponseStream, getRoutingInfo.

Validation (Windows, Node 24.19.0)

  • npm test: 605 passed across 27 files (4 new suites, 101 tests)
  • npm run typecheck: passed
  • npm run test:worker-import: passed
  • Not run: live providers, workerd runtime, Node 20 minimum, the Linux test:package script (its artifact checks were run by hand per the checkpoint).

🤖 Generated with Claude Code

kovermier and others added 3 commits October 15, 2026 10:39
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]>
@stackbilt-admin
stackbilt-admin merged commit 1bbec3a into main Oct 15, 2026
2 checks passed
@stackbilt-admin
stackbilt-admin deleted the sweep/2026-10-reliability branch October 15, 2026 16:05
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]>
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.

2 participants