Skip to content

feat(status): report remote server listener, grants and connected clients - #26047

Open
kambarakun wants to merge 4 commits into
stablyai:mainfrom
kambarakun:feat/remote-server-status-25647-upstream
Open

kambarakun wants to merge 4 commits into
stablyai:mainfrom
kambarakun:feat/remote-server-status-25647-upstream

Conversation

@kambarakun

@kambarakun kambarakun commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

orca status --json can report the answering server's listener, access grants and currently connected paired clients. Users no longer need to combine OS connection tools with the credentials file for these facts.

What Changed

Before, JSON status omitted remote-server diagnostics. After, an optional remoteServer block reports:

  • The actual listener address and port, or disabled / not_listening.
  • Grants, including unused grants, and authenticated connected identities. Identity count is distinct from socket count; direct and relay sockets for one grant count as one identity.
  • Explicitly selected metadata, with at most 100 entries per list and truncated when necessary. There is no pagination. Unreadable or malformed inventories, including missing/empty tokens and duplicate IDs, return unavailable rather than misleading counts.

Only explicit JSON status opts in among built-in callers. Text status, startup/open polling and terminal-send preflight do not collect diagnostics. The authenticated local owner-token transport and paired runtime peers can provide the reader; mobile, SSH bridge credentials and internal calls without that reader cannot. Request parameters cannot confer permission. Tokens, keys, pairing URLs, push/relay credentials and administrative grant lists are not serialized.

The four commits were rebased onto cce31b4b4deeee9812f59e2ae81d3ce58bcebd8c. Main's new caller permissions, admission flow and shared rpcContextFromTransport are retained. Both dispatcher implementations now match main; the reader passes through the shared constructor. A real-socket regression covers SSH bridge credentials with remote control both enabled and disabled. An existing relay-binding validator was moved unchanged into a named module to respect the 300-line limit.

Why

The RPC server already owns the listener, registry and authenticated sockets. Reading that state on demand avoids OS-specific probes, stale copies and accidentally reporting the local machine for a remote request. The read does not create grants or widen network exposure.

A new optional request parameter and result field keep ordinary status lightweight and allow older hosts to omit the block. This does not introduce a protocol opcode, persistence change or new permissions framework.

Two choices remain for maintainer review:

  1. This proposal reports the actual listener, not a separately defined advertisement/configuration flag. Advertisement and external reachability are different facts; neither is inferred from a listener or grant count. Is this sufficient for [Feature]: orca-ide status --json does not show whether the app is advertised as a Remote Orca Server or which clients are connected #25647?
  2. Is allowing runtime-scope peers to read other grants' names, IDs, timestamps and connection counts consistent with the intended trust model? The narrower alternative is local-owner access only.

Linked Issue

Fixes #25647

The closing scope is subject to the advertisement decision above. If a separate sharing/configuration state is required, the implementation or closing linkage must be adjusted before merge.

Visual Proof

No graphical UI changes. Automated built-CLI captures use a real RPC server, temporary HOME/profile, loopback and synthetic grants. Current captures are from head ce7136c6c0c1911907eb387327216f0a54f036f3 (tree 4fdce34e341c4773cf070d8591e55426e150b0f0).

Fixture Current JSON: grants / pending / identities / sockets
Fresh server 0 / 0 / 0 / 0
Unused runtime grant 1 / 1 / 0 / 0
Two sockets for one grant 1 / 0 / 1 / 2
Paired status query using a second grant 2 / 0 / 2 / 3

The listener reports listening, 127.0.0.1 and its allocated port. The querying paired socket is included. Text status and paired open --json do not call the collector. Synthetic credentials are absent from output, and the server port closes after the fixture.

