fix: correct the Altimate Base wallet-exhaustion message (does not reset daily) - #1249
Conversation
…set daily) `describeRateLimit`'s `ExceededBudget: User=` branch claimed the free Altimate Base allowance "resets tomorrow", but the per-user wallet (`GRANT_NEW_PRINCIPAL_USD`) is a one-time lifetime grant with no `budget_duration` — confirmed in altimate-gateway's `issuer/config.py` (`grant_budget_duration` defaults to `""`; `validate()` refuses to boot if it's ever set) and `issuer/accounting_db.py` (one-time registration grant, "without later top-ups"). Only the separate global $50/day ceiling (`litellm/config.yaml` `budget_duration: 1d`) actually resets daily, and its message is unchanged. New wallet message: "You've used your free Altimate Base allowance. It's a one-time grant and won't renew—switch models to keep going." Updates the wallet-budget assertion in `altimate-base-rate-limit-messages.test.ts` to match, replacing the comment that pinned the misleading behavior with the confirmed semantics and citations. All 21 tests in the file pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VqnuBDGkh1ZT65Ti7e6DHZ
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_0efbe671-5c44-4ce1-bbcf-d7719b7705ef) |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
full receipts (4 sessions)
builder ·
|
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Previous Review Summaries (2 snapshots, latest commit 2895ffc)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 2895ffc)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (3 files)
Fix these issues in Kilo Cloud Previous review (commit ce65723)Status: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Reviewed by deepseek-v4-pro · Input: 43.3K · Output: 15.9K · Cached: 551.7K Review guidance: REVIEW.md from base branch |
…limits doc Adds a sign-up nudge to the wallet-exhaustion message so users whose one-time allowance is gone have somewhere to go besides switching models: the paid Altimate LLM Gateway at `app.myaltimate.com` (`register?client=altimate-code`, confirmed in `src/altimate/plugin/altimate.ts`). The global-ceiling message is unchanged — it still promises a genuine daily reset. New wallet message: "You've used your free Altimate Base allowance — it's a one-time grant and won't renew. Sign up at app.myaltimate.com to keep going, or switch models." Updates the wallet-budget test to match and adds explicit assertions that the message contains the sign-up URL and no longer promises a reset. Adds a public, sanitized "Usage limits" section to `docs/docs/configure/providers.md` under Altimate Base: personal one-time allowance vs. shared daily capacity, rate limiting, and request size limits, each mapped to what to do about it — no model name, architecture, or exact thresholds (those stay in the internal gateway-repo doc). Also drops the "Qwen 3.8" model-name mention from the existing Altimate Base intro paragraph in the same section, which violated the no-model-name-in-public-docs constraint this doc is written to. `app.myaltimate.com` is the public product domain and is the only external host referenced. Verified clean with `bun script/check-tracker-leaks.ts`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VqnuBDGkh1ZT65Ti7e6DHZ
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_f0038fbf-b443-4329-b070-5c7063bc96f8) |
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
3 similar comments
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2895ffca2c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
…ndant rate-limit test assertions - providers.md previously called Altimate Base "anonymous", contradicting security-faq.md's "pseudonymous, not anonymous" — a stable per-installation identifier links requests across launches, and logging out does not reset it. Drop the false claim and replace the data-handling paragraph with the canonical wording (secrets are masked but shouldn't be relied on; usage is rate limited). - Remove the two `toContain`/`not.toContain` assertions in the budget-wallet test that duplicated what the preceding `toEqual` already pins exactly.
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_c86dedb7-58b3-4fdd-828f-1907739287d5) |
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
2 similar comments
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="docs/docs/configure/providers.md">
<violation number="1" location="docs/docs/configure/providers.md:58">
P3: This section now states the per-installation-identifier and `altimate providers logout altimate-base`-does-not-reset-it claim twice: the new pseudonymous paragraph (with the security-FAQ pointer) and the existing paragraph further down that starts "That hash is stable across launches...". Both cover the same identifier, the same logout command, and the same allowance-reset point. Keep the intro claim brief and leave the detailed identity/logout/allowance explanation in the later paragraph (or drop one of them) to avoid repeating the caveat in one section.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
| Requests and responses are logged and may be used to improve Altimate's products, including the | ||
| model. Secrets are automatically masked before storage, but don't rely on it — avoid sending | ||
| secrets or confidential code. Altimate Base is pseudonymous, not anonymous: a stable | ||
| per-installation identifier links your requests across launches and `altimate providers logout |
There was a problem hiding this comment.
P3: This section now states the per-installation-identifier and altimate providers logout altimate-base-does-not-reset-it claim twice: the new pseudonymous paragraph (with the security-FAQ pointer) and the existing paragraph further down that starts "That hash is stable across launches...". Both cover the same identifier, the same logout command, and the same allowance-reset point. Keep the intro claim brief and leave the detailed identity/logout/allowance explanation in the later paragraph (or drop one of them) to avoid repeating the caveat in one section.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/docs/configure/providers.md, line 58:
<comment>This section now states the per-installation-identifier and `altimate providers logout altimate-base`-does-not-reset-it claim twice: the new pseudonymous paragraph (with the security-FAQ pointer) and the existing paragraph further down that starts "That hash is stable across launches...". Both cover the same identifier, the same logout command, and the same allowance-reset point. Keep the intro claim brief and leave the detailed identity/logout/allowance explanation in the later paragraph (or drop one of them) to avoid repeating the caveat in one section.</comment>
<file context>
@@ -48,10 +48,16 @@ For pricing, security, and data handling details, see the [Altimate LLM Gateway
+Requests and responses are logged and may be used to improve Altimate's products, including the
+model. Secrets are automatically masked before storage, but don't rely on it — avoid sending
+secrets or confidential code. Altimate Base is pseudonymous, not anonymous: a stable
+per-installation identifier links your requests across launches and `altimate providers logout
+altimate-base` does not reset it (see the [security FAQ](../reference/security-faq.md)). Usage is
+rate limited.
</file context>
Issue for this PR
Closes #
Type of change
What does this PR do?
Fixes a real user-facing bug the e2e suite surfaced (
test/altimate/altimate-base-rate-limit-messages.test.ts, PR #1248): when a user exhausts their per-user Altimate Base wallet,describeRateLimittold them the free allowance "resets tomorrow." That's false for this case.Confirmed semantics (altimate-gateway, not guessed):
issuer/config.py:57—grant_budget_durationdefaults to"". The comment above it (issuer/config.py:54-56) states: "Empty = never reset. Enforcement is lifetime-cumulative (see budget_sync.py); daily free-tier quotas are implemented as daily CREDIT grants from the billing owner, not LiteLLM budget resets."issuer/config.py:142-146—validate()raisesRuntimeErrorifgrant_budget_durationis ever set, because "max_budget mirrors a lifetime allowance, and daily quotas require daily credit grants."issuer/accounting_db.py:576— the wallet is funded by a one-time registration grant, docstring: "Create the one-time registration grant without later top-ups."issuer/budget_sync.py:15-24—sync_current_wallet_budgetmirrors the lifetime allowance into LiteLLM'smax_budgetwith nobudget_duration, explicitly because a resetting duration "would re-grant the full wallet every period."litellm/config.yaml:96-106— a sharedmax_budget: 50withbudget_duration: 1d, comment: "Global daily ceiling across EVERY key, on top of the per-principal budget... Verified enforcing: further requests return 429 with 'Budget has been exceeded! Current cost: ... Max budget: ...'."So the two
budget_exceededbranches indescribeRateLimitreally are semantically different — the wallet case never renews, the global case renews every day — and only the global message should promise a reset.Old wallet message:
Final wallet message (corrected, then a sign-up nudge added on top):
Global ceiling message — unchanged (still correct):
Where this lands: the message and the test that pins it are both new in #1199 (
codex/altimate-base-release-final) —client.tsdoesn't exist onmainat all. #1248 (test/altimate-base-e2e, stacked on #1199) ownsaltimate-base-rate-limit-messages.test.ts, including the comment on the wallet-budget test that explicitly flagged this message as misleading while pinning current behavior. This PR is branched offtest/altimate-base-e2eso the message fix and its test update land together in the branch that already owns both, rather than fragmenting the change across two feature branches.Follow-up commit: sign-up nudge + public usage-limits doc
Once the wallet-exhaustion case had no reset to promise, the only actionable next step for a user is switching models or upgrading — so the message now points to the paid Altimate LLM Gateway sign-up flow,
app.myaltimate.com(register?client=altimate-code, confirmed insrc/altimate/plugin/altimate.ts'sDEFAULT_WEB_URL). The global-ceiling message is untouched.Also adds a public, sanitized "Usage limits" section to
docs/docs/configure/providers.mdunder Altimate Base, covering: personal one-time allowance vs. shared daily capacity (which resets daily), rate limiting, and request size limits — each mapped to what the user should do about it. No model name, architecture, or exact numeric thresholds (those stay in the internal gateway-repo doc); only the already-public context/output limits (131K/65K) are stated. In the same section, also removed a pre-existing "Qwen 3.8" model-name mention from the Altimate Base intro paragraph (introduced in #1199), which violated the no-model-name-in-public-docs constraint this new section is written to.app.myaltimate.comis the public product domain, already present elsewhere in source, and is not one of the hostsscript/check-tracker-leaks.tsblocks (it only flags our internal-only hostname, Jira ticket keys, and the Atlassian instance URL) — verified clean.How did you verify your code works?
bun test test/altimate/altimate-base-rate-limit-messages.test.ts— 21 pass, 0 fail (frompackages/opencode)bun run typecheck(frompackages/opencode) — cleanbun run script/upstream/analyze.ts --markers --base origin/main --strict—ok,client.tsis not an upstream-shared file so no markers were neededbun script/check-tracker-leaks.ts— clean (exit 0, silent); confirmsapp.myaltimate.comis not flagged and no internal hostname/ticket references leakeddescribeRateLimitmessages inclient.ts(throttle-tokens, throttle-burst, budget-global, budget-unknown) to keep tone/format consistent; only the wallet branch changedtoContain("app.myaltimate.com")/not.toContain("resets tomorrow")checks; the global-ceiling and budget-unknown test cases are untouched and still assert "resets tomorrow"Screenshots / recordings
N/A — text and docs changes only, no UI.
Checklist
Note
Low Risk
User-facing text and documentation only; no auth, billing, or inference logic changes beyond error-message strings for one 429 branch.
Overview
Fixes misleading Altimate Base copy when a user hits the per-installation wallet (
ExceededBudget: User=): the UI no longer says the allowance “resets tomorrow.” It now states the grant is one-time, won’t renew, and points users to app.myaltimate.com or another model. The shared daily ceiling message is unchanged.describeRateLimitinclient.tsand thebudget-wallettest inaltimate-base-rate-limit-messages.test.tsare updated together, with comments documenting gateway semantics (lifetime wallet vs daily global pool).Providers docs expand the Altimate Base section: clearer intro (including public 131K/65K limits, no model name), plus a new Usage limits subsection (personal allowance, shared daily capacity, rate limits, request size) aligned with the actionable errors users see.
Reviewed by Cursor Bugbot for commit 59b046a. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Fixes the Altimate Base wallet-exhaustion message so it no longer claims the per-user allowance resets daily; the per-user wallet is a one-time lifetime grant and only the shared global daily ceiling renews. The message now points users to sign up at
app.myaltimate.com.Written for commit 59b046a. Summary will update on new commits.