feat(data): persist max_turns in list and task repositories
Add MaxTurns to ListRepository.SetConfigAsync upsert branch and TaskRepository.UpdateAgentSettingsAsync; fix positional CancellationToken call in ConfigMcpTools. Covered by MaxTurnsRoundTripTests (2 tests). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -65,6 +65,7 @@ public sealed class ListRepository
|
||||
existing.Model = config.Model;
|
||||
existing.SystemPrompt = config.SystemPrompt;
|
||||
existing.AgentPath = config.AgentPath;
|
||||
existing.MaxTurns = config.MaxTurns;
|
||||
}
|
||||
await _context.SaveChangesAsync(ct);
|
||||
}
|
||||
|
||||
@@ -159,6 +159,7 @@ public sealed class TaskRepository
|
||||
string? model,
|
||||
string? systemPrompt,
|
||||
string? agentPath,
|
||||
int? maxTurns = null,
|
||||
CancellationToken ct = default)
|
||||
{
|
||||
await _context.Tasks
|
||||
@@ -166,7 +167,8 @@ public sealed class TaskRepository
|
||||
.ExecuteUpdateAsync(s => s
|
||||
.SetProperty(t => t.Model, model)
|
||||
.SetProperty(t => t.SystemPrompt, systemPrompt)
|
||||
.SetProperty(t => t.AgentPath, agentPath), ct);
|
||||
.SetProperty(t => t.AgentPath, agentPath)
|
||||
.SetProperty(t => t.MaxTurns, maxTurns), ct);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -58,7 +58,7 @@ public sealed class ConfigMcpTools
|
||||
_ = await _tasks.GetByIdAsync(taskId, cancellationToken)
|
||||
?? throw new InvalidOperationException($"Task {taskId} not found.");
|
||||
|
||||
await _tasks.UpdateAgentSettingsAsync(taskId, model.NullIfBlank(), systemPrompt.NullIfBlank(), agentPath.NullIfBlank(), cancellationToken);
|
||||
await _tasks.UpdateAgentSettingsAsync(taskId, model.NullIfBlank(), systemPrompt.NullIfBlank(), agentPath.NullIfBlank(), ct: cancellationToken);
|
||||
await _broadcaster.TaskUpdated(taskId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user