Repository navigation
Description
Follow-up to #149 / PR #150 (merged as 90eacfa). Two review findings were merged
unresolved because neither opens a paid path for the three committed
global_max_spend = 0 profiles; both are correctness gaps worth closing.
1. agent check does not validate a profile whose value is not a table
listFallbackProfiles enumerates every key under [fallback_profile], but
parseFallbackProfile returns null when the value is not an object, and
cmdCheck only validates profiles it can count. A non-table profile is
therefore counted as valid and never inspected.
Reproduction (confirmed on main):
[fallback_profile]
good = "this-should-be-a-table"$ AGENT_CONFIG=non_table.toml agent check
config OK: ... (1 providers, 1 harnesses, 1 routes, 1 fallback profiles) # exit 0
$ AGENT_CONFIG=non_table.toml agent fallback good
agent: fallback profile not found: good # exit 2
agent check says OK for a profile that agent fallback cannot even find.
A malformed profile (bad primary_route, non-table candidates entry, etc.)
must fail validation here, not be silently ignored.
Acceptance
agent checkexits non-zero and names the profile when its value is not a
table, with a message distinguishing "profile is not a table" from
"profile not found".- A present profile that is a table but fails
parseFallbackProfilecontinues
to fail validation (already covered). - Tests cover: non-table profile value, non-array
candidates, non-table
candidate entry, and a valid config still passing. agent check's reported profile count reflects profiles that were actually
validated, not merely present keys.
2. ADR-0018 overstates what a positive max_spend guarantees
ADR-0018 (and docs/agent-launcher.md) describe max_spend / the budget as
bounding spend. In practice, for a positive budget, max_spend is a
pre-execution admission estimate, not an enforced billing ceiling:
- the launcher never observes actual provider spend;
- it cannot attribute cost after a candidate is handed to a harness;
- provider-side price changes or a model repriced mid-run are invisible.
The global_max_spend = 0 rule IS a real stop (only non-billable candidates
are admitted). The positive-budget case is not.
Acceptance
- ADR-0018 and
docs/agent-launcher.mdstate plainly that a positive
max_spend/budget is an admission-time check, does not bound actual spend,
and that an account-side hard stop (spend limit, or pay-as-you-go off) remains
the only guaranteed ceiling. global_max_spend = 0keeps its current, stronger meaning and is described
as the only value that is a hard stop.- No behavior change required.
Out of scope
ModelScope / SenseNova / SiliconFlow recovery stays separate and blocked on
account-owner authentication (see
docs/research/blocked-provider-investigation-2026-11-13.md).
Activity
Merge pull request #235 from rebuildup/152-fallback-check
rebuildup commentedon Nov 23, 2026
Fixed on release/rex-remote by #235 (merge commit pending verification below). parseFallbackProfile/listFallbackProfiles now reject present non-table fallback_profile entries, agent check fails closed on malformed config, and ADR-0018/agent-launcher wording now states declared spend caps are admission ceilings rather than measured spend guarantees. Supersedes stale PR #153.