Historical before capture: the built CLI at base c0273b1ff7ba omitted remoteServer. The new base also has no such field by source inspection; a new before CLI capture was not run.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Current head above, macOS arm64, Node 24.16.0, Bun 1.4.2 and pnpm 12.8.1, with ORCA_BACKGROUND_LAUNCH=1 and frozen dependencies:

  • Focused union: 67 files / 651 tests passed; one Windows-only file / six tests skipped. Covers collection, registry validation, real authentication/socket lifecycle, CLI opt-in and ordinary probes, mobile restrictions and SSH routing.
  • Additional RPC dispatcher/streaming/admission coverage: 25 files / 272 tests passed; these overlap the focused union and are not an additional distinct-test total.
  • Mobile recorded-request/capability tests: 2 files / 7 tests passed.
  • Supervisor independently re-ran five core files: 45 tests passed, with identical clean head/tree before and after.
  • pnpm tc:node, pnpm tc:cli, pnpm verify:rpc-params-catalog, changed-code quality against the recorded base, targeted oxlint/oxfmt and git diff --check passed. Catalog regeneration produced no further change.
  • Built CLI: tsc -p config/tsconfig.cli.json --outDir out --composite false --incremental false, then verify-cli-bin.mjs; the global CLI installation hook was not invoked. The real-server smoke above passed.
  • On this head, removing reader forwarding, granting it to mobile, or granting it to SSH bridge credentials each failed the intended regression. Changes were restored and the focused tests passed again. Earlier integration also checked missing opt-in, empty tokens and raw-record leakage; those results remain tied to their earlier tree.
  • Daemon protocol crossing against the verified v1.4.223 commit 5272afeda68c2fe2bbdc3f09159c66688dc27328 passed.

Cross-version suite is not fully green. With that baseline and vitest run --config config/vitest.config.ts tests/e2e/cross-version-wire/ --maxWorkers 2, 174/182 tests passed. Seven failures in qoder-history-search-downgrade and session-search-agent-set-downgrade reproduced with the same assertions on the unmodified new base in a separate clean worktree, using the same command and versions (both comparisons: seven failed / eleven passed). Those failures concern agent-list downgrade expectations and are outside this feature. The eighth case stops before execution because its fixed v1.4.222 tag is absent locally. No tags or tests were changed to bypass it.

A separate source-level check imported the v1.4.223 status handler/parser in-process and accepted the new optional parameter while omitting the new field. It was not a live released-server/client test. Missing-field replies are also covered by CLI tests.

Not run: full unit/lint/desktop build, a live released server with the new status parameter, Windows/Linux, live SSH/Tailscale/cloud relay or manual UI checks. New-head GitHub CI is separate from these local results.

Historical evidence: fork CI attempt 2 passed on de84b652 and its fixed review base, after tag supplementation. Its first-attempt failures and baseline reproductions remain recorded in fork PR #1. Neither that CI nor reviews of ad05c4b4 cover this rebased head.

AI Disclosure

OpenAI Codex implemented the original feature and supervised this integration. Claude Opus 5.5 performed the rebase and verification; Codex independently reviewed the final diff, authorization boundaries, range-diff and logs, and ran the five-file test subset.

Review

The four commit intents are preserved. Supervisor review found no additional feature regression in the reviewed changes; the cross-version failures and untested environments above remain explicit. Maintainer decisions on advertisement scope and runtime metadata access are still pending. Earlier CodeRabbit/Copilot reviews apply only to their recorded revisions, not this head.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

A paired query describes the answering host. SSH bridge and legacy internal routes omit diagnostics rather than substituting another host's state. Counts describe paired identities, not physical devices. Listener state is not an external reachability test. The implementation uses existing in-process state across platforms; cross-platform execution remains unverified.

X: @kambarakun

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

This is one server-to-CLI feature across 26 files, including eight test files. CLI evidence replaces graphical screenshots; full-check success is not claimed.

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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: 8407719d-d145-4875-a4d1-d57b51011eca

📥 Commits

Reviewing files that changed from the base of the PR and between ad05c4b4d0b0e20811a4815d51d966f4f9859b40 and ce7136c.


⛔ Files ignored due to path filters (1)
  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*

