diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-03-08 22:24:12 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-03-08 22:24:12 +0000 |
| commit | f135ab89ce6710a4f20049e6d0d8e914d8e2e402 (patch) | |
| tree | 67b492274a239a1e0d4fc579a2daf3a70cb9be65 /internal/executor/claude.go | |
| parent | fab59cf8e669fe9ec34b30586f07b7478e897c31 (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to 'internal/executor/claude.go')
| -rw-r--r-- | internal/executor/claude.go | 5 |
1 files changed, 4 insertions, 1 deletions
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 { |
