Merge claudedo/20c78c9558cf4c4fa598a00c7cac374f

This commit is contained in:
mika kuns
2026-08-05 11:42:05 +02:00
7 changed files with 103 additions and 13 deletions
+6
View File
@@ -168,6 +168,12 @@ public static class PromptFiles
- 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.
Only for a subtask you can tell will need noticeably more turns than the
default budget (a large or sprawling piece of work), also pass CreateChildTask's
`maxTurns` argument with a generous turn count, so the run doesn't die mid-work
at the turn limit. Leave `maxTurns` null for everything else it inherits the
list/global default.
""";
private const string PlanningInitialDefault = """
@@ -276,8 +276,12 @@ public sealed class TaskRepository
string? commitType,
string? createdBy = null,
string? model = null,
int? maxTurns = null,
CancellationToken ct = default)
{
if (maxTurns.HasValue && maxTurns.Value <= 0)
throw new ArgumentException($"maxTurns must be positive, got {maxTurns.Value}.");
// AsNoTracking: SetPlanningStartedAsync mutates via ExecuteUpdate which
// bypasses the change tracker; a tracked Find would return stale data.
var parent = await _context.Tasks.AsNoTracking()
@@ -303,6 +307,7 @@ public sealed class TaskRepository
SortOrder = (maxSort ?? -1) + 1,
CreatedBy = createdBy,
Model = ModelRegistry.NormalizeAlias(model),
MaxTurns = maxTurns,
};
_context.Tasks.Add(child);
await _context.SaveChangesAsync(ct);