Skip to content

review: refill also on for the auto tier - #247

Merged
jschatz1 merged 1 commit into
mainfrom
claude/refill-auto-tier
Nov 16, 2026
Merged

jschatz1 merged 1 commit into
mainfrom
claude/refill-auto-tier

Conversation

@jschatz1

@jschatz1 jschatz1 commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

What

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.

🤖 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

  • 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.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@kaicontext kaicontext Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewView in KaiKai 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.

@jschatz1
jschatz1 merged commit ad6c692 into main Nov 16, 2026
7 checks passed
@jschatz1
jschatz1 deleted the claude/refill-auto-tier branch November 16, 2026 08:18
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