Skip to content

Fix durable relay dispatch lifecycle#93

Merged
miyaontherelay merged 3 commits into
mainfrom
codex/issue-85-relay-lifecycle
Jul 17, 2026
Merged

Fix durable relay dispatch lifecycle#93
miyaontherelay merged 3 commits into
mainfrom
codex/issue-85-relay-lifecycle

Conversation

@miyaontherelay

@miyaontherelay miyaontherelay commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Depends on #91

Fixes #85

Summary

  • make relay dispatch run under a durable dispatch-owner lifecycle that stays alive through placement, publication, writeback, cleanup, and human review
  • persist fenced owner/epoch leases, complete tracked placement state, spawn intents, deterministic per-run branch/invocation identity, publication receipts, and release checkpoints
  • recover running, queued, publishing, parking, and waiting-for-human lifecycles autonomously after process crashes or lease expiry without duplicate spawn/publication or leaked batch capacity
  • publish remote work from its pushed GitHub head ref, validate the mounted PR is open, non-draft, and on the expected head, then apply terminal writeback
  • preserve relay node/repo/clonePath locality on resume and never signal relay-node PIDs as local processes

Supported topology

Durable ownership and global batch capacity are fenced across multiple control-plane processes on one host when they share the same FileStateStore. Active/active control-plane ownership across different hosts is intentionally unsupported because the current system has no cross-host shared compare-and-set store. Relay execution nodes do not require access to the control-plane state directory.

Validation

  • focused lifecycle/CLI/state/mount/fleet tests: 371/371 passed
  • full npm test: 38 files, 765/765 passed
  • npm run build: passed
  • npm pack --dry-run --json: passed, 258 package entries with required CLI, factory, FileStateStore, GitHub writer, and state artifacts
  • git diff --check: passed
  • package-lock unchanged

The implementation is stacked on the exact #91 head 666825a; #91 supplies repo forwarding for normal and restart placement paths.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@miyaontherelay, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 47 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 38d1f1e5-94ff-46f2-8e96-f43dee789b7b

📥 Commits

Reviewing files that changed from the base of the PR and between bb760f2 and de287dd.

📒 Files selected for processing (20)
  • README.md
  • src/cli/fleet.test.ts
  • src/cli/fleet.ts
  • src/dispatch/templates.ts
  • src/fleet/internal-fleet-client.ts
  • src/fleet/relay-fleet-client.test.ts
  • src/fleet/relay-fleet-client.ts
  • src/mount/relayfile-github-connection-write.test.ts
  • src/mount/relayfile-github-connection-write.ts
  • src/orchestrator/batch-tracker.ts
  • src/orchestrator/factory.test.ts
  • src/orchestrator/factory.ts
  • src/ports/fleet.ts
  • src/ports/mount.ts
  • src/ports/state.ts
  • src/state/file-state-store.test.ts
  • src/state/file-state-store.ts
  • src/state/in-memory-state-store.ts
  • src/testing/fakes.ts
  • src/types.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/issue-85-relay-lifecycle

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

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

Base automatically changed from codex/issue-84-repo-placement to main July 17, 2026 07:38
@miyaontherelay
miyaontherelay force-pushed the codex/issue-85-relay-lifecycle branch from 146f2fe to de287dd Compare July 17, 2026 09:45
@miyaontherelay
miyaontherelay merged commit 321c623 into main Jul 17, 2026
2 checks passed
@miyaontherelay
miyaontherelay deleted the codex/issue-85-relay-lifecycle branch July 17, 2026 09:48
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.

relay backend: dispatch exits after placement, so nothing publishes the PR or parks the issue — remote work never reaches human-review

1 participant