Skip to content

fix: clear local repo unconditionally before SafeDownload - #1045

Merged
waynesun09 merged 2 commits into
mainfrom
fix-tar-extract-unconditional
May 15, 2026
Merged

fix: clear local repo unconditionally before SafeDownload#1045
waynesun09 merged 2 commits into
mainfrom
fix-tar-extract-unconditional

Conversation

@waynesun09

Copy link
Copy Markdown
Member

Summary

  • Removes the iteration > 1 guard on the os.RemoveAll(repoSrc) cleanup — it must run on every iteration, not just 2+
  • Makes SafeDownload failure a hard error on all iterations (not just 2+)

Root cause

PR #1038 added RemoveAll before SafeDownload but guarded it with iteration > 1, assuming iteration 1 starts with a clean directory. In practice, the GHA workflow's "Checkout target repository" step populates target-repo/ before fullsend runs. When the agent finishes iteration 1 and SafeDownload extracts back into the pre-existing checkout, openshell's tar extractor fails with "File exists (os error 17)".

Evidence: https://github.com/fullsend-ai/.fullsend/actions/runs/25944154001/job/76268502952 — downloaded fullsend v0.8.2 (which includes #1038) but still failed on iteration 1.

Test plan

  • go test ./internal/cli/ — passes
  • go vet ./... — passes
  • Trigger triage/scribe workflow and verify extraction succeeds on iteration 1

The iteration > 1 guard was wrong — the target-repo directory already
exists on iteration 1 because the GHA workflow checks out the repo
before fullsend runs. openshell's tar extraction fails with "File
exists (os error 17)" on any pre-existing directory, not just on
iteration 2+.

Remove the iteration guard so RemoveAll runs before every SafeDownload
call. Also make SafeDownload failure a hard error on all iterations
since the local repo was just cleared and continuing with a missing
directory is unsafe.

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://30eacee3-site.fullsend-ai.workers.dev

Commit: 4ccfeeb03c75eb3a5072e17023d64d6c7c84b5f4

@waynesun09
waynesun09 requested a review from ralphbean May 15, 2026 22:30
@fullsend-ai-review

Copy link
Copy Markdown

Review

No findings.

@fullsend-ai-review fullsend-ai-review Bot added the ready-for-merge All reviewers approved — ready to merge label May 15, 2026

@ralphbean ralphbean left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

- Promote RemoveAll failure from warning to hard error — if local
  cleanup fails, SafeDownload will hit the same EEXIST error, so
  fail fast with a clear message.
- Surface transcript errors before aborting on SafeDownload failure —
  transcripts are already extracted at step 9c but their errors were
  skipped by the early return.
- Remove unnecessary else block after SafeDownload error return (Go
  idiom: no else after early return).

Signed-off-by: Wayne Sun <gsun@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-merge All reviewers approved — ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants