feat: 401 auth-failure handling — suspend after N, typed errors (#16)#32
Conversation
Captures the decisions from brainstorming: mirror Python's Error-subclass hierarchy (RecostError / RecostAuthError / RecostFatalAuthError), suspend cloud transport after maxConsecutiveAuthFailures (default 5) consecutive 401s, restart-only recovery, two stderr lines per episode. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
12 tasks: types/error classes, public-API re-export, ResolvedConfig wiring, transport 401 lifecycle (counter + suspend), 9 new tests + 1 audit, README updates, final verification. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
RecostError/RecostAuthError/RecostFatalAuthErrorto the public API; mirrors Python's pre-declared hierarchy.maxConsecutiveAuthFailures(default 5) consecutive 401s. Recovery is restart-only.debugflag.onError(err: Error)signature is unchanged — hosts narrow viainstanceof.Closes #16.
Test plan
npm run test— 228/228 green (219 baseline + 9 new cases)npm run lint— cleannpm run build— clean dual ESM + CJS + DTSRecostAuthErrorfrom@recost-dev/nodein both ESM and CJS