feat(KB-145): add global pause button to halt all AI engine activity

- Add globalPause setting to core Settings type with default false
- Guard scheduler, triage, and auto-merge queue to skip work when globalPause is active
- Add pause/play toggle button in dashboard Header with optimistic UI and rollback on failure
- Add tests for scheduler, triage, Header, and App global pause behavior
- Include minor changeset for the new feature
This commit is contained in:
Dustin Byrne
2026-03-28 01:01:05 -04:00
parent 2bdd628d6d
commit 36873e57ca
11 changed files with 399 additions and 8 deletions

View File

@@ -179,6 +179,7 @@ export class TriageProcessor {
/** The interval (ms) of the currently active `setInterval` timer. */
private activePollMs: number | null = null;
private processing = new Set<string>();
private wasGlobalPaused = false;
constructor(
private store: TaskStore,
@@ -230,6 +231,16 @@ export class TriageProcessor {
const settings = await this.store.getSettings();
this.refreshPollInterval(settings.pollIntervalMs);
// Global pause: halt all triage activity
if (settings.globalPause) {
if (!this.wasGlobalPaused) {
triageLog.log("Global pause active — triage halted");
this.wasGlobalPaused = true;
}
return;
}
this.wasGlobalPaused = false;
const tasks = await this.store.listTasks();
const triageTasks = tasks.filter(
(t) => t.column === "triage" && !this.processing.has(t.id) && !t.paused,