Skip to content

fix(mount): fall back when GitHub tar seed fails - #514

Merged
khaliqgant merged 1 commit into
mainfrom
agent37-tarseed-fallback
Sep 20, 2026
Merged

khaliqgant merged 1 commit into
mainfrom
agent37-tarseed-fallback

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Sep 20, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Treat GitHub working-tree tar seed failures as non-terminal and fall back to the resumable tree pull
  • Preserve the successful tar-seed fast path
  • Add regression coverage for tar export failure falling back to tree hydration

Verification

  • go test ./internal/mountsync -run 'TestPullRemoteFullGithubWorkingTreeTarSeed(FallsBackToTree|sAndStoresCursor)|TestGithubWorkingTreeSnapshotRejectsUnsupportedCompleteEntry'
  • go test ./internal/mountsync

Agent37 context

Production Agent37 public sandbox proof is failing during Relayfile initial sync with relayfile_mount_invoked_exited / initial_sync_process / exit 1. Prior sanitized evidence identified github_tar_seed on the same mount path; this keeps tar seed as an optimization instead of letting it abort initial repo materialization.


Note

Medium Risk
Changes initial/full GitHub mount hydration behavior, but only replaces a hard failure with a documented fallback to the established tree path.

Overview
GitHub full pulls no longer abort when the working-tree tar seed export fails. If tar seed was attempted and errors, the syncer logs the failure and continues with the existing resumable tree pull instead of returning immediately. The fast path is unchanged: a successful tar seed still finishes the full pull right away.

A new integration test simulates a transient tar export error and asserts reconciliation completes via tree listing, local files match remote content, and sync state (events cursor and tracked revisions) is updated correctly.

Reviewed by Cursor Bugbot for commit 5cd5e7c. Bugbot is set up for automated code reviews on this repo. Configure here.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-20T19:33:53.994066Z 5cd5e7c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 92b82898-6284-4127-81e4-69b8e93e29c1

📥 Commits

Reviewing files that changed from the base of the PR and between e400108 and 5cd5e7c.

📒 Files selected for processing (2)
  • internal/mountsync/syncer.go
  • internal/mountsync/syncer_test.go

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

A failed GitHub working-tree tar seed is now recoverable. The full pull logs and records the seed error, then uses the tree pull path. The test verifies repository materialization and cursor advancement.

Changes

GitHub tar seed fallback

Layer / File(s) Summary
Tar seed fallback and validation
internal/mountsync/syncer.go, internal/mountsync/syncer_test.go
pullRemoteFull continues with the resumable tree pull after a tar seed error. The test verifies one tar attempt, tree listing, file contents, tracked revision and hash, and the evt_2 cursor.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: miyaontherelay

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: GitHub tar seed failures now fall back to tree hydration.
Description check ✅ Passed The description accurately summarizes the fallback behavior, preserved fast path, regression coverage, and verification commands.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit watched the tar seed fail
Then traced the trees along the trail
The files appeared, the cursor spun
Revision and hashes came undone
“Fallback works!” the rabbit sings
And bounds through code on cotton springs

Comment @coderabbitai help to get the list of available commands.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

Devin Review

Comment on lines +6571 to +6572
s.logf("github tar seed failed; falling back to resumable tree pull: %v", err)
seedErr = err

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔴 Slow tar seeds defeat fallback

When the tar request exhausts the bootstrap watchdog, err arrives after ctx is canceled. pullRemoteFullTree reuses that context and fails immediately, so slow tar seeds still block initial materialization.

Learn more

The tar export is one atomic HTTP request with no progress callbacks. The bootstrap watchdog cancels its context when that request remains idle too long. The new fallback starts only after the tar call returns, but it passes the same canceled context to pullRemoteFullTree. Every tree request then fails without making progress, and the next reconcile repeats the tar attempt.

Example: A tar export stalls until the two-minute bootstrap watchdog cancels ctx. The export returns context deadline exceeded; fallback calls ListTree with that canceled context and fails immediately. The next initial-sync cycle starts the same sequence instead of hydrating through the tree API.

Recommended fix: Give ExportGithubWorkingTreeTar its own sub-deadline strictly below the active bootstrap watchdog, as pullRemoteFullExport does. Fall back only while the parent bootstrap context remains live; propagate parent cancellation directly.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +6571 to +6574
s.logf("github tar seed failed; falling back to resumable tree pull: %v", err)
seedErr = err
} else {
seedErr = err

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Completed mounts miss tree fallback

With BootstrapComplete true, a tar error runs pullRemoteFullExport before the tree fallback. A transient export error then aborts the cycle, even when ListTree remains healthy.

Learn more

A completed mount normally tries the generic snapshot export before the resumable tree traversal. The new tar failure path rejoins that sequence instead of selecting the promised tree fallback. pullRemoteFullExport returns used=true for ordinary HTTP failures, causing pullRemoteFull to return before pullRemoteFullTree runs.

Example: A periodic full pull gets HTTP 500 from the GitHub tar export and HTTP 500 from the generic export endpoint, while ListTree and ReadFile remain healthy. Reconciliation returns the generic export error without trying the tree traversal.

Recommended fix: When seedErr is non-nil, bypass pullRemoteFullExport and proceed directly to pullRemoteFullTree. Add coverage with an already-complete mount where both export endpoints fail but tree reads succeed.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@github-actions

Copy link
Copy Markdown

Relayfile Eval Review

Run: .relayfile/evals/runs/2026-09-20T19-32-51-363Z-HEAD-provider
Mode: provider
Git SHA: 885cf14

Passed: 4 | Needs human: 0 | Reviewable: 0 | Missing output: 0 | Failed: 0 | Skipped: 0

Human Review Cases

No reviewable human-review cases captured Relayfile output.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5cd5e7c225

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +6571 to +6572
s.logf("github tar seed failed; falling back to resumable tree pull: %v", err)
seedErr = err

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Skip atomic export after the tar seed fails

When an already-bootstrapped GitHub mount performs a periodic or forced full pull, this branch claims to fall back to the resumable tree, but BootstrapComplete remains true, so control next enters pullRemoteFullExport; if that export returns any ordinary error with used=true, line 6582 returns it and the tree traversal never runs. Because the production HTTPClient implements both export interfaces, an outage affecting both export variants still prevents the intended fallback for existing mounts; bypass the atomic export when seedErr != nil, or otherwise ensure its failure continues to pullRemoteFullTree.

Useful? React with 👍 / 👎.

@khaliqgant
khaliqgant merged commit 479f074 into main Sep 20, 2026
13 checks passed
@khaliqgant
khaliqgant deleted the agent37-tarseed-fallback branch September 20, 2026 19:38
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.

1 participant