Repository navigation
Review follow-ups for #77: hint after the error, exact refusal phrases - #81
Merged
Merged
Conversation
…rases The hint printed between fang's error box and the plain error line, so it now prints after the last one. Unpaid invoices need a 402, so a query error naming a column such as unpaid_balance gets no hint, and the credit phrases are the exact wording of the MCP and query engine refusals, which also covers the trial message the old list missed. Amp-Thread-ID: https://ampcode.com/threads/T-01a21432-3ab4-74cb-a610-cc642f0dc0ab Co-authored-by: Amp <amp@ampcode.com>
norbertdurcansk
approved these changes
Nov 26, 2026
norbertdurcansk
left a comment
Contributor
There was a problem hiding this comment.
Approved. Checked the two runtime facts this depends on: duneapi's customer middleware returns 402 for unpaid invoices, so the new status gate doesn't hide the payment hint; and the credit phrases match the merged core#8340 refusal wording (free plan, trial, team/org limit, unknown cause). Dropping the bare credits limit phrase loses nothing. Removing the WithErrorHandler wrapper fixes the hint ordering from my #77 review.
rahuldotiyer
added a commit
that referenced
this pull request
Nov 26, 2026
* Show how to get past credit, rate and billing limits When a command fails because of the account's plan, print where to see usage, upgrade the plan, or change the extra credits limit, leaving out links the API's message already gives. Amp-Thread-ID: https://ampcode.com/threads/T-01a21432-3ab4-74cb-a610-cc642f0dc0ab Co-authored-by: Amp <amp@ampcode.com> * Print the plan hint once, after the error, and match exact refusal phrases (#81) The hint printed between fang's error box and the plain error line, so it now prints after the last one. Unpaid invoices need a 402, so a query error naming a column such as unpaid_balance gets no hint, and the credit phrases are the exact wording of the MCP and query engine refusals, which also covers the trial message the old list missed. Amp-Thread-ID: https://ampcode.com/threads/T-01a21432-3ab4-74cb-a610-cc642f0dc0ab Co-authored-by: Amp <amp@ampcode.com> --------- Co-authored-by: Amp <amp@ampcode.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-ups to @norbertdurcansk's review of #77. They go through this PR because the repo's
defaultruleset refuses direct pushes to any existing branch, #77's included. It targets #77's branch, so merging it puts these changes into #77.root.goprints. TheWithErrorHandlerwrapper is gone.unpaid_balancegets no hint.credits limitis gone. The new list also matches the trial message ("used all its credits"), which the old list missed. REST refusals still match on their 402 status.New test cases: trial, team or organization limit, a 400 naming
unpaid_balance, and a SQL error quoting a column namedextra credits limit. All four fail against #77'splanhint.goand pass here.go test ./cmdutil/ ./cli/passes. Against a stub API that returns the REST 402,dune query runprints the error box, then the plain error, thenCredits used this billing period: dune usage. The two links are not repeated because the REST message already contains them.