{{ message }}
Repository navigation
Add caching budget scenario to loop-context - #347
Merged
cobusgreyling merged 1 commit intoJul 22, 2026
Merged
Conversation
loop-cost's --with-caching flag (added in a prior PR) reports a discounted 'caching' scenario alongside noop/report/action/realistic, but loop-context's --budget-from-pattern had no way to resolve a budget from it. This adds 'caching' as a valid --budget-scenario, passes --with-caching through to loop-cost when it's selected, and gives a clearer error pointing at registry.yaml's stable_fraction when a pattern doesn't support it yet. Depends on the stable_fraction/--with-caching work in loop-cost.
cobusgreyling
pushed a commit
that referenced
this pull request
Jul 22, 2026
Record merges, escalate loop-cost/loop-context version+publish gap, rebased draft.
This was referenced Jul 22, 2026
cobusgreyling
added a commit
that referenced
this pull request
Jul 22, 2026
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.

Problem
loop-cost's
--with-cachingflag reports a discountedcachingscenario, but
loop-context --budget-from-pattern(which resolves atoken budget by shelling out to loop-cost) had no way to request it —
--budget-scenarioonly acceptedrealistic,action, orreport.Anyone using prompt caching had no way to set a circuit-breaker budget
that reflects their actual discounted spend.
Fix
'caching'as a valid--budget-scenariovalue.--with-cachingthrough to loop-cost automatically when thatscenario is selected.
stable_fractioninregistry.yaml) when a pattern doesn't support the caching scenarioyet, instead of a generic "missing tokensPerRun" error.
--helptext accordingly.No changes to the ledger/circuit-breaker logic itself — this is scoped
to budget resolution only.
Depends on: #346 (adds
stable_fractionand--with-cachingtoloop-cost) — should be merged first, or reviewed together.
Checklist