Repository navigation
fix: address review findings on billing, markup, and prompt fidelity - #15
Open
getdownandcode wants to merge 1 commit into
Open
getdownandcode wants to merge 1 commit into
getdownandcode wants to merge 1 commit into
Conversation
- free-tier: pass free_tier to commit telemetry so spend is not repriced at paid rates (bug 1) - ui: render preview, git output, and menus as literal text so [brackets] survive (bug 2) - prompt: label size-truncated and binary files by path in the prompt (bugs 3, 4) - config: honour ignore_globs in pr-summary and changelog extractors (bug 5) - cache: don't bill chunk summaries served from cache; track last_hit on CachedProvider (bug 6) - budget: check the monthly cap once per command via check_budget flag (bug 7) - fallback: say 'Token budgeting failed' instead of 'API unavailable' (bug 8)
Owner
Author
🤖 Automated PR Review: #15 - fix: address review findings on billing, markup, and prompt fidelity1. Summary of Changes
2. Analysis & Key Highlights
3. Actionable Suggestions & Concerns
4. Merge StatusVerdict: |
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.
Summary
Fixes all 8 findings from the code review (bugs 1\u20138), each with regression tests where meaningful.
High
1. Free-tier users billed at paid rates \u2014
commit_flownow passesfree_tier=cfg.free_tierto both telemetry calls (initial generation and regenerate), so rows are stored with the correct flag andget_invocationsno longer reprices them at paid rates. Free-tier usage can no longer tripbudget_cap_usd.2. Rich markup ate text in square brackets \u2014 commit preview panel, git stdout/stderr, and the a/e/r/c menus now render as literal text (
rich.text.Text/rich.markup.escape/\[…\]).fix(cli): handle list[str] input [skip ci]displays verbatim; git's[main 1a2b3c4] …line keeps the branch and hash; invalid input containing[/x]no longer crashes withMarkupError.Medium
3. Truncated files lost their filename \u2014 patches replaced by
[patch omitted for size: …]are now prefixed withFile <path> (<status>):in the prompt (new_prompt_diff_text,OMITTED_NOTE_PREFIX).4. Binary changes never reached the model \u2014 binary files are now included in the prompt as
Binary file <path> (<status>).5. pr-summary / changelog ignored
ignore_globs\u2014 both now passextra_ignores=cfg.ignore_globstoDiffExtractor, matching commit and debug-diff.6. Cached chunk summaries were billed \u2014
CachedProviderexposeslast_hit;summarize_omitted_diffsexcludes cache hits from billed tokens, and the orchestrator useslast_hit(instead of probing cache internals) to classify the main call. A fully cached rerun now costs $0.Low
7. Budget warning printed twice \u2014 new
check_budgetflag (defaultTrue) ongenerate_commit_message/run_generation_pipeline; callers that already rancheck_budget_cappasscheck_budget=False.8. Misleading fallback message \u2014 token-counting failures now print "Token budgeting failed, using template fallback" instead of "API unavailable".
Testing
uv run pytest -q) \u2014 includes new regressions: free-tier $0 spend, literal brackets end-to-end, prompt labels for truncated/binary files, cached-chunk $0 billing, single budget check, ignore_globs in pr-summaryruff check .andruff format .cleanmypy(strict) cleantest_generate_commit_message_fully_cached_rerun_costs_nothing)