fix: help text — cached hits echo the original run's bill, not 0 - #178
Closed
yuanwen-tian wants to merge 1 commit into
Closed
fix: help text — cached hits echo the original run's bill, not 0#178yuanwen-tian wants to merge 1 commit into
yuanwen-tian wants to merge 1 commit into
Conversation
The published result-shape contract said `credits` is "credits billed (0 on a cached hit)", but the actual (and intended) behavior on a cached hit is to echo the original run's bill alongside cached=true: the human summary prints the same value, and history denormalizes it per item. Fix the help text for both parse and extract, regenerate docs/reference/help.json, and pin the cached-hit `credits` value with offline tests for both verbs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the published result contract to match cached billing behavior.
Changes:
- Clarifies cached
creditssemantics for parse and extract. - Regenerates the help reference snapshot.
- Adds regression tests for cached billing values.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/ade_cli/help.py |
Corrects result-field documentation. |
docs/reference/help.json |
Updates the generated help snapshot. |
tests/test_parse.py |
Tests cached parse credits. |
tests/test_extract.py |
Tests cached extract credits. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
The published result-shape contract (
ade help results parse/extract, and the committed snapshotdocs/reference/help.json) said thecreditskey is "credits billed (0 on a cached hit)". The actual behavior — verified live against production — is that a cached hit echoes the original run's bill alongsidecached: true.The behavior is the intended side of the contract, so this fixes the docs rather than the code:
credits: N (tier)line on cached hits from the samebillingdict — zeroing only the JSON payload would make the two outputs of one invocation contradict each other.historydenormalizes the same original-bill value intometa.jsonper item.cached: trueis already the free-serve marker a scripter gates on; echoing the bill is strictly more informative, and changing it would silently break the shipped payload contract.Changes
src/ade_cli/help.py: bothcreditsdescriptions (parse + extract) now read "credits the run billed (a cached hit echoes the original run's bill; nothing new is billed — see cached)".docs/reference/help.json: regenerated viascripts/update_help_reference.py.total_credits=1.1so a zeroing regression can't slip through:test_cached_hit_echoes_the_original_bill(parse) andtest_cached_extract_echoes_the_original_bill(extract).Testing
uv run pytest -q— 697 passeduvx ruff check src tests/uvx ty check src— clean🤖 Generated with Claude Code