From 65c7638bbb5819b9997cb6cb1b0fb54f3361347f Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Tue, 10 Mar 2026 17:16:42 +0000 Subject: executor: fix session ID on second block-and-resume cycle When a resumed execution is blocked again, SessionID was set to the new exec's own UUID instead of the original ResumeSessionID. The next resume would then pass the wrong --resume argument to claude and fail. Co-Authored-By: Claude Sonnet 4.6 --- internal/executor/claude.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'internal/executor/claude.go') diff --git a/internal/executor/claude.go b/internal/executor/claude.go index db4d0fa..4839a90 100644 --- a/internal/executor/claude.go +++ b/internal/executor/claude.go @@ -85,9 +85,16 @@ func (r *ClaudeRunner) Run(ctx context.Context, t *task.Task, e *storage.Executi } // Pre-assign session ID so we can resume after a BLOCKED state. - // If this is a resume execution the session ID is already set. + // For resume executions, the claude session continues under the original + // session ID (the one passed to --resume). Using the new exec's own UUID + // would cause a second block-and-resume cycle to pass the wrong --resume + // argument. if e.SessionID == "" { - e.SessionID = e.ID // reuse execution UUID as session UUID (both are UUIDs) + if e.ResumeSessionID != "" { + e.SessionID = e.ResumeSessionID + } else { + e.SessionID = e.ID // reuse execution UUID as session UUID (both are UUIDs) + } } // For new (non-resume) executions with a project_dir, clone into a sandbox. -- cgit v1.2.3