feat(planning): let CreateChildTask set maxTurns on child tasks
Planning sessions could already steer a subtask's model but not its turn budget, so a visibly large subtask would still die at the global default turn limit. maxTurns is optional (default null = inherit list/global default, matching model); 0/negative values are rejected as invalid input, consistent with the existing model-alias validation.
This commit is contained in:
@@ -41,16 +41,18 @@ public sealed class PlanningMcpService
|
||||
"Create a new draft child task under the current planning session's parent task. " +
|
||||
"Set model to the cheapest model that can do this subtask well — 'haiku' for trivial/mechanical " +
|
||||
"work, 'sonnet' for normal coding (the default), 'opus' only for complex or cross-cutting work. " +
|
||||
"Leave model null to inherit the list/global default.")]
|
||||
"Leave model null to inherit the list/global default. Set maxTurns only when this subtask is " +
|
||||
"visibly larger than the default turn budget; leave it null to inherit the list/global default.")]
|
||||
public async Task<CreatedChildDto> CreateChildTask(
|
||||
string title,
|
||||
string? description,
|
||||
string? commitType,
|
||||
string? model,
|
||||
CancellationToken cancellationToken)
|
||||
int? maxTurns = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
var ctx = _contextAccessor.Current;
|
||||
var child = await _tasks.CreateChildAsync(ctx.ParentTaskId, title, description, commitType, createdBy: null, model: model, ct: cancellationToken);
|
||||
var child = await _tasks.CreateChildAsync(ctx.ParentTaskId, title, description, commitType, createdBy: null, model: model, maxTurns: maxTurns, ct: cancellationToken);
|
||||
await BroadcastTaskUpdatedAsync(child.Id, cancellationToken);
|
||||
await BroadcastTaskUpdatedAsync(ctx.ParentTaskId, cancellationToken);
|
||||
return new CreatedChildDto(child.Id, child.Status.ToString());
|
||||
|
||||
Reference in New Issue
Block a user