Skip to content

feat(code-review): add --model flag to override agent model selection#31699

Open
kpatel513 wants to merge 1 commit intoanthropics:mainfrom
kpatel513:feat/kp-model-flag
Open

feat(code-review): add --model flag to override agent model selection#31699
kpatel513 wants to merge 1 commit intoanthropics:mainfrom
kpatel513:feat/kp-model-flag

Conversation

@kpatel513
Copy link
Copy Markdown

Summary

The plugin uses different models per step (Haiku for lightweight tasks, Sonnet for compliance, Opus for bug detection). Users with different cost/quality preferences have no way to override this. This adds a --model flag that overrides all agents to use the specified model.

Usage

# Use Sonnet for all agents (cost-conscious, still high quality)
/code-review --model sonnet

# Use Opus for all agents (maximum thoroughness)
/code-review --model opus --comment

# Default behavior unchanged (per-step model selection)
/code-review

Changes

plugins/code-review/commands/code-review.md

  • Add --model argument handling before step 1: if provided, overrides all per-step model defaults; if invalid, stops with a clear error

plugins/code-review/README.md

  • Document --model flag in Options section with valid values and default behavior

Design decisions

  • All-or-nothing override: --model applies to every agent uniformly. Per-agent overrides (e.g. --bug-model) would add complexity with limited benefit.
  • Invalid value → hard stop: Silently falling back to defaults on a typo would be confusing. Explicit error is better.
  • All three values allowed: Users choosing haiku for everything accept the quality tradeoff. Not our call to block it.

Test plan

  • /code-review --model sonnet — all agents use Sonnet
  • /code-review --model opus — all agents use Opus
  • /code-review --model invalid — stops with "unknown model — valid values are haiku, sonnet, opus"
  • /code-review (no flag) — per-step model selection unchanged

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