Rename CLAUDE_MAX_BUDGET_USD to BUDGET_CEILING, separate ceiling from default#305
Rename CLAUDE_MAX_BUDGET_USD to BUDGET_CEILING, separate ceiling from default#305
Conversation
… per-user default (#304)
Review by KaiPR Review: fix/budget-ceiling-renameOverall this is a clean, well-scoped rename with correct backward-compat logic. One notable bug in the install path. Warning:
|
Review by KaiPR Review: fix/budget-ceiling-renamePrior review issues[FIXED] install.py - env.pop("CLAUDE_MODEL", None)
env.pop("CLAUDE_MAX_BUDGET_USD", None)
env["BUDGET_CEILING"] = budget # outside the guard - correct
if not users_yaml_exists:
env["DEFAULT_MODEL"] = model
env["CLAUDE_TIMEOUT_SECONDS"] = timeoutThe critical bug is resolved. [FIXED] Deprecation warning message in The two suggestions (ceiling visibility in New findingsWarning: install.py - non-interactive path writes
budget = existing_env.get("BUDGET_CEILING", existing_env.get("CLAUDE_MAX_BUDGET_USD", ""))If an existing env["BUDGET_CEILING"] = budget # writes BUDGET_CEILING= (empty)
Everything else looks correct
Ready to merge once the minor install.py edge case is decided on. |
Summary
CLAUDE_MAX_BUDGET_USDtoBUDGET_CEILINGacross config, bot, pool, sessions, install, docs, and testsBUDGET_CEILINGenv var, whilemax_budgetin users.yaml is only a default/settingsoutput.envfiles with the old key name still work on upgradeDetails
Previously,
CLAUDE_MAX_BUDGET_USDdid double duty as both the global default budget and the ceiling. Per-usermax_budgetin users.yaml also conflated default and ceiling. When a user changed theirmax_budget, the displayed ceiling changed with it, defeating the purpose.Now the ceiling is always
config.budget_ceiling(the global env var). Per-usermax_budgetis only a baseline default. A user withmax_budget: 15in users.yaml can/settings budget 40if the global ceiling is $50.Backward compat:
BUDGET_CEILING>CLAUDE_MAX_BUDGET_USD>10.0.install.pyreads from either key on upgrade, writes the new key, and removes the old one.Test plan
Fixes #304