From ce657230138f32d510b0a5c3fa975a17e4f42d5a Mon Sep 17 00:00:00 2001 From: anandgupta42 Date: Fri, 4 Sep 2026 13:12:00 -0700 Subject: [PATCH 1/3] fix: correct the Altimate Base wallet-exhaustion message (does not reset daily) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `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 Claude-Session: https://claude.ai/code/session_01VqnuBDGkh1ZT65Ti7e6DHZ --- packages/opencode/src/altimate/free/client.ts | 6 +++++- .../altimate-base-rate-limit-messages.test.ts | 15 ++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/packages/opencode/src/altimate/free/client.ts b/packages/opencode/src/altimate/free/client.ts index 71e81e50a..17221c488 100644 --- a/packages/opencode/src/altimate/free/client.ts +++ b/packages/opencode/src/altimate/free/client.ts @@ -510,8 +510,12 @@ export function describeRateLimit( } if (kind === "budget_exceeded") { if (detail.includes("ExceededBudget: User=")) { + // The per-user wallet (GRANT_NEW_PRINCIPAL_USD) is a one-time lifetime grant with no + // budget_duration — it never resets. Only the shared global ceiling below resets daily. + // See altimate-gateway issuer/config.py (grant_budget_duration, validate()) and + // accounting_db.py's one-time registration grant. return { - message: "You've used today's free Altimate Base allowance. It resets tomorrow—switch models to keep going.", + message: "You've used your free Altimate Base allowance. It's a one-time grant and won't renew—switch models to keep going.", retryable: false, } } diff --git a/packages/opencode/test/altimate/altimate-base-rate-limit-messages.test.ts b/packages/opencode/test/altimate/altimate-base-rate-limit-messages.test.ts index e7d5de5af..ee353bee2 100644 --- a/packages/opencode/test/altimate/altimate-base-rate-limit-messages.test.ts +++ b/packages/opencode/test/altimate/altimate-base-rate-limit-messages.test.ts @@ -124,14 +124,15 @@ describe("describeRateLimit — via the fake gateway (every ChatMode failure kno expect(response.status).toBe(429) const described = FreeTier.describeRateLimit({ body: await response.text() }) - // Pinning today's message as written. Flagged ambiguity (plan Deliverable 1, Suite E / - // Summary #2): "It resets tomorrow" is arguably inaccurate for the wallet case — the - // per-principal grant (GRANT_NEW_PRINCIPAL_USD) has no budget_duration and never resets; only - // the separate global daily ceiling actually resets daily. This test asserts current - // behavior, not the plan's suggested fix, per the plan's explicit instruction not to - // silently "correct" it. + // Confirmed against altimate-gateway (issuer/config.py `grant_budget_duration` defaults to + // "" and `validate()` refuses to boot if it's ever set; issuer/accounting_db.py grants a + // one-time registration credit with "without later top-ups" in the docstring; issuer/ + // budget_sync.py mirrors the lifetime allowance into LiteLLM's max_budget with no + // budget_duration). The per-user wallet is a one-time lifetime grant that never renews — + // unlike the separate global $50/day ceiling (litellm/config.yaml `budget_duration: 1d`), + // which genuinely does reset daily and is covered by the budget-global case below. expect(described).toEqual({ - message: "You've used today's free Altimate Base allowance. It resets tomorrow—switch models to keep going.", + message: "You've used your free Altimate Base allowance. It's a one-time grant and won't renew—switch models to keep going.", retryable: false, }) }) From 2895ffca2c5b265f623f2df2cee457017dfe5729 Mon Sep 17 00:00:00 2001 From: anandgupta42 Date: Fri, 4 Sep 2026 13:52:03 -0700 Subject: [PATCH 2/3] feat: add sign-up nudge to the wallet message + public Altimate Base limits doc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Claude-Session: https://claude.ai/code/session_01VqnuBDGkh1ZT65Ti7e6DHZ --- docs/docs/configure/providers.md | 22 ++++++++++++++++--- packages/opencode/src/altimate/free/client.ts | 6 +++-- .../altimate-base-rate-limit-messages.test.ts | 9 ++++++-- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/docs/docs/configure/providers.md b/docs/docs/configure/providers.md index b310e58b7..97745d9c4 100644 --- a/docs/docs/configure/providers.md +++ b/docs/docs/configure/providers.md @@ -48,9 +48,10 @@ For pricing, security, and data handling details, see the [Altimate LLM Gateway ## Altimate Base -Altimate Base is the hosted Qwen 3.8 free model. It requires no signup or user-managed API key and -is subject to rate limits and abuse protection. Requests and responses are logged and may be used -to improve Altimate products and services. Do not send secrets or confidential code. +Altimate Base is a free, hosted model. It's anonymous — no signup, no account, no user-managed API +key. Accept a one-time consent disclosure and it just works. It supports up to 131K tokens of +context and up to 65K tokens of output. Requests and responses are logged and may be used to +improve Altimate products and services. Do not send secrets or confidential code. Choose **Altimate Base** from the first-run picker or `/connect`. A disclosure is shown before any registration request; **No** is selected by default. After registration, the model is available as @@ -58,6 +59,21 @@ registration request; **No** is selected by default. After registration, the mod explicit model is selected. Big Pickle is no longer selected implicitly, but remains available in the full OpenCode model catalog for users who choose it explicitly. +### Usage limits + +Altimate Base is fair-use, not unlimited: + +- **Your personal allowance** is a one-time grant tied to this installation. It does not renew. + Once it's used up, sign up at [app.myaltimate.com](https://app.myaltimate.com) for a paid plan + (the Altimate LLM Gateway) to keep going, or switch to another model. +- **Shared daily capacity** is a pool covering every free-tier user. It resets daily. If it's + exhausted, try again tomorrow or switch models in the meantime. +- **Rate limiting** protects the service from bursts. If you hit it, wait a moment and retry. +- **Request size limits** apply per request. If a request is rejected as too large, shorten it — + start a new session or trim the context — and try again. + +Each of these is reported back to you as a specific, actionable error message when it happens. + Official release binaries embed the current gateway endpoint at build time. Operators and local development can override it without changing code: diff --git a/packages/opencode/src/altimate/free/client.ts b/packages/opencode/src/altimate/free/client.ts index 17221c488..193cbc7a9 100644 --- a/packages/opencode/src/altimate/free/client.ts +++ b/packages/opencode/src/altimate/free/client.ts @@ -513,9 +513,11 @@ export function describeRateLimit( // The per-user wallet (GRANT_NEW_PRINCIPAL_USD) is a one-time lifetime grant with no // budget_duration — it never resets. Only the shared global ceiling below resets daily. // See altimate-gateway issuer/config.py (grant_budget_duration, validate()) and - // accounting_db.py's one-time registration grant. + // accounting_db.py's one-time registration grant. Points to the paid Altimate LLM Gateway + // sign-up (app.myaltimate.com) since switching models is the only other option here. return { - message: "You've used your free Altimate Base allowance. It's a one-time grant and won't renew—switch models to keep going.", + 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.", retryable: false, } } diff --git a/packages/opencode/test/altimate/altimate-base-rate-limit-messages.test.ts b/packages/opencode/test/altimate/altimate-base-rate-limit-messages.test.ts index ee353bee2..8a3abd96a 100644 --- a/packages/opencode/test/altimate/altimate-base-rate-limit-messages.test.ts +++ b/packages/opencode/test/altimate/altimate-base-rate-limit-messages.test.ts @@ -130,11 +130,16 @@ describe("describeRateLimit — via the fake gateway (every ChatMode failure kno // budget_sync.py mirrors the lifetime allowance into LiteLLM's max_budget with no // budget_duration). The per-user wallet is a one-time lifetime grant that never renews — // unlike the separate global $50/day ceiling (litellm/config.yaml `budget_duration: 1d`), - // which genuinely does reset daily and is covered by the budget-global case below. + // which genuinely does reset daily and is covered by the budget-global case below. The + // message nudges toward the paid Altimate LLM Gateway (app.myaltimate.com) since switching + // models is the only other option when a lifetime grant is gone for good. expect(described).toEqual({ - message: "You've used your free Altimate Base allowance. It's a one-time grant and won't renew—switch models to keep going.", + 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.", retryable: false, }) + expect(described?.message).toContain("app.myaltimate.com") + expect(described?.message).not.toContain("resets tomorrow") }) test("budget-global: shared $50/day ceiling maps to the shared-daily-limit message, non-retryable", async () => { From 59b046ae0e1f117f4f1508be55c3f5e13fad60c5 Mon Sep 17 00:00:00 2001 From: anandgupta42 Date: Sat, 5 Sep 2026 00:03:46 -0700 Subject: [PATCH 3/3] docs: describe Altimate Base as pseudonymous not anonymous; drop redundant rate-limit test assertions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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. --- docs/docs/configure/providers.md | 12 +++++++++--- .../altimate-base-rate-limit-messages.test.ts | 2 -- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/docs/configure/providers.md b/docs/docs/configure/providers.md index 97745d9c4..4de05c409 100644 --- a/docs/docs/configure/providers.md +++ b/docs/docs/configure/providers.md @@ -48,10 +48,16 @@ For pricing, security, and data handling details, see the [Altimate LLM Gateway ## Altimate Base -Altimate Base is a free, hosted model. It's anonymous — no signup, no account, no user-managed API +Altimate Base is a free, hosted model — no signup, no account, no user-managed API key. Accept a one-time consent disclosure and it just works. It supports up to 131K tokens of -context and up to 65K tokens of output. Requests and responses are logged and may be used to -improve Altimate products and services. Do not send secrets or confidential code. +context and up to 65K tokens of output. + +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. Choose **Altimate Base** from the first-run picker or `/connect`. A disclosure is shown before any registration request; **No** is selected by default. After registration, the model is available as diff --git a/packages/opencode/test/altimate/altimate-base-rate-limit-messages.test.ts b/packages/opencode/test/altimate/altimate-base-rate-limit-messages.test.ts index 8a3abd96a..88b8442c0 100644 --- a/packages/opencode/test/altimate/altimate-base-rate-limit-messages.test.ts +++ b/packages/opencode/test/altimate/altimate-base-rate-limit-messages.test.ts @@ -138,8 +138,6 @@ describe("describeRateLimit — via the fake gateway (every ChatMode failure kno "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.", retryable: false, }) - expect(described?.message).toContain("app.myaltimate.com") - expect(described?.message).not.toContain("resets tomorrow") }) test("budget-global: shared $50/day ceiling maps to the shared-daily-limit message, non-retryable", async () => {