fix(routing): keep sticky requests in strict pools - #234
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughRequest routing now records attempted and unsupported accounts. Failure responses report accurate pool, unavailable, and entitlement counts. Tests cover strict-pool exhaustion and sticky account selection within configured pools. ChangesRouting diagnostics
Estimated code review effort: 2 (Simple) | ~15 minutes Merge Risk: ⚪ Minimal · up to The change is localized to sticky routing behavior and its regression tests; no actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
| const unavailableCount = Math.max( | ||
| 0, | ||
| preferredAccountIds.length - attemptedCount, | ||
| ); |
There was a problem hiding this comment.
when a legacy workspace key matches multiple business seats, unavailableCount subtracts attempted account indexes from configured identity keys, causing the strict-pool error to understate or omit unavailable accounts.
Context Used: speak in lowercase, concise sentences. act like th... (source)
Knowledge Base Used: Account rotation and selection
Prompt To Fix With AI
This is a comment left during a code review.
Path: index.ts
Line: 3246-3249
Comment:
**pool counts mix cardinalities**
when a legacy workspace key matches multiple business seats, `unavailableCount` subtracts attempted account indexes from configured identity keys, causing the strict-pool error to understate or omit unavailable accounts.
**Context Used:** speak in lowercase, concise sentences. act like th... ([source](https://app.greptile.com/review/custom-context?memory=instruction-0))
**Knowledge Base Used:** [Account rotation and selection](https://app.greptile.com/zeian/-/custom-context/knowledge-base/ndycode/oc-codex-multi-auth/-/docs/account-rotation-and-selection.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary\n- keep sticky routing within strict model account pools\n- report actual attempted, unsupported, and unavailable accounts in routing errors\n- add strict-pool sticky routing regression coverage\n\n## Verification\n- npm test\n- npm run typecheck\n- npm run lint\n\nNote: this branch is based on the fork's current main, which is ahead of upstream main.
Summary by CodeRabbit
note: greptile review for oc-chatgpt-multi-auth. cite files like
lib/foo.ts:123. confirm regression tests + windows concurrency/token redaction coverage.Greptile Summary
this pr adds request-local accounting for attempted and unsupported accounts and improves terminal routing diagnostics. it also adds vitest coverage for strict-pool errors and sticky selection, but lacks coverage for legacy workspace keys that expand to multiple business seats.
Confidence Score: 4/5
the strict-pool diagnostic count should be corrected before merging because multi-seat workspace pools can report false availability information.
the new unavailable-count calculation subtracts resolved account attempts from configured identity keys, so legacy workspace pools can produce incorrect operator-facing routing errors.
Files Needing Attention: index.ts, test/index.test.ts
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart LR A[model pool keys] --> B[resolve matching account indexes] B --> C[select strict-pool account] C --> D[send upstream request] D --> E[record attempted or unsupported index] E --> F{another selectable pool account?} F -->|yes| C F -->|no| G[compose terminal routing error]Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "fix(routing): keep sticky requests in st..." | Re-trigger Greptile
Context used (3)