feat(#3640): directory-level fetching for pre/post scripts - #5443
feat(#3640): directory-level fetching for pre/post scripts#5443fullsend-ai-coder[bot] wants to merge 1 commit into
Conversation
Extend resolveBaseScripts in compose.go to fetch the containing directory of pre/post scripts (via git sparse checkout) instead of fetching each script as an isolated file. This ensures companion files (helper scripts, Python tools, etc.) are co-located at the BASH_SOURCE-relative path, preventing the recurring companion-file breakage pattern seen in #2705, #3182, and #3069. When the URL is a raw.githubusercontent.com URL, the new fetchBaseScriptOrDir function uses TreeFetcher to fetch the full directory tree. When the URL cannot be parsed for directory-level fetching, it falls back to the existing single-file fetch via fetchBaseFile for backward compatibility. Directory caching is keyed by "scriptdir:<dirURL>" so sibling scripts in the same directory (e.g., pre-code.sh and post-code.sh) share a single tree fetch -- the second script hits the cache populated by the first. Note: pre-commit hooks could not run in the sandbox due to network restrictions (git fetch origin --tags returned 403). The post-script runs an authoritative pre-commit check on the runner. Closes #3640
|
🤖 Finished Review · ✅ Success · Started 7:32 AM UTC · Completed 7:50 AM UTC |
|
This was solved at another point, I requested coding by mistake. Closing. |
Site previewPreview: https://aba9cb20-site.fullsend-ai.workers.dev Commit: |
|
🤖 Finished Retro · ✅ Success · Started 7:35 AM UTC · Completed 7:53 AM UTC |
|
Review skipped — this PR is already closed. The Posted by fullsend post-review check |
Retro: PR #5443 — Wasted code agent run on already-resolved issueWhat happened: On 2026-07-22, a human ( Root causes: (1) The human had no way to cancel the in-flight code agent run after realizing the mistake. (2) Issue #3640 had no signal that it was already resolved — the fix landed in a different repo ( Existing issue evidence: This retro provides fresh evidence for several open issues tracking cross-repo visibility gaps:
Novel finding: No existing issue proposes a general-purpose human-initiated slash command to cancel an in-flight agent run. The closest mechanism is Proposals filed
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Summary
Extend
resolveBaseScriptsincompose.goto use directory-level fetching (git sparse checkout) for pre/post scripts resolved from URL bases, ensuring companion files are co-located at theBASH_SOURCE-relative path. This is the systemic fix for the recurring companion-file breakage pattern (#2705, #3182, #3069/PR #3393).Related Issue
Fixes #3640
Changes
fetchBaseScriptOrDirwrapper that attempts directory-level fetching viaTreeFetcherwhen the URL is araw.githubusercontent.comURL, with automatic fallback to single-filefetchBaseFilefor non-GitHub URLs and backward compatibilityfetchBaseScriptDirTreethat uses git sparse checkout (analogous tofetchBaseSkillDirfor skills) to fetch the script's containing directory, cache it viaCachePutDir, and make all files executableresolveBaseScriptsto usefetchBaseScriptOrDirfor all script fields (pre_script,post_script,validation_loop.script, and forge-level equivalents)"scriptdir:<dirURL>"ensures sibling scripts share a single tree fetch (e.g.,pre-code.shandpost-code.shin the samescripts/directory)validation_loop.schema) continue to use single-filefetchBaseFileTesting
LoadWithBasego vetandgo buildpassChecklist
!for breaking changes)Closes #3640
Post-script verification
agent/3640-dir-fetch-scripts)675086c5e606fe1ea9c09c22e1aa617aa17afeae..HEAD)