Fail over on out-of-funds keys instead of failing the user request immediately #6

Open
opened 2026-03-10 14:40:54 +03:00 by sirily · 0 comments
Owner

Problem
packages/domain/src/provider-key-pool.ts currently returns stop_request on insufficient_funds.

Why this matters
An exhausted provider key is an internal supply problem, not a user-caused terminal error. If other active keys are available, the request should continue instead of failing immediately.

Acceptance criteria

  • insufficient_funds moves the key to out_of_funds.
  • The worker continues with the next eligible key when one exists.
  • The request only fails after all eligible keys are exhausted or a user-caused terminal error occurs.
  • Update docs/ops/provider-key-pool.md if policy semantics change.
Problem `packages/domain/src/provider-key-pool.ts` currently returns `stop_request` on `insufficient_funds`. Why this matters An exhausted provider key is an internal supply problem, not a user-caused terminal error. If other active keys are available, the request should continue instead of failing immediately. Acceptance criteria - `insufficient_funds` moves the key to `out_of_funds`. - The worker continues with the next eligible key when one exists. - The request only fails after all eligible keys are exhausted or a user-caused terminal error occurs. - Update `docs/ops/provider-key-pool.md` if policy semantics change.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sirily/nroxy#6