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:
mika kuns
2026-06-09 22:22:17 +02:00
co-authored by Claude Opus 4.8
parent 1448794748
commit c27a179d2b
12 changed files with 181 additions and 18 deletions
@@ -197,6 +197,7 @@ public sealed class TaskRepository
string? description,
string? commitType,
string? createdBy = null,
string? model = null,
CancellationToken ct = default)
{
// AsNoTracking: SetPlanningStartedAsync mutates via ExecuteUpdate which
@@ -223,6 +224,7 @@ public sealed class TaskRepository
ParentTaskId = parentId,
SortOrder = (maxSort ?? -1) + 1,
CreatedBy = createdBy,
Model = ModelRegistry.NormalizeAlias(model),
};
_context.Tasks.Add(child);
await _context.SaveChangesAsync(ct);