Skip to content

✨ feat: plumb --model through to claude and codex executors - #23

Merged
bdougie merged 1 commit into
mainfrom
issue-20-model-passthrough
Jul 4, 2026
Merged

bdougie merged 1 commit into
mainfrom
issue-20-model-passthrough

Conversation

@bdougie

@bdougie bdougie commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Fixes #20

Problem

--model was silently ignored for the claude and codex providers — NewExec dropped provider.Config and the executors took no configuration. Only Ollama honored the flag, so sweeper run --provider claude --model haiku ran on the CLI's default model with no warning.

Changes

  • ClaudeConfig / CodexConfig in pkg/worker (matching the existing OllamaConfig idiom) with Model and ExtraArgs; executors append --model <x> and extra args to the spawned CLI when set, before the prompt
  • Providers forward provider.Config instead of dropping it; the agent's defensive claude fallback passes cfg.ProviderModel too
  • Result.Model is stamped on every attempt, so fix_attempt telemetry (and sweeper observe) can attribute outcomes per model

Verification

  • TDD: 7 new tests watched fail first, then pass — including a regression test in pkg/provider covering the exact silent-drop bug (TestCLIProvidersForwardModel)
  • End-to-end with fake CLIs on PATH logging their args:
    • --model claude-haiku-4-5 → claude --print --dangerously-skip-permissions --model claude-haiku-4-5 <prompt>
    • no --model → flag omitted (default behavior unchanged)
    • with paper installed → paper start claude -- --print ... --model fable-5 <prompt> (survives the gateway path)
    • --provider codex --model o4-mini → codex --quiet --approval-mode full-auto --model o4-mini <prompt>
    • telemetry jsonl records "model":"claude-haiku-4-5" / "fable-5" / "o4-mini" per attempt
  • Full test suite green

Out of scope (noted on #20)

  • The VM executor (pkg/worker/vm.go) still hardcodes claude --print — --vm runs ignore --model
  • ExtraArgs is threaded through executors but nothing populates it from TOML/CLI yet

--model was silently dropped by the claude and codex providers:
NewClaudeExecutor/NewCodexExecutor took no config, so only Ollama
honored the flag.

- Add ClaudeConfig/CodexConfig (matching the OllamaConfig idiom) with
  Model and ExtraArgs, appended to the spawned CLI args when set
- Forward provider.Config through both providers' NewExec
- Stamp the resolved model in worker.Result so fix_attempt telemetry
  attributes outcomes per model
- Regression test in pkg/provider covering the exact silent-drop bug

Fixes #20
@bdougie
bdougie merged commit 8ff85e3 into main Jul 4, 2026
6 checks passed
@bdougie
bdougie deleted the issue-20-model-passthrough branch July 4, 2026 17:03
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.

Plumb --model through to claude and codex executors

1 participant