Skip to content

Enable headless relay enrollment - #27610

Closed
AlexThunder1989 wants to merge 8 commits into
stablyai:mainfrom
AlexThunder1989:codex/headless-mobile-relay
Closed

AlexThunder1989 wants to merge 8 commits into
stablyai:mainfrom
AlexThunder1989:codex/headless-mobile-relay

Conversation

@AlexThunder1989

@AlexThunder1989 AlexThunder1989 commented Oct 11, 2026 •

Copy link
Copy Markdown

ELI5

Enroll a phone through Relay when Orca runs as a headless service.

What changed

Starts the existing Relay service in service mode and uses the existing mobile pairing flow.

Why

Service mode skipped Relay startup and generated a direct pairing link.

Linked issue

Fixes #27615.

Proof

I am now using the headless service on Android through Relay, not Tailscale.

Testing

  • Phone enrollment verified with the patched Linux service.
  • Two focused pairing tests added; eight tests pass across the two affected test files.

Full checks and other platforms remain for CI/review.

AI disclosure

Prepared with OpenAI Codex (GPT-6).

Agent skill upstream boundary

  • Not applicable: no upstream skill-installer material copied.

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 22 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 91efa367-0614-4683-9b8d-6c282add62dc
📥 Commits

Reviewing files that changed from the base of the PR and between d73fdf8 and dfe6313.

📒 Files selected for processing: 6
  • src/main/orcad/orcad-serve-readiness.ts
  • src/main/server/serve-pairing-readiness.test.ts
  • src/main/server/serve-pairing-readiness.ts
  • src/main/startup/main-process-runtime-launch-activation.test.ts
  • src/main/startup/main-process-runtime-launch.ts
  • src/main/startup/main-process-serve.ts

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a677ef77-6b47-4720-a1d0-a90a6735fc65
📥 Commits

Reviewing files that changed from the base of the PR and between 1aef628 and f4a5eb5.

📒 Files selected for processing: 6
  • src/main/orcad/orcad-serve-readiness.ts
  • src/main/server/serve-pairing-readiness.test.ts
  • src/main/server/serve-pairing-readiness.ts
  • src/main/startup/main-process-runtime-launch-activation.test.ts
  • src/main/startup/main-process-runtime-launch.ts
  • src/main/startup/main-process-serve.ts
🚧 Files skipped from review as they are similar to previous changes: 1
  • src/main/orcad/orcad-serve-readiness.ts

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

📝 Walkthrough

Serve mode now starts the desktop Relay service and passes its RPC to pairing readiness. When mobile pairing is requested and Relay is available, readiness requests a Relay offer. It falls back to a direct offer only for a Relay mint failure. Tests cover successful Relay offers, fallback behavior, other offer failures, and hosts without Relay. Orcad remains on direct mobile pairing.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to f4a5e

Serve mode now starts Relay and requests a Relay pairing link, falling back to the previous direct link only when Relay cannot mint an invite. No blocking risk was identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: enabling Relay enrollment for headless service mode.
Description check Passed The description includes the user impact, mechanism, reason, linked issue, testing results, and AI disclosure. It omits several template sections, including Review, Notes, and Checklist, and does not …
Linked Issues check Passed Issue #27615 requires headless service mode to start Relay and generate a Relay pairing link for mobile enrollment. launchServeMode now calls startDesktopRelayService. printServeReady passes the…
Out of Scope Changes check Passed The changes stay within issue #27615. Startup changes enable Relay for headless service mode. Pairing changes implement Relay enrollment and preserve direct pairing when Relay is unavailable or absent…
  • Autofix · 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

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

@AlexThunder1989 AlexThunder1989 changed the title Codex/headless mobile relay Enable headless relay enrollment Oct 11, 2026
@AlexThunder1989

AlexThunder1989 commented Oct 11, 2026 •

Copy link
Copy Markdown
Author

Hey @Jinwoo-H, feel free to take a look when you get time.

…e pairing link

orcad runs no Relay service and pins its bind, so a Relay-first mobile offer
always failed there. Electron serve now tries Relay and falls back to the
previous direct link when Relay cannot mint an invite.
@nwparker

Copy link
Copy Markdown
Contributor

Thanks @AlexThunder1989. I merged current main into this branch and pushed one maintainer commit:

  • orcad keeps the direct link. orcad runs no Relay service and pins its listener (loopback by default). A Relay-first mobile offer would always fail there, as network_exposure_failed or relay_provider_unavailable, where it used to print a working link. Only the Electron --serve host, which now starts Relay, takes the Relay path.
  • Serve falls back when Relay is unavailable. If Relay can't mint an invite (for example, the host isn't signed in), orca serve --mobile-pairing prints the same LAN/Tailscale link it printed before this PR and logs a warning to stderr, instead of printing no pairing at all. Other failures are still reported.
  • The tests cover all four paths. Relay success, the Relay-failure fallback, a non-Relay failure, and the no-Relay host.

Codex review found no further issues.

@luxisme

luxisme commented Nov 9, 2026

Copy link
Copy Markdown

+1 on landing this. My setup: Orca desktop on a MacBook, agents on a Linux dev VM (Ubuntu 22.04) that the desktop manages as an SSH host. Orca Mobile reaches the VM only through the desktop's Relay, so when the laptop sleeps the phone loses the VM even though its agents keep running. LAN and Tailscale aren't options on my network, so Relay is the only route.

With this PR I could run orca-ide serve on the VM and pair the phone through Relay directly. I'm happy to test a rebased build on a headless Ubuntu VM. One question: how should a headless host sign in for Relay? Is there a CLI sign-in, or does the profile need one sign-in from a desktop session first?

@AlexThunder1989

Copy link
Copy Markdown
Author

Closing: already implemented upstream in #36469. On a headless host, including the Electron-less orca-server (orcad), sign in once with orca auth login, then run orca pair --mobile --relay for a Relay QR. Checked on a headless Ubuntu box with a current orca-server build: it returns a Relay invite from relay.onorca.dev.

@luxisme: that's the path for your VM. orca auth login prints a link and a code you approve in any browser.

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.

Headless service cannot enroll mobile through Relay

3 participants