You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up to #246. kai-server's default tier is auto, and the CLI receives KAI_REVIEW_TIER=auto, which #246 left off. So default customers did not get the refill. It is now on for auto.
KAI_REVIEW_TIER
Refill
standard
on
deep
on
auto
on (new)
light, free, baseline, unset
off
KAI_REVIEW_REFILL=0 still turns it off in every tier; =1 still forces it on.
Why auto can simply be on
The CLI gets only the literal auto, not the tier it resolves to. But kai-server's reviewAuto rule (v1) runs standard@1 for a change rated S or M and deep@1 for the rest, so auto only lands on a depth that already has the refill. There is nothing finer for the CLI to key on, and both outcomes are on.
One edge: the server's emergency switch can move an Auto review's sets down to a lighter set. The CLI cannot see that, so such a review would still get the refill.
Tests
Added auto (and AUTO) cases to the existing tier table, a kill-switch case for auto, the 2-vote cap-cut case under auto, and auto in the "never publish nothing" fallback test. Run with GOWORK=off (a parent go.work interferes in my worktree). TestReviewWithNoNewSettingsMatchesMain fails on main as well, unrelated to this change.
Not merged, tagged or deployed by the author. Needs review from Adam or Varsha. To reach reviews it still needs a release tag, a kai-ci rebuild and a bump of kai-server's defaultReviewImage digest.
Written by Kai from the change itself. Kai only edits this section; everything above it is the author's.
The review refill is now on for KAI_REVIEW_TIER=auto, which is the tier kai-server sends by default. #246 left it off, so default customers did not get the refill.
Changes
rcRefillOn in cmd/kai/review_commit_publish.go: the tier switch now returns true for auto as well as standard and deep. Tier matching stays case-insensitive and trimmed.
The doc comment on rcRefillOn now says why auto is on. Auto runs Standard for a change rated S or M and Deep for the rest, so it only lands on a depth that already has the refill.
light, free, baseline and unset stay off. KAI_REVIEW_REFILL=0 still disables the refill in every tier, and =1 still forces it on.
Testing
TestRefillGivesGateFreedSlotsToWhatTheCapCut: the auto case now expects {1, 4, 5, 6} instead of {1, 4}. New cases cover auto with KAI_REVIEW_REFILL=0 ({1, 4}) and AUTO ({1, 4, 5, 6}).
TestRefillPublishesTwoVoteDefectTheCapCut: new auto cases for refill on ({1, 5}) and for the kill switch ({1}).
TestPublishGateFallbackHoldsWithRefillOn: auto is added to the tier list.
The author ran the tests with GOWORK=off and reports that TestReviewWithNoNewSettingsMatchesMain also fails on main, unrelated to this change.
The reason will be displayed to describe this comment to others. Learn more.
Kai review · Ready to merge (9/10)
Read the whole thing — it does what it says, and nothing jumped out at me.
Next: merge when your checks are green — I found nothing to fix.
To get to 10/10
−1 · tidy 1 nit (folded below)
1 nit · real, but none of them changes what the code does
cmd/kai/review_commit_publish_test.go:159 — The table comment in TestRefillGivesGateFreedSlotsToWhatTheCapCut says the refill is on for standard and deep and off for values naming no depth, but the table now expects auto (and AUTO) to be on.
Important files changed
File
Change
cmd/kai/review_commit_publish.go
modified · +7 −5
cmd/kai/review_commit_publish_test.go
modified · +6 −2
How I reviewed it — 4 files, 6 turns, 18s
0 confirmed findings. Intent verified.
What I opened
cmd/kai/review_commit_fakemodels_test.go
cmd/kai/review_commit_publish.go
cmd/kai/review_commit_publish_test.go
cmd/kai/review_commit_run.go
Full read-through
Scope
cmd/kai/review_commit_publish.go: rcRefillOn and its only caller rcPublishGate (env overrides, tier switch, fallback skip)
cmd/kai/review_commit_publish_test.go: the three modified tests and their comments (tier table, two-vote cap-cut table, fallback loop)
KAI_REVIEW_TIER / KAI_REVIEW_REFILL usage in cmd/kai as listed in the pre-resolved searches
Findings
nit: cmd/kai/review_commit_publish_test.go:159 — The table comment in TestRefillGivesGateFreedSlotsToWhatTheCapCut says the refill is on for standard and deep and off for values naming no depth, but the table now expects auto (and AUTO) to be on.
The comment above the table in TestRefillGivesGateFreedSlotsToWhatTheCapCut (cmd/kai/review_commit_publish_test.go, around line 159) still lists only standard and deep as refill-on. The table beneath it now includes auto and AUTO cases that expect the refill on, so the comment contradicts the cases it documents.
Remedy: Reword the comment to include auto, e.g. "on for standard, deep and auto; off for light and other values", matching the rcRefillOn doc comment.
Size S · Risk S · +13 −7 · 2 files · reaches 85 · the full analysis · Reply to any of my comments and I'll answer, or say @kaicontext anywhere on this PR — a question, or "take another look at the retry logic". · Some repos review new pushes only when asked. Comment @kaicontext review any time for a review right away.
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
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.
What
Follow-up to #246. kai-server's default tier is
auto, and the CLI receivesKAI_REVIEW_TIER=auto, which #246 left off. So default customers did not get the refill. It is now on forauto.KAI_REVIEW_TIERstandarddeepautolight,free,baseline, unsetKAI_REVIEW_REFILL=0still turns it off in every tier;=1still forces it on.Why
autocan simply be onThe CLI gets only the literal
auto, not the tier it resolves to. But kai-server'sreviewAutorule (v1) runsstandard@1for a change rated S or M anddeep@1for the rest, soautoonly lands on a depth that already has the refill. There is nothing finer for the CLI to key on, and both outcomes are on.One edge: the server's emergency switch can move an Auto review's sets down to a lighter set. The CLI cannot see that, so such a review would still get the refill.
Tests
Added
auto(andAUTO) cases to the existing tier table, a kill-switch case forauto, the 2-vote cap-cut case underauto, andautoin the "never publish nothing" fallback test. Run withGOWORK=off(a parent go.work interferes in my worktree).TestReviewWithNoNewSettingsMatchesMainfails on main as well, unrelated to this change.Not merged, tagged or deployed by the author. Needs review from Adam or Varsha. To reach reviews it still needs a release tag, a kai-ci rebuild and a bump of kai-server's
defaultReviewImagedigest.🤖 Generated with Claude Code
Kai context
Written by Kai from the change itself. Kai only edits this section; everything above it is the author's.
The review refill is now on for
KAI_REVIEW_TIER=auto, which is the tier kai-server sends by default. #246 left it off, so default customers did not get the refill.Changes
rcRefillOnincmd/kai/review_commit_publish.go: the tier switch now returns true forautoas well asstandardanddeep. Tier matching stays case-insensitive and trimmed.rcRefillOnnow says whyautois on. Auto runs Standard for a change rated S or M and Deep for the rest, so it only lands on a depth that already has the refill.light,free,baselineand unset stay off.KAI_REVIEW_REFILL=0still disables the refill in every tier, and=1still forces it on.Testing
TestRefillGivesGateFreedSlotsToWhatTheCapCut: theautocase now expects{1, 4, 5, 6}instead of{1, 4}. New cases coverautowithKAI_REVIEW_REFILL=0({1, 4}) andAUTO({1, 4, 5, 6}).TestRefillPublishesTwoVoteDefectTheCapCut: newautocases for refill on ({1, 5}) and for the kill switch ({1}).TestPublishGateFallbackHoldsWithRefillOn:autois added to the tier list.GOWORK=offand reports thatTestReviewWithNoNewSettingsMatchesMainalso fails on main, unrelated to this change.