Skip to content

Split Claude code model into separate initial/review models and efforts - #228

Merged
charneykaye merged 5 commits into
mainfrom
copilot/split-claude-model-selection-params
Jul 8, 2026
Merged

Split Claude code model into separate initial/review models and efforts#228
charneykaye merged 5 commits into
mainfrom
copilot/split-claude-model-selection-params

Conversation

Copilot AI commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Replaces the single claude_code_model config with distinct models and reasoning efforts for implementation and review phases, enabling independent tuning of each phase.

What changed

Config (env-config.ts):

  • Removed claude_code_model
  • Added claude_code_initial_model (default claude-sonnet-4-6) and claude_code_review_model (default claude-opus-4-8)
  • Added claude_code_initial_effort and claude_code_review_effort (both default high)
  • All four resolve with project → global → default precedence in applyProjectDefaults
  • Legacy configs now throw with clear migration instructions

Agent wiring (claude-agent.ts):

  • implementIssue and follow-up flows (conflict resolution, failing-check fixes, push-conflict resolution) use the initial model + effort
  • selfReview uses the review model + effort
  • Commit-message generation is unchanged
  • runClaude now accepts an effortOverride parameter and passes --effort <value> to the CLI

Orchestration (index.ts):

  • Dashboard model field now reports the review model for self-review actions and the initial model for others
  • Config plumbing updated to pass both model and effort pairs to the agent

Documentation:

  • Updated env.example.yaml and README env table with new config keys
  • Clarified phase-specific purposes in field descriptions

Why

This split allows for phase-specific optimization:

  • Implementation can prioritize speed and iteration (Sonnet)
  • Review can prioritize rigor and thoroughness (Opus)
  • Each phase can have independently tuned reasoning effort

Testing

  • Config validation tests verify that legacy claude_code_model in global and project contexts throws with clear messages
  • Config resolution tests verify fallback behavior: review model falls back to initial model, and review effort falls back to initial effort
  • Agent tests verify that initial/review models and efforts are correctly passed to the CLI

Closes #227

Copilot AI changed the title [WIP] Refactor Claude model selection parameters into initial and review models Split Claude code model into separate initial/review models and efforts Jul 8, 2026
Copilot AI requested a review from charneykaye July 8, 2026 01:53
@charneykaye
charneykaye requested a review from Copilot July 8, 2026 02:11

Copilot AI 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.

Pull request overview

This PR splits the single Claude “code model” configuration into distinct initial implementation vs review models and reasoning efforts, and wires those through the agent client and orchestration so each phase can be tuned independently.

Changes:

  • Replace claude_code_model with claude_code_initial_model / claude_code_review_model and add claude_code_initial_effort / claude_code_review_effort, including precedence/default behavior.
  • Update Claude agent wiring so implementation flows use the initial model/effort and selfReview uses the review model/effort; add --effort <value> handling.
  • Update orchestration dashboard reporting and docs/examples; add tests to validate wiring and config defaults.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/env-config.test.ts Updates config tests for new initial/review model+effort keys and precedence.
test/claude-agent.test.ts Adds tests asserting --model/--effort are passed correctly for implementation vs self-review.
src/index.ts Splits per-project config fields and updates dashboard “model” reporting by action type.
src/env-config.ts Replaces claude_code_model with initial/review model+effort fields in config resolution defaults.
src/claude-agent.ts Adds initial/review model+effort options and passes --effort to the Claude CLI.
README.md Updates environment-variable documentation row to mention new config keys.
env.example.yaml Updates example config to the new initial/review model+effort keys.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/env-config.ts
Comment on lines +145 to +152
claude_code_initial_model:
projectConfig.claude_code_initial_model ??
globalConfig.claude_code_initial_model ??
"claude-sonnet-4-6",
claude_code_review_model:
projectConfig.claude_code_review_model ??
globalConfig.claude_code_review_model ??
"claude-opus-4-8",
Comment thread src/claude-agent.ts Outdated
Comment thread README.md Outdated
| `MAX_CONCURRENCY` | `3` | Maximum active work items across open PRs and in-flight implementations. |
| `CYCLE_MINIMUM_SECONDS` | `60` | Minimum seconds between engine cycle starts. |
| `CLAUDE_MODEL` | *(Claude default)* | Claude model for implementation and review (e.g. `claude-sonnet-4-6`). |
| `CLAUDE_MODEL` | *(Claude default)* | Claude model for implementation and review (e.g. `claude-sonnet-4-6`). Split in `env.yaml` into `claude_code_initial_model` (default `claude-sonnet-4-6`) and `claude_code_review_model` (default `claude-opus-4-8`), with `claude_code_initial_effort` and `claude_code_review_effort` (both default `high`). |
charneykaye and others added 3 commits July 7, 2026 19:51
…ration

