summaryrefslogtreecommitdiff
path: root/internal/api
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-03-11 07:40:48 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-03-11 07:40:48 +0000
commit1b5e7177769c79f9e836a55f9c008a295e2ff975 (patch)
treee0660a68884ed1309095e61b91b857b0cdb4005c /internal/api
parent23f9b65bf65b3d3677350a456e57294a4df810b9 (diff)
fix: resume BLOCKED tasks in preserved sandbox so Claude finds its session
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 <noreply@anthropic.com>
Diffstat (limited to 'internal/api')
-rw-r--r--internal/api/server.go4
1 files changed, 3 insertions, 1 deletions
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()})