feat(KB-151): immediately resume agentic activity on global unpause

- Add settings:updated listener in Scheduler to trigger schedule() on globalPause true→false transition
- Add settings:updated listener in TriageProcessor to trigger poll() on globalPause true→false transition
- Add unpause handler in dashboard to resume orphaned executor tasks and sweep merge queue
- Guard all resume paths against no-op transitions (false→false, true→true) and stopped state
- Add tests for all three resume paths covering transition edge cases
This commit is contained in:
Dustin Byrne
2026-03-28 02:26:05 -04:00
parent e20134a474
commit a37f1d2260
6 changed files with 371 additions and 1 deletions

View File

@@ -83,7 +83,22 @@ export class Scheduler {
constructor(
private store: TaskStore,
private options: SchedulerOptions = {},
) {}
) {
/**
* Immediate unpause resume: when `globalPause` transitions from `true`
* to `false`, trigger a scheduling pass right away instead of waiting
* for the next poll interval (up to 15 s). Only reacts to true→false
* transitions — no-ops on false→false and true→true.
*
* The re-entrance guard (`this.scheduling`) inside `schedule()` safely
* drops the call if a poll-based pass is already in flight.
*/
this.store.on("settings:updated", ({ settings, previous }) => {
if (previous.globalPause && !settings.globalPause && this.running) {
this.schedule();
}
});
}
start(): void {
if (this.running) return;