Skip to content

fix: clear local repo dir before re-extracting on validation loop iteration 2+ - #1038

Merged
waynesun09 merged 2 commits into
mainfrom
fix-sandbox-tar-extract-existing-dirs
May 15, 2026
Merged

fix: clear local repo dir before re-extracting on validation loop iteration 2+#1038
waynesun09 merged 2 commits into
mainfrom
fix-sandbox-tar-extract-existing-dirs

Conversation

@waynesun09

Copy link
Copy Markdown
Member

Summary

  • Fixes "File exists (os error 17)" tar extraction failure when the validation loop runs iteration 2+
  • openshell sandbox download uses tar extraction that cannot overwrite existing directories — on iteration 2+ the local repoSrc still has files from the previous extraction
  • Adds os.RemoveAll(repoSrc) before SafeDownload on iteration 2+, mirroring the sandbox-side cleanup already done for output and transcripts (lines 480-486)

Root cause

The between-iteration cleanup in runAgent() clears sandbox-side output and transcripts but not the local extraction target. When SafeDownload re-extracts the target repo into a non-empty directory, the underlying tar extractor fails on pre-existing directories.

Surfaced as a scribe workflow failure after upgrading from fullsend 0.7.0 to 0.8.1 (fullsend-ai/.fullsend#73).

Test plan

  • make go-vet — passes
  • make go-testinternal/cli passes (41.4% coverage)
  • make lint — passes
  • E2E test with a multi-iteration validation loop (scribe or similar agent with max_iterations > 1)

…ration 2+

openshell sandbox download uses tar extraction that fails with
"File exists (os error 17)" when the destination directory already
contains files from a previous iteration. Clear the local repo
directory before each SafeDownload call on iteration 2+, mirroring
the sandbox-side cleanup already done for output and transcripts.

Fixes scribe workflow failure after upgrading to fullsend 0.8.1.

Signed-off-by: Wayne Sun <gsun@redhat.com>
@github-actions

github-actions Bot commented May 15, 2026

Copy link
Copy Markdown

Site preview

Preview: https://3ee2336b-site.fullsend-ai.workers.dev

Commit: 20cda0ba031f7b64c6494c77c5aa8909f2f58e9e

Address review findings:
- Make SafeDownload failure after RemoveAll a hard error on iteration 2+,
  since the local repo directory is gone and continuing to validation
  with a missing TARGET_REPO_DIR is pointless.
- Rename err to clearErr to match the naming convention at line 483.
- Include repoSrc path in the warning message for CI log debugging.

Signed-off-by: Wayne Sun <gsun@redhat.com>
@fullsend-ai-review

Copy link
Copy Markdown

Review

Reason: stale-head

The review agent reviewed commit c1a5a930e6f70fe79a4a92caa5a0700e96df5bba but the PR HEAD is now 20cda0ba031f7b64c6494c77c5aa8909f2f58e9e. This review was discarded to avoid approving unreviewed code.

@waynesun09
waynesun09 added this pull request to the merge queue May 15, 2026
Merged via the queue into main with commit e15a31b May 15, 2026
7 checks passed
@waynesun09
waynesun09 deleted the fix-sandbox-tar-extract-existing-dirs branch May 15, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants