fix(runner): extract sandbox output to temp dir instead of overwriting target repo - #2774
Conversation
PR Summary by QodoRunner: extract sandbox repo to temp dir to avoid clobbering target repo
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Site previewPreview: https://c6ac5e20-site.fullsend-ai.workers.dev Commit: |
|
🤖 Finished Review · ✅ Success · Started 7:58 AM UTC · Completed 8:10 AM UTC |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Code Review by Qodo
1.
|
ReviewRe-review of d539dda (prior review: de48094, provenance: app-verified). This is a new commit since the prior review. All 3 files changed. The core change — extracting sandbox output to FindingsMedium
Low
Previous runReviewRe-review of de48094 (prior review: db67317, provenance: app-verified). This is a rebase onto the latest main — the PR's code changes are identical to the prior review. All prior findings carry forward with anchored severities. The prior high-severity [resource-ordering] finding remains resolved: the download-dir cleanup defer is registered before the post-script defer, ensuring correct LIFO ordering. The core change — extracting sandbox output to FindingsMedium
Low
Previous run (2)ReviewRe-review of db67317 (prior review: 264b65e, provenance: app-verified). The prior review's high-severity [resource-ordering] finding has been resolved. The download-dir cleanup defer is now registered before the post-script defer (line 820), ensuring Go's LIFO defer ordering runs: sandbox cleanup → post-script → download-dir cleanup. The post-script's FindingsMedium
Low
Previous run (3)ReviewFindingsHigh
Medium
Previous runReviewRe-review of de48094 (prior review: db67317, provenance: app-verified). This is a rebase onto the latest main — the PR's code changes are identical to the prior review. All prior findings carry forward with anchored severities. The prior high-severity [resource-ordering] finding remains resolved: the download-dir cleanup defer is registered before the post-script defer, ensuring correct LIFO ordering. The core change — extracting sandbox output to FindingsMedium
Low
Previous run (2)ReviewRe-review of db67317 (prior review: 264b65e, provenance: app-verified). The prior review's high-severity [resource-ordering] finding has been resolved. The download-dir cleanup defer is now registered before the post-script defer (line 820), ensuring Go's LIFO defer ordering runs: sandbox cleanup → post-script → download-dir cleanup. The post-script's The core change — extracting sandbox output to FindingsMedium
Low
Previous run (3)ReviewFindingsHigh
Medium
Previous run (4)ReviewRe-review of 264b65e (prior review: 760c642, provenance: app-verified). The prior review flagged a high-severity resource leak: FindingsHigh
Medium
Previous run (5)ReviewFindingsHigh
Previous run (6)ReviewFindingsHigh
Previous run (7)ReviewFindingsHigh
Medium
Previous run (8)ReviewFindingsHigh
Low
Labels: Bug fix in the agent runner's extraction path (internal/cli/run.go) addressing race condition #2075, submitted by an external contributor. Previous run (9)ReviewFindingsCritical
High
Medium
Low
Previous run (10)ReviewFindingsHigh
Medium
Previous run (11)ReviewFindingsHigh
Low
Labels: Bug fix in the agent runner's extraction path (internal/cli/run.go) addressing race condition #2075, submitted by an external contributor. Previous run (12)ReviewFindingsCritical
High
Medium
Low
|
|
Won't address the critical given by the review agent, we won't replace the directory, what if something bad happens and all is wiped out? |
63dc6cc to
c22aaba
Compare
|
🤖 Finished Review · ✅ Success · Started 8:30 AM UTC · Completed 8:41 AM UTC |
c22aaba to
e55c6e3
Compare
|
🤖 Finished Review · ✅ Success · Started 7:44 AM UTC · Completed 7:58 AM UTC |
e55c6e3 to
760c642
Compare
|
🤖 Finished Review · ✅ Success · Started 8:36 AM UTC · Completed 8:48 AM UTC |
ben-alkov
left a comment
There was a problem hiding this comment.
LGTM, but why are the changes to ".codecov.yml" here?
db67317 to
de48094
Compare
|
🤖 Finished Review · ✅ Success · Started 7:10 AM UTC · Completed 7:26 AM UTC |
BREAKING CHANGE: `fullsend run code` no longer writes sandbox output directly into the --target-repo directory. Results are extracted to a temporary directory that is removed after the run (use --keep-sandbox to retain it). Previously os.RemoveAll(hostRepositoryDir) ran before each SafeDownload, creating a window where the target repo was missing or partially populated. Concurrent readers (IDEs, file watchers, other agents) would hit ENOENT or see partial state. Post-script and validation-loop env vars (REPO_DIR, TARGET_REPO_DIR) now point to the temp download location. Closes #2075 Signed-off-by: Hector Martinez <hemartin@redhat.com>
de48094 to
d539dda
Compare
|
🤖 Finished Review · ✅ Success · Started 7:42 AM UTC · Completed 7:59 AM UTC |
waynesun09
left a comment
There was a problem hiding this comment.
CI green, previously-blocking merge conflict resolved by rebase, and the flagged findings (results-output lifetime, REPO_DIR override documentation) have been fixed. Approving.
|
🤖 Finished Retro · ✅ Success · Started 10:03 PM UTC · Completed 10:10 PM UTC |
|
PR #2774 was a well-scoped bug fix (3 files, +33/-69 lines) that took 16 days to merge, with 9 review agent runs producing 43 review comments. The review agent caught genuinely valuable findings (resource leak on temp dir, defer LIFO ordering bug) but also re-raised the same codecov scope-creep finding 4+ times after the author explicitly dismissed it — reinforcing the pattern documented in agents#106. Human reviewers caught two issues the review agent missed: the stale branch/conflicting fix on main (waynesun09, day 13) and a results-output-lifetime bug where a printed download path would be deleted before the user could use it (waynesun09, day 15). The repeated findings and high review-run count represent significant token waste, with agents#108 and fullsend#5139 already tracking related optimizations. Proposals filed
Evidence notes (not filed as issues)
|
Summary
Breaking change:
fullsend run codeno longer writes sandbox output directly into the--target-repodirectory. Results are extracted to a temporary directory ($TMPDIR/<sandbox>) that is cleaned up after the run. Pass--keep-sandboxto retain it for inspection.os.RemoveAll(hostRepositoryDir)ran before eachSafeDownload, creating a window where the target repo was missing or partially populated. Concurrent readers (IDEs, file watchers, other agents) would hit ENOENT or see partial state.REPO_DIR,TARGET_REPO_DIR) now point to the temp download location.--keep-sandboxis set.--keep-sandboxhelp text updated to mention it also retains the download directory.REPO_DIRfrom harnessRunnerEnv(Remove REPO_DIR from harness RunnerEnv agents#191).Migration
Users relying on
fullsend run codeto modify their local checkout in place need to copy results from the printed download directory, or pass--keep-sandboxand use the temp path.Closes #2075
Test plan
$REPO_DIR— verify it points to temp dir$TARGET_REPO_DIRpoints to temp dir--keep-sandbox--keep-sandbox