usage: say what to do when budget spend is unavailable - #483
Open
andy-xu-db wants to merge 1 commit into
Open
Conversation
`ucode usage` printed only "Budget spend and threshold are unavailable." when the gateway reported no coding-agent budget spend, which names what is missing but not the next step. Point the reader at configuring a coding agent budget policy in the same note. Co-authored-by: Isaac <no-reply@databricks.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.
What
ucode usageprints a single note when the gateway reports no coding-agent budget spend:That names what is missing but not the next step. It now reads:
Why
resolve_current_budget_spendreturns nothing whenrecommendModelreports noeffective_threshold— in practice, a workspace with no coding-agent budget policy attached (the endpoint also needs its per-org SAFE flag on). Configuring one, viaucode setup spend-tiers+ucode publish, is what makes the Usage Budget section appear, so the note now says so.Note the same note is also reached when the
recommendModelcall itself fails, where the added sentence is advice rather than a diagnosis; the reason string is discarded at the call site today, so distinguishing the two cases is left out of this change.Test
uv run pytest tests/test_usage.py— 90 passed; the assertion inTestUsageCommandthat pins this note is updated.uv run pytest— 2245 passed, 38 skipped. The twotests/test_e2e_user_agent.pyfailures are environmental (they launch the real agent CLIs against a capture server) and reproduce on unmodifiedmain.uv run ruff check .— clean.This pull request and its description were written by Isaac.