feat(KB-150): kill active agent sessions on global pause

- Add settings:updated event to TaskStore with previous/new settings payload
- Kill all active executor agent sessions when globalPause transitions false→true
- Kill all active triage specification sessions on global pause with clean status reset
- Track and dispose active merger session on global pause via onSession callback
- Add JSDoc documenting global pause behavior on executor and triage constructors
This commit is contained in:
Dustin Byrne
2026-03-28 02:16:30 -04:00
parent 711b19740d
commit 0f2958df69
9 changed files with 443 additions and 5 deletions

View File

@@ -12,6 +12,7 @@ export interface TaskStoreEvents {
"task:updated": [task: Task];
"task:deleted": [task: Task];
"task:merged": [result: MergeResult];
"settings:updated": [data: { settings: Settings; previous: Settings }];
"agent:log": [entry: AgentLogEntry];
}
@@ -130,10 +131,11 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
async updateSettings(patch: Partial<Settings>): Promise<Settings> {
return this.withConfigLock(async () => {
const config = await this.readConfig();
const current = { ...DEFAULT_SETTINGS, ...config.settings };
const updated = { ...current, ...patch };
const previous = { ...DEFAULT_SETTINGS, ...config.settings };
const updated = { ...previous, ...patch };
config.settings = updated;
await this.writeConfig(config);
this.emit("settings:updated", { settings: updated, previous });
return updated;
});
}