Skip to content

fix(config): run the Claude CLI small tier on Sonnet, not Haiku - #558

Closed
piekstra wants to merge 1 commit into
mainfrom
piekstra/small-tier-sonnet
Closed

fix(config): run the Claude CLI small tier on Sonnet, not Haiku#558
piekstra wants to merge 1 commit into
mainfrom
piekstra/small-tier-sonnet

Conversation

@piekstra

@piekstra piekstra commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #557, which I got half right.

#557 mapped small for claude_cli so that an agent declaring model_tier: small would stop aborting the entire review at plan time. That part was correct. Pointing it at claude-haiku-4-5 was not: Haiku is not a model a code review should rest on, and the small tier exists so an agent can say this job is narrow, not grade this with the weakest model available.

Change

small now resolves to claude-sonnet-5 — the same model medium resolves to.

That equality is deliberate, and the README now says so rather than leaving a reader to wonder whether it is a typo: a tier is what an agent asks for, and the built-in is what this CLI is willing to run a review on. Nothing obliges the two smallest tiers to differ when the cheaper model is not one worth running. An operator who genuinely wants a smaller model for small names it in llm.model_map, which is where a cost-versus-quality judgment belongs — and it was already the workaround in use before #557 landed.

Anything is still overridable, and anthropic_api / pi_rpc keep empty built-in maps, so the unmapped-tier error (which #557 taught to name the entry that fixes it) stays reachable.

Not changed

internal/cmd/initcmd/initcmd_test.go has fixtures pairing claude-haiku-4 with claude-sonnet-4-6 as operator-supplied overrides. Those assert that an arbitrary configured value round-trips; they are not this CLI selecting a model, so I left them rather than churn another test's data. internal/pricing still prices claude-haiku-4-5, correctly — a user can still map it deliberately.

Verification

make lint clean. go test ./... -count=1 passes except TestPiRPCReviewerExtensionLoadsInInstalledPi, which fails identically on main in this environment (the locally installed pi rejects --no-builtin-tools / --no-approve).

Note the -count=1: make test alone serves cached package results, which is exactly how a pinned expectation in internal/view reached CI on #557 instead of being caught locally. Every assertion of the built-in small model is updated here — internal/config, internal/stagemodel, internal/cmd/configcmd, internal/cmd/initcmd, internal/view, and the README table.

#557 mapped small to claude-haiku-4-5 to stop an agent's small tier from
aborting the whole review. That fixed the abort and picked the wrong model:
Haiku is not one a code review should rest on, and the tier existed so an
agent could say "this job is narrow", not "grade this with the weakest
model available".

Map small to claude-sonnet-5, the same model medium resolves to. A tier is
what an agent asks for and the built-in is what this CLI is willing to run a
review on; nothing obliges the two smallest tiers to differ when the cheaper
model is not one worth running. An operator who does want a smaller model
for small still names it in llm.model_map, which is where a cost-quality
judgment belongs.
@piekstra

piekstra commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Closing — this imposes one org's model preference on everyone else's CLI.

small mapping to Haiku is a legitimate default for a general-purpose tool: it is the tier an agent picks when it wants the cheap model, and a user who wants that should get it. My objection was really "our reviewers must not run on Haiku", which is a consumer decision and belongs in our llm.model_map, not in the built-in every other user inherits.

#557 (the mapping existing at all, so a small-tier agent stops aborting the run) stands and is the part that was actually a bug.

@piekstra piekstra closed this Aug 7, 2026
@piekstra
piekstra deleted the piekstra/small-tier-sonnet branch August 7, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant