feat(settings): make max-turns ceiling editable in General tab

This commit is contained in:
mika kuns
2026-08-05 20:21:05 +02:00
parent bdee731376
commit 2975f90f9d
4 changed files with 18 additions and 3 deletions
@@ -17,9 +17,8 @@ public sealed partial class GeneralSettingsTabViewModel : ViewModelBase
[ObservableProperty] private string _defaultClaudeInstructions = "";
[ObservableProperty] private string _defaultModel = ModelRegistry.DefaultAlias;
[ObservableProperty] private int _defaultMaxTurns = 40;
// Hard ceiling every resolved max-turns value is clamped to before a run starts. Not directly
// editable here yet — loaded and echoed back on save so it round-trips, and drives the clamp
// hints on the preset rows below and on AgentConfigEditorViewModel.
// Hard ceiling every resolved max-turns value is clamped to before a run starts. Drives the
// clamp hints on the preset rows below and on AgentConfigEditorViewModel.
[ObservableProperty] private int _maxTurnsCeiling = 80;
[ObservableProperty] private string _defaultPermissionMode = PermissionModeRegistry.DefaultMode;
[ObservableProperty] private int _maxParallelExecutions = 1;
@@ -97,6 +96,8 @@ public sealed partial class GeneralSettingsTabViewModel : ViewModelBase
public string? Validate()
{
if (MaxTurnsCeiling < 1)
return Loc.T("settings.general.maxTurnsCeilingInvalid");
if (MaxParallelExecutions < 1 || MaxParallelExecutions > 20)
return "Max parallel executions must be between 1 and 20.";
if (UsageGateFiveHourPct < 0 || UsageGateFiveHourPct > 100)