From f135ab89ce6710a4f20049e6d0d8e914d8e2e402 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Sun, 8 Mar 2026 22:24:12 +0000 Subject: executor: fix sandbox git fetch + inject prior failure history Fix: use file:// prefix in git fetch during sandbox teardown to force pack-protocol transfer. The local optimization uses hard links which fail across devices and with mixed-owner object stores. Feature: before running a task, query prior failed/timed-out executions and prepend their error messages to the agent's --append-system-prompt. This tells the agent what went wrong in previous attempts so it doesn't repeat the same mistakes. Co-Authored-By: Claude Sonnet 4.6 --- internal/executor/claude.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'internal/executor/claude.go') diff --git a/internal/executor/claude.go b/internal/executor/claude.go index 683de87..d8032ab 100644 --- a/internal/executor/claude.go +++ b/internal/executor/claude.go @@ -204,7 +204,10 @@ func teardownSandbox(projectDir, sandboxDir string, logger *slog.Logger) error { } // Fetch new commits from sandbox into project_dir and fast-forward merge. - if out, err := exec.Command("git", "-C", projectDir, "fetch", sandboxDir, "HEAD").CombinedOutput(); err != nil { + // Use file:// prefix to force pack-protocol transfer instead of the local + // optimization that hard-links objects — hard-linking fails across devices + // and can fail with permission errors when the repo has mixed-owner objects. + if out, err := exec.Command("git", "-C", projectDir, "fetch", "file://"+sandboxDir, "HEAD").CombinedOutput(); err != nil { return fmt.Errorf("git fetch from sandbox: %w\n%s", err, out) } if out, err := exec.Command("git", "-C", projectDir, "merge", "--ff-only", "FETCH_HEAD").CombinedOutput(); err != nil { -- cgit v1.2.3