fix: Handle spawn and branch failures gracefully in dispatch cycle

Wrap agentManager.spawn() in try/catch — on failure, block the task
instead of crashing the entire dispatch cycle. Move phase status update
to after branch creation succeeds — on branch failure, block the phase
and skip task queuing. Fix statement-breakpoint markers in migration
0020 to use separate lines.
This commit is contained in:
Lukas May
2026-03-05 16:36:39 +01:00
parent 42f5bcb80a
commit da8c714de2
4 changed files with 36 additions and 20 deletions

View File

@@ -9,7 +9,8 @@ CREATE TABLE `change_sets` (
`status` text NOT NULL DEFAULT 'applied',
`reverted_at` integer,
`created_at` integer NOT NULL
);--> statement-breakpoint
);
--> statement-breakpoint
CREATE TABLE `change_set_entries` (
`id` text PRIMARY KEY NOT NULL,
`change_set_id` text NOT NULL REFERENCES `change_sets`(`id`) ON DELETE CASCADE,
@@ -20,6 +21,8 @@ CREATE TABLE `change_set_entries` (
`new_state` text,
`sort_order` integer NOT NULL DEFAULT 0,
`created_at` integer NOT NULL
);--> statement-breakpoint
CREATE INDEX `change_sets_initiative_id_idx` ON `change_sets`(`initiative_id`);--> statement-breakpoint
);
--> statement-breakpoint
CREATE INDEX `change_sets_initiative_id_idx` ON `change_sets`(`initiative_id`);
--> statement-breakpoint
CREATE INDEX `change_set_entries_change_set_id_idx` ON `change_set_entries`(`change_set_id`);