From 2d9ae7e8b5660de32eeb12f74e845417e70a7e64 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Wed, 8 Jul 2026 04:35:10 +0000 Subject: 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 Claude-Session: https://claude.ai/code/session_01VTUSAEKfsPc6WGDq45yPHD --- internal/executor/container_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'internal/executor/container_test.go') 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", -- cgit v1.2.3