feat(worker): let Claude set the cheapest model per generated task via MCP
AddTask, planning CreateChildTask, and SuggestImprovement now accept an optional alias-validated model (haiku/sonnet/opus; blank = inherit) so the model is chosen at creation time instead of a follow-up set_task_config call. The planning, system, and improvement prompts instruct Claude to pick the cheapest capable model (haiku < sonnet < opus). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -82,7 +82,10 @@ public static class PromptFiles
|
||||
## Out-of-scope improvements
|
||||
If you notice worthwhile work that is genuinely outside this task's scope
|
||||
(a refactor, a follow-up, tech debt), do NOT do it here. File it with
|
||||
SuggestImprovement(title, description) and stay focused on the task at hand.
|
||||
SuggestImprovement(title, description, model) and stay focused on the task at hand.
|
||||
Set `model` to the cheapest model that can do the follow-up well — 'haiku' for
|
||||
trivial/mechanical work, 'sonnet' for normal coding, 'opus' only for genuinely
|
||||
complex work (cheapest to most capable: haiku < sonnet < opus).
|
||||
|
||||
## Working in the repo
|
||||
- Read a file before editing it. Match the conventions already in this codebase —
|
||||
@@ -122,8 +125,8 @@ public static class PromptFiles
|
||||
# Out-of-scope follow-up
|
||||
|
||||
You are an improvement follow-up that another task filed via SuggestImprovement.
|
||||
It was deliberately scoped narrow. Do EXACTLY what this task's title and
|
||||
description ask — nothing more.
|
||||
It was deliberately scoped narrow, and is intentionally a small, cheap unit of
|
||||
work. Do EXACTLY what this task's title and description ask — nothing more.
|
||||
|
||||
- Make the smallest change that satisfies the task. No opportunistic refactors,
|
||||
renames, reformatting, or "while I'm here" cleanup beyond what is asked.
|
||||
@@ -150,6 +153,14 @@ public static class PromptFiles
|
||||
Once the design is approved, create the child tasks with CreateChildTask, then
|
||||
call Finalize. Keep each subtask concrete and self-contained with a clear
|
||||
done-state, ordered so dependencies come first.
|
||||
|
||||
For each subtask, pass CreateChildTask's `model` argument set to the CHEAPEST
|
||||
model that can do that subtask well. Models, cheapest to most capable:
|
||||
haiku < sonnet < opus.
|
||||
- haiku — trivial/mechanical work: doc tweaks, simple renames, small localized edits.
|
||||
- sonnet — normal coding work; the sensible default when unsure.
|
||||
- opus — only for genuinely complex, cross-cutting, or hard-to-debug work.
|
||||
Do not default everything to opus — most subtasks are haiku or sonnet.
|
||||
""";
|
||||
|
||||
private const string PlanningInitialDefault = """
|
||||
|
||||
Reference in New Issue
Block a user