From f01231cc45f41ce2dc37072e77428e467ef3fc15 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Fri, 10 Apr 2026 09:17:31 +0000 Subject: fix: atomic execution creation + RUNNING state transition Add CreateExecutionAndSetRunning to storage.DB and Store interface, replacing the two sequential CreateExecution/UpdateTaskState calls in executor.go. Eliminates the crash window where a task stays PENDING with an orphaned RUNNING execution record. Co-Authored-By: Claude Sonnet 4.6 --- internal/executor/executor_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'internal/executor/executor_test.go') diff --git a/internal/executor/executor_test.go b/internal/executor/executor_test.go index cb8205d..fac7e9c 100644 --- a/internal/executor/executor_test.go +++ b/internal/executor/executor_test.go @@ -1134,7 +1134,10 @@ func (m *minimalMockStore) ListSubtasks(parentID string) ([]*task.Task, error) { return nil, nil } func (m *minimalMockStore) ListExecutions(_ string) ([]*storage.Execution, error) { return nil, nil } -func (m *minimalMockStore) CreateExecution(e *storage.Execution) error { return nil } +func (m *minimalMockStore) CreateExecution(e *storage.Execution) error { return nil } +func (m *minimalMockStore) CreateExecutionAndSetRunning(e *storage.Execution) error { + return nil +} func (m *minimalMockStore) UpdateExecution(e *storage.Execution) error { return m.updateExecErr } -- cgit v1.2.3