Skip to content

Add per-task model selection for executor#395

Open
bborn wants to merge 2 commits intomainfrom
task/1037-select-executor-model
Open

Add per-task model selection for executor#395
bborn wants to merge 2 commits intomainfrom
task/1037-select-executor-model

Conversation

@bborn
Copy link
Owner

@bborn bborn commented Feb 5, 2026

Summary

  • Tasks can now have a model override (e.g., opus, sonnet, haiku) that gets passed via --model flag to the Claude CLI
  • Adds a Model selector to the task creation/edit form (only shown for executors that support multiple models — currently Claude)
  • Adds executor and model parameters to the MCP taskyou_create_task tool so agents can specify model when creating tasks

How it works

  • New model column in the tasks database (empty string = use executor's default model)
  • When a task has a model set, --model <value> is passed to the Claude CLI in all execution paths: initial run, resume, dangerous mode toggle, safe mode toggle, and interactive BuildCommand
  • The form UI shows a model selector (default / opus / sonnet / haiku) when the Claude executor is selected. Other executors show no model picker since they don't support --model
  • Model selection cycles with left/right arrows and supports type-to-select by first letter

Test plan

  • All existing tests pass (go test ./...)
  • Create a task with model set to "opus" — verify --model opus appears in the tmux command
  • Create a task with no model selected — verify no --model flag is added
  • Switch executor from Claude to Codex — verify model picker disappears
  • Edit an existing task — verify model persists correctly
  • Create a task via MCP tool with model parameter — verify it's stored and used

🤖 Generated with Claude Code

bborn and others added 2 commits February 5, 2026 15:44
Tasks can now have a model override (e.g., "opus", "sonnet", "haiku")
that gets passed via --model flag to the Claude CLI. This allows
choosing different models per task based on complexity/cost needs.

Changes:
- Add `model` column to tasks table with DB migration
- Pass --model flag to Claude CLI in all execution paths (run, resume,
  dangerous/safe mode toggle, BuildCommand)
- Add Model selector to the task form UI (only shown for executors
  that support models, currently Claude)
- Add model parameter to MCP taskyou_create_task tool
- Log model info alongside executor in task execution output

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Previously --model flag was only wired up for Claude. Now Codex and
Gemini executors also pass the per-task model to their CLIs in all
execution paths (runCodex/runGemini, BuildCommand, resumeWithMode).
Updated modelsForExecutor() with appropriate model choices for each.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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