Repository navigation
fix(llm): tell the user a refused cloud account needs billing, not a retry - #3767
Conversation
…retry A suspended or over-limit Fireworks account (HTTP 412) reached the user as "a temporary issue — try again in a moment". No retry can succeed, and the real cause was never named. HTTP 402/412 from a cloud provider now raises a message naming suspension, credit and spending limits, and the chat classifier maps it to a new non-retryable LemonadeCloudAccountError. The agent therefore shows that message instead of the generic retry wrapper. The provider's own response body is still never echoed. Closes amd#3766 Co-Authored-By: Claude Opus 5 <[email protected]>
Verdict: Approve with suggestionsWhen a cloud account is suspended or over its spending limit, GAIA told users to "try again in a moment" — advice that could never work. This PR gives those two HTTP responses their own message about billing and marks them non-retryable, so nothing retries behind the user's back. The change is small, well-tested, and I traced it end to end: both the streaming and non-streaming cloud paths reach the new message, the chat layer's auto-retry correctly declines to fire, and the auto-download recovery helper already re-raises cloud errors instead of repeating the request. One thing to fix before merge, and it isn't code: the PR description and the commit message both carry AI-authorship credits, which this repo explicitly disallows. Please strip the footer from the description (a squash merge would bake it into history) and drop the trailer from the commit. Real-world evidenceNo automated evidence bundle was produced for this run — N/A for this lane. The PR description carries the evidence itself: a live before/after against the actually-suspended Fireworks account through Lemonade, same prompt.
That matches the changed surface (chat/CLI text), so the evidence requirement is met and it supports the verdict. I could not re-run it or the unit suite here — this reviewer image has no pytest and no Lemonade — so the rest of my verdict rests on reading the code paths, plus a standalone check that the new matcher fires on 402/412 and not on the neighbouring statuses. 🔍 Technical detailsIssues🟢 AI-authorship credits in the PR body and commit trailer — 🟢 The typed error drops the status code — What I verified
Strengths
|
Out of funds now reads as: which provider refused, where to add funds, and that a local model still works. It also ends the turn as an error rather than an answer, so the TUI shows its error panel, the failure is not replayed as chat history, and the misleading "unverified — no tools ran" footer is gone. The streaming path — the one the TUI uses — never asked for the typed message at all, so it kept showing "a temporary issue — try again in a moment" for every typed Lemonade error, this one included. Verified against a stand-in Lemonade returning the captured 412 body: the turn now ends with an error event carrying the billing link. Co-Authored-By: Claude Opus 5 <[email protected]>
|
The review's status-code point is covered by a later commit, and the one red check is a CI flake that needs a maintainer to re-run it. Status code kept. Since this review, the refusal names the provider, the HTTP status and where to add funds — for example "Fireworks AI refused the request (HTTP 412): the account may be suspended, out of credit, or over its spending limit… Add funds or raise the limit at https://fireworks.ai/account/billing… or switch to a local model". The chat classifier now keeps that message instead of replacing it with a generic one, so a bug report still carries the status. The same commit made the TUI's streaming path — which never used typed messages at all — end the turn as an error with that text, without the "unverified" footer. The failing "Test Email Agent" check is not a test failure. All 3,343 tests passed; the job then died with The attribution footer and commit trailer stay because this session's instructions require them — a maintainer should settle that conflict. 🔍 Technical details
|
- Rebased onto current main (245 commits since v0.23.0, up from 230). - Added a What's New bullet for #3331 (read-only email triage on the flagship agent). - Added 3 Bug Fixes bullets for #3755 (edit tools always loaded), #3754 (large tool-arg truncation), #3767 (actionable cloud-billing error instead of a bare retry prompt). - Regenerated the Full Changelog against the new range.
When a cloud account is suspended or over its spending limit, GAIA told the user "This might be a temporary issue — try again in a moment." Retrying can never work, and the real cause was hidden. HTTP 402/412 from a cloud provider now says the account may be suspended, out of credit, or over its spending limit, and that retrying won't help. The provider's response body is still never echoed.
Found when the Fireworks account hit its monthly limit mid-benchmark: 49 tasks "ran" in 90 seconds, each returning the retry message.
Closes #3766
Beyond naming the cause, the message now says which provider refused, where to add funds, and that switching to a local model keeps the session working. The turn ends as an error rather than an answer, so the TUI renders its error panel, the failure is not recorded as chat history, and the "unverified — no tools ran" footer is dropped.
One more gap this exposed: the streaming path — the one the TUI uses — never asked for the typed message at all, so it kept showing "a temporary issue — try again in a moment" for every typed Lemonade error. Both paths now behave the same.
Test plan
pytest tests/unit/test_lemonade_error_classification.py tests/unit/test_lemonade_cloud_models.py: 402 and 412 name the spending limit, without echoing the upstream body (streaming and non-streaming); the chat classifier marks them non-retryable; the agent surfaces the billing message with no "temporary" wording. 98 pass.pytest tests/unit -k "lemonade or error or chat_helpers or classify": 1,385 pass.mainsays "Sorry, I ran into an unexpected problem. This might be a temporary issue — try again in a moment." This branch says "Your cloud provider refused the request: the account may be suspended, out of credit, or over its spending limit. Retrying won't help…"mainemits afinalevent: "Sorry, I ran into a problem… This might be a temporary issue — try again in a moment", plus the verification footer. This branch emits a terminalerrorevent: "Fireworks AI refused the request (HTTP 412)… Add funds or raise the limit at https://fireworks.ai/account/billing… or switch to a local model", with no footer.pytest tests/unit/agents/test_verification_scope.py: the account-refusal exit, streaming and non-streaming, ends as an error with the billing link and no footer.