fix: refresh tasks snapshot immediately after IPC task mutations

Previously, current_tasks.json was only written at container-start time,
so tasks created (or paused/cancelled/updated) during a session were
invisible to list_tasks until the next invocation.

Add an onTasksChanged callback to IpcDeps, called after every successful
mutation in processTaskIpc (schedule_task, pause_task, resume_task,
cancel_task, update_task). index.ts wires it up to write fresh snapshots
for all registered groups immediately, keeping no new coupling between
ipc.ts and the container layer.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Michael Bravo
2026-03-10 15:58:24 +02:00
parent d572bab5c6
commit 5ca0633c27
3 changed files with 22 additions and 0 deletions

View File

@@ -62,6 +62,7 @@ beforeEach(() => {
syncGroups: async () => {},
getAvailableGroups: () => [],
writeGroupsSnapshot: () => {},
onTasksChanged: () => {},
};
});