Repository navigation
Conversation
…pend ceiling (#152) Two review findings merged unresolved with #150. 1. `agent check` accepted a profile whose value is not a table. `parseFallbackProfile` returned null for a present-but-non-table profile, and `cmdCheck` iterated `listFallbackProfiles` (which skips exactly those keys), so a config that `agent fallback` cannot even find reported "config OK". Now a present value that is not a table throws a schema error naming the profile; a genuinely absent id still returns null. `cmdCheck` iterates every key under `[fallback_profile]` instead of the skipping helper, so the reported profile count reflects profiles actually validated. `agent fallback` on such an id already rejected it; the two paths now agree. Reproduced before the fix: [fallback_profile] / good = "this-should-be-a-table" agent check -> config OK (exit 0) agent fallback good -> agent: fallback profile not found: good (exit 2) 2. ADR-0018 overstated what a positive `max_spend` guarantees. For a positive budget, `max_spend` is a pre-execution admission check, not an enforced billing ceiling: the launcher never observes provider spend, cannot attribute cost after a candidate is handed to a harness, and cannot see a provider-side reprice. Only `global_max_spend = 0` is a hard stop (it admits only candidates that cannot bill at all). ADR-0018 and docs/agent-launcher.md now say this plainly and re-state that an account-side hard stop remains the only guaranteed ceiling. Tests: 745 pass. The non-table case is mutation-verified (reverting the guard fails the new test). All gates green.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 9 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This was referenced Nov 23, 2026
Owner
Author
|
Superseded by #235, which applies the still-needed parser/check fix and billing-wording correction to the current release branch without reviving the stale head. |
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.
Closes #152
Two review findings that #150 merged unresolved (neither opens a paid path for
the three committed
global_max_spend = 0profiles, so they were safe to defer;both are now fixed).
1.
agent checknow rejects a profile whose value is not a tableparseFallbackProfilereturnednullfor a present-but-non-table profile, andcmdCheckiterateslistFallbackProfiles— which deliberately skips exactlythose keys. Result: a config that
agent fallbackcannot even find reportedconfig OK.Reproduced before:
Now:
fallback_profile.good: table expected (the profile is defined but is not a table); a genuinely absent id still returnsnull.cmdCheckiterates every key under[fallback_profile]instead of theskipping helper, so the reported profile count reflects profiles actually
validated.
Existing malformed profiles (bad
primary_route, non-tablecandidatesentry,wrong-typed
expires_at) already failed validation and still do.2. ADR-0018 no longer overstates the spend ceiling
For a positive budget,
max_spendis a pre-execution admission check, notan enforced billing ceiling: the launcher never observes provider spend, cannot
attribute cost after a candidate is handed to a harness, and cannot see a
provider-side reprice or a model that becomes paid mid-run. Only
global_max_spend = 0is a hard stop, because it admits only candidates thatcannot bill at all.
ADR-0018 and
docs/agent-launcher.mdnow state this plainly, and re-state thatan account-side hard stop (a spend limit that rejects requests, or
pay-as-you-go off) remains the only guaranteed ceiling — consistent with the
existing
openrouter-freecaveat. No behavior change.Verification
bun test script/agent.*.test.ts script/agent/*.test.ts→ 745 pass, 17 skip, 0 failbun script/agent.ts check→12 providers, 5 harnesses, 26 routes, 4 fallback profilesbash evals/agent-router/controls.sh→controls OK: grader discriminates./script/test,./script/check,./script/check-secrets,./script/secrets-doctor,./script/test-workflow→ all passOut of scope
ModelScope / SenseNova / SiliconFlow recovery remains separate and blocked on
account-owner authentication
(
docs/research/blocked-provider-investigation-2026-11-13.md).