📒 Files selected for processing (12)
  • docs/site/content/docs/remote-servers.mdx
  • src/cli/handlers/core.ts
  • src/cli/runtime/websocket-transport.test.ts
  • src/main/runtime/device-registry-relay-binding.ts
  • src/main/runtime/device-registry.ts
  • src/main/runtime/rpc/core.ts
  • src/main/runtime/rpc/dispatcher-stream-options.ts
  • src/main/runtime/rpc/methods/status.ts
  • src/main/runtime/runtime-rpc-remote-server-status-socket-lifetime.test.ts
  • src/main/runtime/runtime-rpc/runtime-rpc-request-admission.ts
  • src/main/runtime/runtime-rpc/runtime-rpc-state.ts
  • src/main/runtime/runtime-rpc/runtime-rpc-websocket-dispatch.ts

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



📝 Walkthrough

Walkthrough

The change adds optional remote-server diagnostics to status output. The runtime reports listener state, validated grant totals and entries, and counts of authenticated clients and their connections. The status RPC exposes the data through an opt-in parameter and limits access by caller scope. The CLI requests diagnostics for JSON status output. Tests cover collection, access boundaries, and default omission. Documentation explains the fields, limits, and unavailable states.


Priority: ➖ Normal

Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to ce713

JSON status remains compatible with older hosts, and the grant count reflects the documented device entries. No issue identified here blocks merging.

Pre-merge checks | Passed 3 | Failed 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check Warning Issue [#25647] requests a status field for whether the app is advertised as a Remote Orca Server. The PR reports listener state, but listener state does not establish advertisement or external reachab… Add a separate field for the configured or advertised server state, or update [#25647] to remove that coding requirement before merge.
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 26 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Out of Scope Changes check Passed The status schema, CLI opt-in, server-state collection, authorization checks, sanitization, transport aggregation, tests, and documentation support [#25647]. The test relocation supports contract cove…
Title check Passed The title clearly and concisely describes the main change: reporting remote server listener, grant, and connected-client status.
Description check Passed The description follows the template and provides complete scope, rationale, linked issue, testing evidence, limitations, security considerations, and review decisions. The Visual Proof section does n…

Full details: Linked Issues check

Explanation

Issue [#25647] requests a status field for whether the app is advertised as a Remote Orca Server. The PR reports listener state, but listener state does not establish advertisement or external reachability. The PR implements the requested listener, grant, and connected-client data, but it does not implement the advertised-state requirement.


Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 26 files. (1 skipped: 1 unsupported.)



  • Fix all pre-merge checks with AI
  • Autopilot · 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.

@kambarakun

Copy link
Copy Markdown
Contributor Author

Two scope decisions for maintainer review:

  1. This PR reports the actual listener, grants, and authenticated connections, but does not add a separate advertisement/configuration flag. Advertisement and external reachability are distinct; a listener alone does not establish that the app is advertised. Is this listener-based scope sufficient for [Feature]: orca-ide status --json does not show whether the app is advertised as a Remote Orca Server or which clients are connected #25647, or should the PR also expose a separately defined sharing/configuration state?

  2. Diagnostics are available to the authenticated local CLI and runtime-scope peers, but not mobile peers. Is exposing other grants' metadata to runtime-scope peers consistent with the intended trust model? If not, the diagnostics reader can be limited to the authenticated local CLI.

I have clarified the PR description to separate advertisement from reachability. Both scope choices remain open for maintainer review; the implementation is unchanged.

Expose bounded server diagnostics only when an authorized CLI requests them. Keep ordinary status probes and mobile responses unchanged, and distinguish unavailable data from an empty registry.
@kambarakun
kambarakun force-pushed the feat/remote-server-status-25647-upstream branch from ad05c4b to ce7136c Compare October 9, 2026 19:40

This branch has not been deployed

No deployments
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.

[Feature]: orca-ide status --json does not show whether the app is advertised as a Remote Orca Server or which clients are connected

1 participant