Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 28 minutes and 22 seconds. ⌛ 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: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
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 |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
| @@ -444,8 +511,16 @@ export async function runReportCommand( | |||
| ); | |||
| continue; | |||
| } | |||
| if ( | |||
| typeof options.maxProbes === "number" && | |||
| executedLiveProbes >= options.maxProbes | |||
| ) { | |||
| probeErrors.push(`live probe request budget reached (${options.maxProbes})`); | |||
| break; | |||
| } | |||
|
|
|||
| try { | |||
| executedLiveProbes += 1; | |||
There was a problem hiding this comment.
Refresh fires before
--max-probes budget check
when --max-probes=N and accounts need refreshing, account N+1 executes queuedRefresh (network call + temp-file write on windows) before the probe-budget guard fires and breaks the loop. on windows, an antivirus-held temp handle can trigger EPERM on the next write — per project convention, unnecessary temp files are a real risk.
moving the maxProbes check above the hasUsableAccessToken block prevents the orphaned refresh:
// check probe budget before attempting any refresh
if (
typeof options.maxProbes === "number" &&
executedLiveProbes >= options.maxProbes
) {
probeErrors.push(`live probe request budget reached (${options.maxProbes})`);
break;
}
let probeAccessToken = account.accessToken;
let probeAccountId = account.accountId ?? extractAccountId(account.accessToken);
if (!deps.hasUsableAccessToken(account, now)) {
// ... refresh logic
}Prompt To Fix With AI
This is a comment left during a code review.
Path: lib/codex-manager/commands/report.ts
Line: 433-523
Comment:
**Refresh fires before `--max-probes` budget check**
when `--max-probes=N` and accounts need refreshing, account N+1 executes `queuedRefresh` (network call + temp-file write on windows) before the probe-budget guard fires and breaks the loop. on windows, an antivirus-held temp handle can trigger EPERM on the next write — per project convention, unnecessary temp files are a real risk.
moving the `maxProbes` check above the `hasUsableAccessToken` block prevents the orphaned refresh:
```typescript
// check probe budget before attempting any refresh
if (
typeof options.maxProbes === "number" &&
executedLiveProbes >= options.maxProbes
) {
probeErrors.push(`live probe request budget reached (${options.maxProbes})`);
break;
}
let probeAccessToken = account.accessToken;
let probeAccountId = account.accountId ?? extractAccountId(account.accessToken);
if (!deps.hasUsableAccessToken(account, now)) {
// ... refresh logic
}
```
How can I resolve this? If you propose a fix, please make it concise.|
Superseded by #387, which rebuilds the full open PR stack onto one reviewed integration branch. |
|
Closing in favor of #387. |
Summary
--max-accounts,--max-probes, and--cached-onlycontrols tocodex auth report --liveValidation
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
adds
--max-accounts,--max-probes, and--cached-onlyflags tocodex auth report --live, surfacing budget counters in both human-readable and JSON output with focused vitest coverage for budget enforcement, invalid-value rejection, and cached-only behaviour. the implementation is clean and the new tests are well-scoped; one ordering detail means token refresh can fire for an account that immediately hits the probe budget on the very next check.Confidence Score: 5/5
safe to merge; all findings are P2 style/efficiency suggestions with no correctness or data-integrity impact
the budget logic produces correct output, the new tests cover the critical paths, and the one ordering concern (refresh before probe budget check) is a minor efficiency issue that does not affect report accuracy or cause data loss
lib/codex-manager/commands/report.ts — review the maxProbes check placement relative to queuedRefresh to avoid unnecessary refreshes on windows
Important Files Changed
Sequence Diagram
sequenceDiagram participant CLI as CLI args participant Parser as parseReportArgs participant Loop as Account Loop participant Refresh as queuedRefresh participant Probe as fetchCodexQuotaSnapshot CLI->>Parser: --live --max-accounts N --max-probes M --cached-only Parser-->>Loop: options{maxAccounts, maxProbes, cachedOnly} loop for each account in storage Loop->>Loop: check maxAccounts budget (break if hit) Loop->>Loop: skip disabled accounts Loop->>Loop: consideredLiveAccounts += 1 alt token not usable AND NOT cachedOnly Loop->>Refresh: queuedRefresh(refreshToken) Note right of Refresh: network call + temp file write (windows risk) Refresh-->>Loop: TokenResult Loop->>Loop: persist refreshed token to disk else cachedOnly AND token not usable Loop->>Loop: push skip error, continue end Loop->>Loop: check missing accountId (continue if missing) Loop->>Loop: check maxProbes budget (break if hit) Note over Loop: ⚠ refresh already ran for this account Loop->>Probe: fetchCodexQuotaSnapshot(accountId, accessToken, model) Probe-->>Loop: CodexQuotaSnapshot Loop->>Loop: executedLiveProbes += 1 end Loop-->>CLI: report{liveProbeBudget{consideredAccounts, executedProbes}}Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "feat: add live probe budgets and warning..." | Re-trigger Greptile