Implement rate limit error response handling and cleanup - #3
Conversation
…dling - Introduced a new response function to handle rate limit errors with HTTP 403 status. - Updated existing error responses to utilize the new function for consistency. - Cleaned up unused code and improved readability in related functions.
There was a problem hiding this comment.
No issues found across 2 files
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Re-trigger cubic
|
/codesmith review this PR |
I've completed my review. Here's what I found. VerdictThe core idea, routing quota/rate-limit dead-ends through an HTTP 403 (instead of Should fix (regression)
Should verifyThe 403 body doesn't always contain "rate limit". The new function's own doc comment says the body must match OmoSlim's Naming/labeling mismatch. Reviewability (please address)
Nits / FYI (all verified safe, non-blocking)
Net: fix the |
|
Thanks for the contribution. I audited this branch against the current Google/Gemini response path and am closing it rather than merging it. Returning quota failures as HTTP 403 bypasses the Gemini SSE completion path that we use to keep OpenCode and subagent sessions terminal. The branch also treats accounts with an omitted legacy The underlying single-account soft-quota problem was fixed structurally in |
…moval P1 cortexkit#2: removeAccount() persisted a hardcoded 0 activeIndex when the captured current token was the one removed. The live AccountManager keeps the cursor at the removed slot, so use the clamped removed index instead of falling back to 0 — restart-time reload now re-elects the same account the live manager kept current. P2 cortexkit#3: removeAccount() collapsed both per-family active cursors onto the same captured token, silently unelecting whichever family the captured token didn't belong to. Expose getActiveIndexByFamily on the AccountManager + view, capture per-family tokens in the mutator, and persist each family's remapped index independently. P2 cortexkit#6: the sidebar refresher built dialog rows from the post-mutation command data, which does not carry the running cooldown. A toggle / remove / setCurrent action momentarily cleared any rate-limited account's cooldown. Look up the live account's coolingDownUntil by index and preserve it on the projection.
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by cubic
Standardized rate limit handling by introducing a 403 error response with optional Retry-After and routing all quota-related errors through it. This gives clearer, consistent messages when accounts hit soft or hard limits.
Refactors
Migration
Written for commit 774b254. Summary will update on new commits.