fix(mount): fail stalled bootstraps loudly - #421
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Warning Review limit reached
Next review available in: 35 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (19)
📝 WalkthroughWalkthroughThe change adds caller-visible tree totals, bounded bootstrap traversal, persisted terminal stall states, richer progress metadata, and CLI reporting for stalled or unknown-total bootstrap phases. ChangesBootstrap observability and convergence
Estimated code review effort: 4 (Complex) | ~60 minutes Merge Risk: ⚪ Minimal · up to The changes make stalled bootstrap failures explicit, preserve progress state, and synchronize API surfaces; no actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant CLI mount loop
participant Syncer
participant Remote tree API
participant Persisted state
CLI mount loop->>Syncer: start bootstrap
Syncer->>Remote tree API: request paginated tree
Remote tree API-->>Syncer: tree page and caller-visible total
Syncer->>Persisted state: save progress or terminal reason
Syncer-->>CLI mount loop: continue or return terminal error
CLI mount loop->>Persisted state: publish mount snapshot
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8c356aa172
ℹ️ 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".
Relayfile Eval ReviewRun: Passed: 4 | Needs human: 0 | Reviewable: 0 | Missing output: 0 | Failed: 0 | Skipped: 0 Human Review CasesNo reviewable human-review cases captured Relayfile output. |
There was a problem hiding this comment.
All reported issues were addressed
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 6 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
Required: verify against the built CLI, not just unit testsDo not mark this done on green unit tests alone. Build this repo and exercise the real Reproduce → fix → re-verifynpm ci && npm run build # or the repo's build script
relayfile status # against a workspace with an incomplete bootstrapThe live reproduction is on workspace Prove, with actual terminal output for both the failing and passing run:
Check the cursor discrepancy first: the stall message says Constraints
|
Review — issue #419 mount bootstrap stall (reviewer: ar-419-review-relayfile)Reviewed against Branch reconciliation (please resolve before merge)There are two heads for issue #419:
This PR is a strict superset of The delta that matters: on What I verified against the issue's definition of done
I also confirmed the On the issue's suspicion that the persisted cursor wasn't being honoured on resume — I don't think that was ever the bug. The traversal checkpoint is a triple (cursor + Non-blocking notes
Feature map
Not approving or merging — |
- buildSyncStateSnapshot: only read local writeback state when localDir is set. A workspace with no local mirror (blank localDir) previously imported whatever .relay/state.json happened to exist under the CLI's current working directory into the workspace snapshot. - pullRemoteFullTree: scan the full page (not just the per-cycle budget-limited chunk) for a reserved runtime subtree before trusting page.TotalFiles as the completion denominator. A runtime subtree whose entries sort after enough real files to fall outside this cycle's processed chunk previously left an unreachable N/M total persisted until some later cycle happened to walk that entry. Adds TestBootstrapProgressSuppressesTotalWhenRuntimeSubtreeOutlivesFileBudget, verified to fail against the pre-fix syncer.go. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
- buildSyncStateSnapshot: guard countFilesInDir/countLines the same way as the local writeback state read, so a workspace with no local mirror can no longer pick up an unrelated .relay/conflicts or permissions-denied.log from the CLI's working directory. - Extract markBootstrapTotalUnavailable to a shared helper so the full-page scan and the per-entry loop can't diverge on how they suppress the bootstrap total (cubic P3). - Document the eager-publish tradeoff for a runtime subtree that only appears on a later page of the root frontier's own pagination (cubic P2, confidence 8). Deferring publication until that pagination fully drains was tried and reverted: it broke TestBootstrapStallCycleGuardPersistsAndFailsHard, which depends on the total surfacing early during a large, slow, multi-page bootstrap that repeatedly retries and never drains — exactly the production scenario this issue is about. The total now self-corrects to unavailable as soon as the runtime-bearing page is actually walked, rather than staying wrong forever; full elimination of the transient window is not compatible with early progress visibility. Added TestBootstrapProgressSelfCorrectsWhenRuntimeSubtreeIsOnALaterRootPage covering the self-correction across a root-pagination boundary. Validation: go build ./..., go vet ./..., gofmt -l, full go test ./... (all packages) pass. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Closes #419
Summary
totalFilestree response so progress never renders an invalidN/0denominator; suppress it persistently when reserved runtime pruning makes the generic total unreachablenpm ciand PR checks can executeRoot cause
The mount syncer already produced a typed hard failure after the checkpoint-stable cycle limit, but the CLI daemon treated it as an ordinary failed poll and retried forever. A per-cycle deadline branch could also mask the typed stall because the error wrapped
context.DeadlineExceeded. Separately, the CLI snapshot writer replaced the mountsync public state and lost its structured bootstrap error, so provider health remained the only green status visible to operators.The reported empty cursor is not evidence that the saved traversal was discarded: the directory frontier and page cursor were already persisted and restored. An empty cursor is valid at a directory boundary. Status and errors now include the current directory, page cursor/offset, and pending frontier together, removing that ambiguity.
Validation
go test ./...go vet ./...go test -race ./internal/mountsync ./cmd/relayfile-cli -run 'Test(BootstrapStallCycleGuardPersistsAndFailsHard|BootstrapDirectoryTraversalLimitFailsLoudlyAndPersistsPath|CLIMountLoopStopsAndPersistsStatusOnBootstrapStall|StatusDistinguishesStalledBootstrapFromHealthyProvider)' -count=1scripts/check-contract-surface.shnode scripts/check-sdk-parity.mjsnpm run build --workspace=packages/corenpm run typecheck --workspace=packages/sdk/typescriptnpm run build --workspace=packages/sdk/typescriptnpm run test --workspace=packages/sdk/typescript(239 tests)npm ciuv run --project packages/sdk/python --extra dev pytest -q packages/sdk/python/tests(96 tests)All mount-loop regression tests use scratch directories and an
httptestserver. The live shared workspace was not restarted, stopped, re-homed, or used for reproduction.