fix: honor quiet mode when setting budgets - #191
Conversation
|
Nice, focused fix — and thanks for including the reproduction steps up front. Confirmed everything independently on both commits; all green. What I reproducedReal CLI ( Base ( Head ( The saved config is byte-identical between base and head, and identical between the quiet and non-quiet runs ( I also probed the neighbouring paths for regressions: no-thresholds, Tests — red/green confirmed
ScopeTight — no scope creep. CIAll four legs of the matrix green: One optional follow-up (not blocking, not for this PR)
Merging this as a squash. Nice first contribution — the bug report, the changelog entry, and a parametrized test that covers both flag spellings and both the single- and multi-threshold cases is exactly the shape I'd want to see. |
Description
agentcost budget set --daily 5 --quietstill printsDaily: $5.00, even though the flag promises exit-code-only output. Move the daily, weekly, and monthly messages into the existing quiet guard so successful quiet invocations produce no console output.The regression test covers daily-only and combined thresholds with both
--quietand-q. It also checks normal output, successful exit codes, and identical saved configuration bytes. Add the user-visible fix to the unreleased changelog.Related issue
Fixes #188
Type of change
Testing
Windows, Python 3.13.5:
python -m pytest tests/test_quiet_mode.py -k budget_set_quiet -q: 4 failed, all on the unexpected quiet output.python -m pytest tests/ -v --cov=agentcost --cov-report=term-missingwithCOLUMNS=200as documented in CONTRIBUTING.md: 220 passed, overall coverage 73%.git diff --check: passed.The repository's Linux/Python 3.10–3.13 CI matrix passed all four jobs for commit
ef9fd83985999cce611e7a96687c4919e1e2e75d.Checklist
Notes
Prepared with Codex assistance; the reproduction and test results above were executed locally.