Repository navigation
fix(usage): recover missing Codex hub plans from auth metadata - #10878
kalvenschraut wants to merge 1 commit into
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused usage bug fix that adds a backward-compatible metadata fallback and verifies both current and legacy Codex plan fields. Existing upstream plan data remains unchanged, while missing-plan accounts now receive the correct label and monthly quota classification. Notes:
You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughCodex plan resolution now falls back to token metadata when upstream usage responses omit plan information. Tests cover current and legacy plan fields for Free and Go accounts. ChangesCodex plan resolution
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Codex usage now recovers missing plan metadata from current and legacy token fields, preserving correct account labels and monthly quota windows for Free and Go plans. No current merge-blocking risk remains. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Dismissing prior approval to re-evaluate 836db7a
|
Note Written by Hi! We are cleaning up open PRs, and this one appears to have been created with an older model ( |
|
Note Written by Reopening, this was closed by mistake. Sorry for the noise! |
What changed
When CLIProxyAPI's usage response omits
plan_type, T3 can lose the account's plan label and classify a Free or Go quota window as a session window even though the auth-file metadata contains the plan.Resolve the plan once from the usage response, then
id_token.plan_type, then the legacyid_token.chatgpt_plan_type. Use that value for both the label and quota conversion. The current CLIProxyAPI management handler emitsplan_type.UI
Synthetic browser fixture generated from the baseline and patched adapters. The usage response omits the plan and window duration; auth metadata contains
plan_type: "free". The quota is now classified as Monthly.Verification
Implemented with GPT-6 in Codex; reviewed with claude-fable-5-1 through Claude Code.
Summary by CodeRabbit