Skip to content

fix(web): preserve paired runtime ownership - #9776

Merged
OrcaWin merged 2 commits into
mainfrom
OrcaWin/issue-9760-remote-access-client-routing
Jul 21, 2026
Merged

OrcaWin merged 2 commits into
mainfrom
OrcaWin/issue-9760-remote-access-client-routing

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • stamp paired-web repo and worktree responses with the runtime environment that answered the request, so server-local filesystem and PTY work never falls through to browser-local APIs
  • fence late responses, cache writes, legacy fallbacks, and restored selectors across re-pairs; old selectors remain compatible only when the server public key proves the same identity
  • model browser-local workspace-port capability explicitly and validate scan payloads at the RPC boundary instead of allowing an undefined result to crash unavailableReason handling
  • cover reverse-proxy endpoint scheme, port, and path preservation on shared, web, and mobile pairing paths

This addresses the immediate reproducible ownership and renderer-crash portions of #9760 and #9047. It intentionally avoids the global active-runtime fallback proposed in #9090/#9147 because that can route server A's worktree through server B.

Investigation matrix

Scope Result
Headless server worktrees reported as local Fixed with request-scoped runtime ownership
Direct LAN vs reverse proxy Both validated; no transport-specific routing workaround needed
unavailableReason crash Fixed at ownership and capability/RPC lifecycle boundaries
Mobile custom endpoint UX Existing parser retained; TLS port/path behavior covered
Cloud relay/product requests Out of scope; no relay implementation added

Verification

  • 371 focused renderer/store/destructive-operation tests
  • root and mobile TypeScript checks
  • max-lines ratchet, focused oxlint, oxfmt, and git diff --check
  • full mobile suite: 303 files / 2,170 tests passed, 2 skipped
  • Docker headless Electron server through direct ws:// and TLS reverse proxy wss://.../orca/runtime
  • reconnect, simultaneous direct/proxy clients, two independently keyed servers, filesystem/catalog/port-scan RPCs
  • three internal review-until-clean rounds, including elegance and performance audits

Scope notes

@coderabbitai

coderabbitai Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

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

Next review available in: 11 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 51fb94d6-cd6b-4163-9a39-0cb7e96f6d00

📥 Commits

Reviewing files that changed from the base of the PR and between 5960669 and 265d9c9.

📒 Files selected for processing (2)
  • src/renderer/src/components/ports/WorkspacePortScanner.test.tsx
  • src/renderer/src/lib/workspace-port-scan-client.ts
📝 Walkthrough

Walkthrough

Web runtime persistence now tracks compatible environment IDs, validates stored data, rejects stale responses, and preserves runtime ownership on repository and worktree results. Workspace port scanning uses a shared validated client with explicit unsupported responses for browser-local workspaces. Pairing tests cover reverse-proxy endpoints with ports and paths. Additional tests cover runtime isolation, cache invalidation, detected worktrees, direct/proxied connections, and runtime-owned file deletion.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary and verification, but it omits required template sections like Screenshots, Testing checkboxes, AI Review Report, and Security Audit. Add the missing template sections with screenshot status, explicit test checklist results, AI review findings, security audit, and notes.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately describes the main change to paired runtime ownership.
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.

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.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ec98f99c-b7c5-4c60-844c-493b3825fffb

📥 Commits

Reviewing files that changed from the base of the PR and between f1c84d3 and 45260a752210e8ba4ffba0876bcb898594e6ec51.

📒 Files selected for processing (13)
  • mobile/src/transport/pairing.test.ts
  • src/renderer/src/components/ports/WorkspacePortScanner.test.tsx
  • src/renderer/src/lib/workspace-port-actions.ts
  • src/renderer/src/lib/workspace-port-scan-client.ts
  • src/renderer/src/runtime/file-explorer-delete-owner-provenance.test.ts
  • src/renderer/src/web/WebConnect.tsx
  • src/renderer/src/web/main.tsx
  • src/renderer/src/web/web-pairing.test.ts
  • src/renderer/src/web/web-preload-api.test.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/renderer/src/web/web-runtime-direct-proxy-live.integration.test.ts
  • src/renderer/src/web/web-runtime-environment.ts
  • src/shared/pairing.test.ts

@OrcaWin
OrcaWin force-pushed the OrcaWin/issue-9760-remote-access-client-routing branch from 45260a7 to 5960669 Compare July 21, 2026 21:07
@OrcaWin
OrcaWin merged commit 15362fd into main Jul 21, 2026
3 checks passed
@AmethystLiang AmethystLiang added the orca-remote-server Remote Orca Server / orca serve / paired remote runtime label Jul 22, 2026
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* fix(web): preserve paired runtime ownership

* fix(web): validate runtime port scan payloads

---------

Co-authored-by: OrcaWin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

orca-remote-server Remote Orca Server / orca serve / paired remote runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants