From 1b5e7177769c79f9e836a55f9c008a295e2ff975 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Wed, 11 Mar 2026 07:40:48 +0000 Subject: fix: resume BLOCKED tasks in preserved sandbox so Claude finds its session MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a task ran in a sandbox (/tmp/claudomator-sandbox-*) and went BLOCKED, Claude stored its session under the sandbox path as the project slug. The resume execution was running in project_dir, causing Claude to look for the session in the wrong project directory and fail with "No conversation found". Fix: carry SandboxDir through BlockedError → Execution → resume execution, and run the resume in that directory so the session lookup succeeds. - BlockedError gains SandboxDir field; claude.go sets it on BLOCKED exit - storage.Execution gains SandboxDir (persisted via new sandbox_dir column) - executor.go stores blockedErr.SandboxDir in the execution record - server.go copies SandboxDir from latest execution to the resume execution - claude.go uses e.SandboxDir as working dir for resume when set Co-Authored-By: Claude Sonnet 4.6 --- internal/api/server.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'internal/api') diff --git a/internal/api/server.go b/internal/api/server.go index 944e450..c545253 100644 --- a/internal/api/server.go +++ b/internal/api/server.go @@ -260,12 +260,14 @@ func (s *Server) handleAnswerQuestion(w http.ResponseWriter, r *http.Request) { return } - // Submit a resume execution. + // Submit a resume execution. Carry the sandbox path so the runner uses + // the same working directory where Claude stored its session files. resumeExec := &storage.Execution{ ID: uuid.New().String(), TaskID: taskID, ResumeSessionID: latest.SessionID, ResumeAnswer: input.Answer, + SandboxDir: latest.SandboxDir, } if err := s.pool.SubmitResume(context.Background(), tk, resumeExec); err != nil { writeJSON(w, http.StatusServiceUnavailable, map[string]string{"error": err.Error()}) -- cgit v1.2.3