Skip to content

fix(mount): request raw tar on github working-tree seed - #537

Merged
khaliqgant merged 1 commit into
mainfrom
tarseed-rawtar
Oct 6, 2026
Merged

khaliqgant merged 1 commit into
mainfrom
tarseed-rawtar

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Summary

  • The tar seed now requests gzip=0 (raw tar) instead of pinning gzip=1.
  • The flag only affects server-generated tars — the retained R2 source archive is served with its stored encoding either way, and the client already sniffs Content-Type for its gzip reader.

Why

Generated tars are held to the server's 128 MiB buffered export ceiling when gzipped — the ceiling exists to protect CompressionStream CPU. Repos past that size (the cloud workspace's working tree is ~174 MiB) 413 on every generated-tar path, including the ACL-deny fall-through to the merged manifest — so the mount drops to ~6k bulk-read fetches that cannot fit the fleet mount readiness deadline. Observed live after relayfile-cloud#312's fall-through fix would otherwise let the request through.

Raw tar streams under the multi-GiB ceiling with no per-byte CPU cost.

Test plan

  • internal/mountsync suite green (77s) — seed test updated to assert SourceArchive + raw tar
  • go vet, gofmt clean
  • Live validation pending relayfile-cloud#312 deploy (source-archive deny → merged raw tar)

Generated with Devin

Review in cubic


Note

Medium Risk
Changes bulk seeding behavior for large GitHub-backed mounts; wrong encoding handling could break sync, but the client already sniffs content type and the change targets a known production failure mode.

Overview
GitHub working-tree tar seeding now requests raw (uncompressed) tar (Gzip: false) instead of server-generated gzip when calling ExportGithubWorkingTreeTar with SourceArchive.

That avoids the server’s 128 MiB buffered ceiling on gzipped generated exports, which was causing 413 responses for large working trees (~174 MiB) and forcing a fallback to thousands of per-file pulls that miss mount readiness deadlines. Raw tar uses the multi-GiB streaming path without CompressionStream CPU cost; retained R2 source archives are unchanged.

The reconcile seed test now asserts SourceArchive with Gzip: false.

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

The tar seed pins gzip=1, which only affects server-GENERATED tars —
the retained source archive is served from R2 either way. Generated
tars over 128 MiB (gzipped or not) are held to the buffered export
ceiling server-side, so the cloud repo's ~174 MiB working tree 413s on
the base-snapshot and merged-manifest paths — including the ACL deny
fall-through — and the mount drops to ~6k bulk reads that cannot fit
the fleet readiness deadline.

Request gzip=0: raw tar streams under the multi-GiB ceiling and skips
the CompressionStream CPU the buffered ceiling exists to protect. The
client already sniffs Content-Type for its gzip reader, so the stored
archive path is unaffected.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 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-10-06T03:37:30.993104Z e1a9ac0 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 Oct 6, 2026 •

Copy link
Copy Markdown

Review in 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: cbf79c97-fe0c-4294-9e0b-e76f2b9f122e
📥 Commits

Reviewing files that changed from the base of the PR and between d60fd6c and e1a9ac0.

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

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


📝 Walkthrough

Walkthrough

The GitHub working-tree seed request now sets Gzip to false. Its test checks this value and continues to require SourceArchive.

Changes

GitHub tar seed

Layer / File(s) Summary
Set raw tar request
internal/mountsync/syncer.go, internal/mountsync/syncer_test.go
The seed request sets Gzip to false. The test expects this setting and still requires SourceArchive.

Priority: ⬆️ High

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

Change: Bug fix

Suggested reviewers: miyaontherelay

Merge Risk: ⚪ Minimal · up to e1a9a

The seed request retains the source-archive setting while selecting raw tar, and the supplied test context covers the request and response handling. No actionable merge risk is evident.

Architecture Summary

Architecture risk: 🔵 Low · up to e1a9a

The change affects 1 system.

Changed systems: internal

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — internal (service) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in internal/mountsync/syncer.go: The GitHub working-tree seed request now sets Gzip to false instead of true, requesting a raw tar stream; the comment describes the distinction between retained source archives and server-generated tar compression.
  • observed — Modified behavior in internal/mountsync/syncer_test.go: The tar-seed test expectation changes from requiring Gzip to be true to requiring it to be false, while still requiring SourceArchive.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: requesting a raw tar for GitHub working-tree seeding.
Description check ✅ Passed The description explains the raw-tar change, its motivation, and the reported tests. It is directly related to the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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 checks the tar’s new way,
No gzip wraps the stream today.
The source archive stays in sight,
The test confirms the setting right.
Soft paws hop past, pleased and light.

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: 1 flag

Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

Relayfile Eval Review

Run: .relayfile/evals/runs/2026-10-06T03-37-27-139Z-HEAD-provider
Mode: provider
Git SHA: 2c3ab13

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.

