feat(data): add usage gate thresholds and task run model column

Adds AppSettings.UsageGateFiveHourPct/UsageGateSevenDayPct (defaults
80/90, clamped 0..100 in UpdateAsync) and a nullable TaskRunEntity.Model
column, laying the data foundation for the usage monitor. No worker/UI
changes.
This commit is contained in:
mika kuns
2026-08-05 09:51:42 +02:00
parent 8d7ba1e314
commit bedd2defbb
10 changed files with 1039 additions and 3 deletions
@@ -34,4 +34,8 @@ public sealed class AppSettingsEntity
// JSON array of ModelPreset rows (model → effort + max turns). Supplies the global effort and
// turn defaults per model; list-/task-level max-turns overrides still win. Null = ship defaults.
public string? ModelPresets { get; set; }
// Percentage of the 5h/7d Claude usage window at which the autonomous queue pauses. 0 = gate off.
public int UsageGateFiveHourPct { get; set; } = 80;
public int UsageGateSevenDayPct { get; set; } = 90;
}
@@ -18,6 +18,7 @@ public sealed class TaskRunEntity
public string? LogPath { get; set; }
public DateTime? StartedAt { get; set; }
public DateTime? FinishedAt { get; set; }
public string? Model { get; set; }
// Navigation property
public TaskEntity Task { get; set; } = null!;