summaryrefslogtreecommitdiff
path: root/internal/executor/claude.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/executor/claude.go')
-rw-r--r--internal/executor/claude.go11
1 files changed, 9 insertions, 2 deletions
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.