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:
mika kuns
2026-06-04 12:18:32 +02:00
parent 97e38fb480
commit ac137f7c1c
4 changed files with 84 additions and 2 deletions

View File

@@ -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);
}

View File

@@ -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