@cubic-dev-ai cubic-dev-ai 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.

1 issue found across 2 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="internal/mountsync/syncer.go">

<violation number="1" location="internal/mountsync/syncer.go:6795">
P2: This sends `gzip=0` together with `sourceArchive=1`, a combination no code path in this repo exercises today. `ExportGithubWorkingTreeTar` only emits `gzip=0` when `!seed.Gzip`, and the existing contract test `TestHTTPClientExportGithubWorkingTreeTarRequestsSourceArchive` (internal/mountsync/http_client_test.go) asserts the opposite convention for source archives: a retained archive request carries no `gzip` parameter so the R2 object keeps its native gzip encoding. The comment claims the server ignores `gzip` for retained R2 archives, but that behavior ships in relayfile-cloud#312, which this PR says is still pending deployment. Against the currently deployed server, which has only ever seen source-archive requests without a `gzip` param (this call previously used `Gzip: true`), a large repo with a retained archive could be served the generated-tar path or a 413 — exactly the regression this flip is meant to cure. The local tar reader does adapt via Content-Type detection, so the risk is confined to server semantics, but the fix's correctness is unverified and untested: the raw-tar test uses `Gzip: false` with `SourceArchive` unset, so the shipped `Gzip: false, SourceArchive: true` request shape is never covered. Confirm the server ignores `gzip=0` when `sourceArchive=1` (once #312 deploys) and add a test asserting the combined request/response contract before relying on this path.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

// fall-through) and drops to per-file pulls. Raw tar gets the
// multi-GiB streaming ceiling and skips the CompressionStream
// CPU the ceiling exists to protect.
Gzip: false,

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: This sends gzip=0 together with sourceArchive=1, a combination no code path in this repo exercises today. ExportGithubWorkingTreeTar only emits gzip=0 when !seed.Gzip, and the existing contract test TestHTTPClientExportGithubWorkingTreeTarRequestsSourceArchive (internal/mountsync/http_client_test.go) asserts the opposite convention for source archives: a retained archive request carries no gzip parameter so the R2 object keeps its native gzip encoding. The comment claims the server ignores gzip for retained R2 archives, but that behavior ships in relayfile-cloud#312, which this PR says is still pending deployment. Against the currently deployed server, which has only ever seen source-archive requests without a gzip param (this call previously used Gzip: true), a large repo with a retained archive could be served the generated-tar path or a 413 — exactly the regression this flip is meant to cure. The local tar reader does adapt via Content-Type detection, so the risk is confined to server semantics, but the fix's correctness is unverified and untested: the raw-tar test uses Gzip: false with SourceArchive unset, so the shipped Gzip: false, SourceArchive: true request shape is never covered. Confirm the server ignores gzip=0 when sourceArchive=1 (once #312 deploys) and add a test asserting the combined request/response contract before relying on this path.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At internal/mountsync/syncer.go, line 6795:

<comment>This sends `gzip=0` together with `sourceArchive=1`, a combination no code path in this repo exercises today. `ExportGithubWorkingTreeTar` only emits `gzip=0` when `!seed.Gzip`, and the existing contract test `TestHTTPClientExportGithubWorkingTreeTarRequestsSourceArchive` (internal/mountsync/http_client_test.go) asserts the opposite convention for source archives: a retained archive request carries no `gzip` parameter so the R2 object keeps its native gzip encoding. The comment claims the server ignores `gzip` for retained R2 archives, but that behavior ships in relayfile-cloud#312, which this PR says is still pending deployment. Against the currently deployed server, which has only ever seen source-archive requests without a `gzip` param (this call previously used `Gzip: true`), a large repo with a retained archive could be served the generated-tar path or a 413 — exactly the regression this flip is meant to cure. The local tar reader does adapt via Content-Type detection, so the risk is confined to server semantics, but the fix's correctness is unverified and untested: the raw-tar test uses `Gzip: false` with `SourceArchive` unset, so the shipped `Gzip: false, SourceArchive: true` request shape is never covered. Confirm the server ignores `gzip=0` when `sourceArchive=1` (once #312 deploys) and add a test asserting the combined request/response contract before relying on this path.</comment>

<file context>
@@ -6784,7 +6784,15 @@ func (s *Syncer) pullRemoteFullGithubTarSeed(ctx context.Context, client githubW
+			// fall-through) and drops to per-file pulls. Raw tar gets the
+			// multi-GiB streaming ceiling and skips the CompressionStream
+			// CPU the ceiling exists to protect.
+			Gzip:          false,
 			SourceArchive: true,
 		})
</file context>

@khaliqgant
khaliqgant merged commit 1a865f0 into main Oct 6, 2026
14 checks passed
@khaliqgant
khaliqgant deleted the tarseed-rawtar branch October 6, 2026 03:43
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