Existing env.yaml files that still contain `claude_code_model` (global or
per-project) would otherwise be silently ignored and fall back to the new
defaults, making misconfiguration hard to diagnose. Throwing a targeted error
with a migration message makes the breakage visible immediately.

Adds tests for both the global and per-project error paths.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eviewModel does

claudeReviewModel already falls back to claudeInitialModel when unset, but
claudeReviewEffort did not fall back to claudeInitialEffort, making the
options API inconsistent and causing selfReview() to omit --effort even when
an initial effort was set programmatically.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eading CLAUDE_MODEL row

CLAUDE_MODEL is not an environment variable read by Vibrator — models and
efforts are sourced exclusively from env.yaml. Keeping it in the env vars
table implied it was a real knob, misleading users who might set it and see
no effect. Removed the row and added a dedicated env.yaml model configuration
table below the env vars section.

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

Copy link
Copy Markdown
Contributor

Reviewed code and pushed fixes.

I read and addressed the comment from @copilot (#228 (comment)): Added explicit checks in loadEnvConfig() (src/env-config.ts) that throw a targeted error when claude_code_model is found at either the global or per-project level, with a message telling users exactly which keys to use instead. Two tests covering both paths were added to test/env-config.test.ts (commit 43d309e).
I read and addressed the comment from @copilot-pull-request-reviewer[bot] (#228 (review)): This was an automated Copilot PR-overview comment summarizing the changes; it required no code action.
I read and addressed the comment from @copilot (#228 (comment)): Fixed the inconsistency in src/claude-agent.ts (constructor, line 1405): claudeReviewEffort now falls back to options.claudeInitialEffort with ?? options.claudeInitialEffort, mirroring the existing claudeReviewModel ?? claudeInitialModel pattern (commit 630f9b2).
I read and addressed the comment from @copilot (#228 (comment)): Removed the CLAUDE_MODEL row from the env vars table in README.md (it is not an env var read by the codebase) and added a dedicated env.yaml model configuration table documenting claude_code_initial_model, claude_code_review_model, claude_code_initial_effort, and claude_code_review_effort with their defaults (commit 42ff70d).

@charneykaye

Copy link
Copy Markdown
Contributor

Reviewed code, no issues found.

I read and addressed the comment from @copilot-pull-request-reviewer[bot] (#228 (review)): The Copilot bot comment is an informational overview confirming all 7 files were reviewed; it raised 3 inline comments (not included in the review payload) but the overview itself requests no specific changes. All 378 tests pass, all issue #227 requirements are implemented correctly, and no code changes were needed.

@charneykaye

Copy link
Copy Markdown
Contributor

Reviewed code, no issues found.

I read and addressed the comment from @copilot-pull-request-reviewer[bot] (#228 (review)): The Copilot bot provided an overview summary noting it reviewed all 7 files and generated 3 inline comments (not visible here), but raised no specific concerns in the summary text. All tests pass (378/378), the implementation fully satisfies issue #227 requirements, and no action was required in response to this comment.

@charneykaye
charneykaye marked this pull request as ready for review July 8, 2026 03:12
@charneykaye
charneykaye merged commit 4997d9e into main Jul 8, 2026
4 checks passed
@charneykaye
charneykaye deleted the copilot/split-claude-model-selection-params branch July 8, 2026 03:12
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.

Split the Claude model selection env param into separate Initial and Review code models

3 participants