feat(data): PowerUse-Flags und konfigurierbares Handoff-Budget
app_settings bekommt power_use_enabled (Master-Schalter, wird im Usage-Monitor gesetzt) und list_handler_max_handoffs (Default 4 = zwei Merge-Runden). list_config bekommt power_use_allowed als Opt-in pro Liste. Ein Handler-Run laeuft nur unbeaufsichtigt, wenn BEIDE Schalter gesetzt sind. Damit kann der globale Schalter ueber Nacht an bleiben, ohne dass der Handler einer nicht zugestimmten Liste sein Verhalten aendert. UpdateListConfigDto.PowerUseAllowed ist bewusst bool? (tri-state, null = gespeicherten Wert behalten), analog zu TicketProjectId: SetConfigAsync kopiert verbatim, ein non-nullable bool haette jedem fremden Writer erlaubt, das Opt-in per Auslassung zu widerrufen. Der Test dazu nagelt genau das fest. Migration ist drei reine ALTER TABLE ADD COLUMN, kein Table-Rebuild.
This commit is contained in:
@@ -36,7 +36,11 @@ public record AppSettingsDto(
|
||||
int UsageThrottleFiveHourHardPct = 65,
|
||||
int UsageThrottleSevenDaySoftPct = 50,
|
||||
int UsageThrottleSevenDayHardPct = 65,
|
||||
bool AutoContinueOnUsageLimit = false);
|
||||
bool AutoContinueOnUsageLimit = false,
|
||||
// PowerUse master switch — toggled on the usage monitor, not typed in Settings. Only takes
|
||||
// effect for a list that also set PowerUseAllowed.
|
||||
bool PowerUseEnabled = false,
|
||||
int ListHandlerMaxHandoffs = 4);
|
||||
|
||||
public record ModelPresetDto(string Model, string Effort, int MaxTurns);
|
||||
|
||||
@@ -95,11 +99,13 @@ public record UpdateListDto(string Id, string Name, string? WorkingDir, string D
|
||||
// TicketProjectId is tri-state on purpose: a caller that doesn't own the field (anything but the
|
||||
// list-settings modal) must not be able to clear it by omission — SetConfigAsync copies the entity
|
||||
// verbatim. Its scale: null = keep stored, <= 0 = clear the link, > 0 = set it.
|
||||
public record UpdateListConfigDto(string ListId, string? Model, string? SystemPrompt, string? AgentPath, int? MaxTurns = null, List<string>? SessionSkills = null, string? VerifyCommand = null, string? PermissionMode = null, int? TicketProjectId = null);
|
||||
// PowerUseAllowed is nullable for the same reason: null = keep stored, false = revoke the opt-in.
|
||||
// A non-nullable bool here would let any caller that omits it silently revoke PowerUse for the list.
|
||||
public record UpdateListConfigDto(string ListId, string? Model, string? SystemPrompt, string? AgentPath, int? MaxTurns = null, List<string>? SessionSkills = null, string? VerifyCommand = null, string? PermissionMode = null, int? TicketProjectId = null, bool? PowerUseAllowed = null);
|
||||
|
||||
public record UpdateTaskAgentSettingsDto(string TaskId, string? Model, string? SystemPrompt, string? AgentPath, int? MaxTurns = null, List<string>? SessionSkills = null, string? PermissionMode = null);
|
||||
|
||||
public record ListConfigDto(string? Model, string? SystemPrompt, string? AgentPath, int? MaxTurns = null, List<string>? SessionSkills = null, string? VerifyCommand = null, string? PermissionMode = null, int? TicketProjectId = null);
|
||||
public record ListConfigDto(string? Model, string? SystemPrompt, string? AgentPath, int? MaxTurns = null, List<string>? SessionSkills = null, string? VerifyCommand = null, string? PermissionMode = null, int? TicketProjectId = null, bool PowerUseAllowed = false);
|
||||
|
||||
public record SeedResultDto(int Copied, int Skipped);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user