summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-07-08 04:35:10 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-07-08 04:35:10 +0000
commit2d9ae7e8b5660de32eeb12f74e845417e70a7e64 (patch)
tree9fbd8ff483112c2e21d1191b7dbf6e0fd0cbc7d8 /internal
parentfcf1821a62f151043df524deb111cadc4126e877 (diff)
fix(executor): pass --model to the claude CLI in ContainerRunner
buildInnerCmd never read t.Agent.Model when constructing the container's claude -p invocation -- every Claude-type task silently ran on the CLI's own default model regardless of what was requested via submit_task or the role-based escalation ladder. Confirmed via execution logs: every task run this session showed claude-sonnet-4-6 regardless of the model parameter passed, which only went unnoticed because sonnet was requested every time. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VTUSAEKfsPc6WGDq45yPHD
Diffstat (limited to 'internal')
-rw-r--r--internal/executor/container.go3
-rw-r--r--internal/executor/container_test.go16
2 files changed, 19 insertions, 0 deletions
diff --git a/internal/executor/container.go b/internal/executor/container.go
index 6179ffc..e64adc4 100644
--- a/internal/executor/container.go
+++ b/internal/executor/container.go
@@ -564,6 +564,9 @@ func (r *ContainerRunner) buildInnerCmd(t *task.Task, e *storage.Execution, isRe
if mcpEnabled {
claudeCmd.WriteString(" --mcp-config " + mcpConfigContainerPath)
}
+ if t.Agent.Model != "" {
+ claudeCmd.WriteString(" --model " + t.Agent.Model)
+ }
claudeCmd.WriteString(" --output-format stream-json --verbose --permission-mode bypassPermissions")
return []string{"sh", "-c", claudeCmd.String()}
diff --git a/internal/executor/container_test.go b/internal/executor/container_test.go
index 6261cd8..6672dea 100644
--- a/internal/executor/container_test.go
+++ b/internal/executor/container_test.go
@@ -194,6 +194,22 @@ func TestContainerRunner_BuildInnerCmd(t *testing.T) {
}
})
+ t.Run("claude-model-set", func(t *testing.T) {
+ tk := &task.Task{Agent: task.AgentConfig{Type: "claude", Model: "opus"}}
+ cmdStr := strings.Join(runner.buildInnerCmd(tk, &storage.Execution{}, false, false), " ")
+ if !strings.Contains(cmdStr, "--model opus") {
+ t.Errorf("expected --model opus flag when Agent.Model is set, got %q", cmdStr)
+ }
+ })
+
+ t.Run("claude-model-empty", func(t *testing.T) {
+ tk := &task.Task{Agent: task.AgentConfig{Type: "claude"}}
+ cmdStr := strings.Join(runner.buildInnerCmd(tk, &storage.Execution{}, false, false), " ")
+ if strings.Contains(cmdStr, "--model") {
+ t.Errorf("did not expect --model flag when Agent.Model is empty, got %q", cmdStr)
+ }
+ })
+
t.Run("custom-binaries", func(t *testing.T) {
runnerCustom := &ContainerRunner{
ClaudeBinary: "/usr/bin/claude-v2",