diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-03-10 17:16:42 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-03-10 17:16:42 +0000 |
| commit | 65c7638bbb5819b9997cb6cb1b0fb54f3361347f (patch) | |
| tree | d827553fa1fe229979b3521d0a1fa634e5a67ba0 /internal/executor/claude.go | |
| parent | e0335047e063830ca000a8cb3a9ec31a8ab411a7 (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to 'internal/executor/claude.go')
| -rw-r--r-- | internal/executor/claude.go | 11 |
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. |
