Keep Relayfile discovery and babysitters durable#140
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 Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. 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 (11)
📝 WalkthroughWalkthroughChangesLocal mount health reporting
Terminal agent lifecycle
Factory discovery and babysitter recovery
Estimated code review effort: 5 (Critical) | ~90 minutes Sequence Diagram(s)sequenceDiagram
participant RelayfileCloudMountClient
participant FleetCLI
participant CloudReporter
participant Relayfile
RelayfileCloudMountClient->>FleetCLI: emit local mount health event
FleetCLI->>CloudReporter: send factory anomaly or snapshot
FleetCLI->>Relayfile: write current mount-health record
Possibly related issues
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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: 310a7e9658
ℹ️ 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".
There was a problem hiding this comment.
Code Review
This pull request introduces local mount health monitoring and supervision to the RelayfileCloudMountClient. It adds support for token rotation, schedules periodic health checks, and reports degraded or recovered mount states via a new LocalMountHealthEvent interface. Corresponding tests and CLI integrations have also been updated. The feedback suggests a minor improvement to remove redundant async and await keywords from the launch function inside src/mount/relayfile-cloud-mount-client.ts to simplify the code.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/mount/relayfile-cloud-mount-client.ts`:
- Around line 534-556: Update `#superviseLocalMount` so `#markLocalMountRecovered`
is called only after the successful `#replaceLocalMount` refresh path. In the else
branch, let ensureLocalMount own the health transition and do not emit an
additional recovered state; preserve the existing catch handling and
health-check scheduling.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 84aa0e8a-fbf0-4556-b5cd-fbb1b16ceb1c
📒 Files selected for processing (5)
src/cli/fleet.test.tssrc/cli/fleet.tssrc/index.tssrc/mount/relayfile-cloud-mount-client.test.tssrc/mount/relayfile-cloud-mount-client.ts
22b6d7c to
5bb9ae6
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/orchestrator/batch-tracker.ts`:
- Around line 208-216: Normalize repository identifiers to the same
owner/repository shape before comparing implementer repos with babysitter-owned
pull requests. Update dispatchOccupiesImplementationSlot and the corresponding
handoff checks in src/state/file-state-store.ts lines 800-808 and
src/state/in-memory-state-store.ts lines 527-535; ensure both bare names and
owner/name values compare consistently after normalization.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 5ba10eec-06eb-4b75-9a10-bef1a373991f
📒 Files selected for processing (8)
src/mount/relayfile-cloud-mount-client.test.tssrc/mount/relayfile-cloud-mount-client.tssrc/orchestrator/batch-tracker.tssrc/orchestrator/factory.test.tssrc/orchestrator/factory.tssrc/state/file-state-store.tssrc/state/in-memory-state-store.tssrc/types.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/mount/relayfile-cloud-mount-client.ts
What changed
@relayfile/sdk@0.10.32supervisor surfaces; Factory does not bypass Relayfileagent_not_found: forget the stale tracking entry, best-effort release it, resume/cold-spawn the durable session, retarget ownership and pending wakes, then probe with a cooldownbatchSizeas an implementation-work limit: durable PR babysitters continue receiving review events without starving new ready issuesfactory-readyissues before reading metadata, with a complete legacy tree-scan fallbackRoot causes
Factory could stay alive after its short-lived local mount session expired, leaving discovery stale while instance heartbeats still looked healthy. All 52 repository mounts also shared the same refresh deadline, causing a simultaneous refresh storm. Separately, restart reconciliation could discover an existing PR but lose its durable receipt, and PR babysitters counted against the implementation batch indefinitely. Together, those restored lifecycles consumed every slot even though implementation work had already reached GitHub.
Operational result
Mount failures now produce durable mount-health state plus
factory.anomalyevents. NightCTO consumes that health path and pages on degradation. Stale babysitters recover automatically and preserve their queued PR-feedback wake. Babysitter-owned PRs no longer consume implementation capacity, so queuedfactory-readyissues can advance. Indexed discovery finds eligible issues immediately, with a correctness-preserving fallback for legacy indexes that do not yet contain labels.Validation
npm test -- --reporter=dot— 48 files, 997 tests passednpm run buildisolated tarball install: all library exports imported, configured node export imported, CLI help passed
tarball resolved published
@relayfile/sdk@0.10.32focused fault tests cover mount expiry/restart, same-directory singleflight, bounded multi-repo refresh concurrency, unreachable babysitter recovery/cooldown, restart PR-receipt reconciliation, post-handoff capacity release, indexed discovery, and CPU-heavy fallback heartbeat liveness
exact-PR ownership regression: stale weak-match babysitter is released, durable receipt is replaced, and only the exact branch PR keeps ownership
live shutdown proof: all 28 lifecycle leases were relinquished immediately while a slow fallback scan was still draining