Skip to content

feat(accounts): withAccount wrapper for retry/cooldown (Task #4)#20

Open
lubobill1990 wants to merge 1 commit into
feat/03-service-token-threadingfrom
feat/04-with-account-wrapper
Open

feat(accounts): withAccount wrapper for retry/cooldown (Task #4)#20
lubobill1990 wants to merge 1 commit into
feat/03-service-token-threadingfrom
feat/04-with-account-wrapper

Conversation

@lubobill1990
Copy link
Copy Markdown
Collaborator

Summary

  • src/lib/with-account.ts: 401 → refresh + retry; 5xx/network → cooldown + retry; 4xx propagates. Retries cap at min(pool size, 3).
  • chat-completions, messages, embeddings handlers now go through withAccount.

Test plan

  • 62 tests pass (5 new for withAccount)
  • typecheck clean

Refs #4

🤖 Generated with Claude Code

- src/lib/with-account.ts: 401 -> refresh token + retry; 5xx/network -> cooldown + retry; 4xx propagates. Cap min(pool size, 3).
- Handlers in chat-completions, messages, embeddings now go through withAccount.

Tests: success, 5xx retry/cooldown, 4xx no retry, 401 refresh + retry, retries cap.

Refs #4

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
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.

1 participant