Skip to content

fix(#6824): fall back to main when agents repo version tag is missing - #6826

Open
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/6824-fallback-agents-ref
Open

fix(#6824): fall back to main when agents repo version tag is missing#6826
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/6824-fallback-agents-ref

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

When a release build's version tag (e.g. tags/v0.38.0) doesn't exist in the fullsend-ai/agents repo, the CLI now falls back to resolving from heads/main instead of failing with a 404. This fixes auto-triggered fix dispatches that fail immediately when the agents repo hasn't been tagged for the running CLI version.

Related Issue

Fixes #6824

Changes

  • Modified fetchPinnedAgentsRepoFile() in internal/cli/run.go to retry with heads/main when a version-tagged ref returns an error
  • The fallback only activates for tags/ refs — dev builds (which already use heads/main) are unaffected
  • A warning is logged when the fallback is used, making the missing tag visible in run output
  • If the fallback to heads/main also fails, the original failure behavior is preserved

Testing

  • Added TestTryAgentsRepoFallback_ReleaseBuild_MissingTagFallsBackToMain — verifies successful fallback to main when version tag is missing
  • Added TestTryAgentsRepoFallback_ReleaseBuild_MissingTagAndMainFails — verifies graceful failure when both tag and main are unavailable
  • Added TestTryAgentsRepoFallback_DevBuild_NoFallback — verifies dev builds don't exercise the tag-fallback path
  • All existing TestTryAgentsRepoFallback_* and TestResolveAgentsRef_* tests pass
  • Patch coverage: 90.6% on fetchPinnedAgentsRepoFile, 100% on resolveAgentsRef
  • gofmt and go vet pass

Closes #6824

Post-script verification

  • Branch is not main/master (agent/6824-fallback-agents-ref)
  • Secret scan passed (gitleaks — 2a29f774dbf5707909c4265d10b2b4b324c8a344..HEAD)
  • PR body secret scan passed (gitleaks — no-git)

When a release build resolves agents from fullsend-ai/agents using a
version-tagged ref (e.g. tags/v0.38.0) and that tag does not exist,
fetchPinnedAgentsRepoFile now retries with heads/main instead of
failing immediately. This prevents auto-triggered dispatches from
failing with a 404 when the agents repo has not yet been tagged for
the running CLI version.

The fallback logs a warning so the missing tag is visible in run
output. Dev builds (which already use heads/main) are unaffected.

Note: pre-commit could not run in this sandbox (network restrictions
blocked hook repo fetching). gofmt and go vet were run directly and
passed.

Closes #6824
@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team as a code owner August 31, 2026 20:38
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Agent PR ready for human review label Aug 31, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 31, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 8:40 PM UTC · Completed 8:55 PM UTC

Commit: 0a7e31d · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $4.38

@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Aug 31, 2026
@fullsend-ai-review

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Small, well-scoped bug fix with strong test coverage (50% test file ratio) from a known bot author. The changed files are hot (86+ commits in 30 days, 17 distinct authors), but the change is minimal and tightly scoped to the linked issue. Composite rounds to 2 (moderate).

@fullsend-ai-review

Copy link
Copy Markdown

Looks good to me

@fullsend-ai-review fullsend-ai-review Bot added the ready-for-merge All reviewers approved — ready to merge label Aug 31, 2026
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 ready-for-review Agent PR ready for human review risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI agent resolution should fall back to main when version tag is missing

0 participants