feat(settings): make max-turns ceiling editable in General tab
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -145,6 +145,14 @@
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<StackPanel Spacing="4" Margin="0,4,0,0">
|
||||
<TextBlock Classes="eyebrow" Text="{loc:Tr settings.general.maxTurnsCeiling}"/>
|
||||
<NumericUpDown Value="{Binding General.MaxTurnsCeiling, Mode=TwoWay}"
|
||||
Minimum="1" Maximum="200" Increment="10" FormatString="0"
|
||||
HorizontalAlignment="Left" Width="140"/>
|
||||
<TextBlock Text="{loc:Tr settings.general.maxTurnsCeilingHint}"
|
||||
Opacity="0.6" FontSize="12" TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Classes="field-label" Text="{loc:Tr settings.general.maxParallelExecutions}"/>
|
||||
|
||||
Reference in New Issue
Block a user