Repository navigation
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughServe-mode initialization now registers SSH handlers without a BrowserWindow before the runtime RPC server starts. Runtime RPC methods support SSH target management, directory browsing, remote repository addition, and SSH-aware nested repository scans. Renderer flows select desktop IPC or environment-scoped runtime RPC based on the selected host, with updated UI states, localization, and tests. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
|
Additional packaged validation on the PR head (
The prior AppImage and server profile were backed up before deployment. |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/renderer/src/components/cmd-j/quick-action-context.ts (1)
91-97: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse
isPairedWebClientWindow()helper instead of inlining the paired-web-client check.The inline
Boolean((globalThis as { __ORCA_WEB_CLIENT__?: boolean }).__ORCA_WEB_CLIENT__)duplicates the detection logic already centralized inisPairedWebClientWindow()from@/lib/desktop-window-chrome, whichuseGitStatusPolling.tscorrectly imports. Using the helper keeps a single source of truth for the type assertion and detection semantics.♻️ Proposed refactor
import { getExplicitRuntimeEnvironmentIdForWorktree } from '`@/lib/worktree-runtime-owner`' import { selectRuntimeAwareSshStatus } from '`@/store/slices/runtime-environment-ssh`' +import { isPairedWebClientWindow } from '`@/lib/desktop-window-chrome`'- const isPairedWebClient = Boolean( - (globalThis as { __ORCA_WEB_CLIENT__?: boolean }).__ORCA_WEB_CLIENT__ - ) - const sshOwnerEnvironmentId = isPairedWebClient - ? null - : getExplicitRuntimeEnvironmentIdForWorktree(state, activeWorktree.id) + const sshOwnerEnvironmentId = isPairedWebClientWindow() + ? null + : getExplicitRuntimeEnvironmentIdForWorktree(state, activeWorktree.id)
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 0d8e5dad-d709-4777-a008-05b4a119d401
📥 Commits
Reviewing files that changed from the base of the PR and between 8ec3ab9d60da04d1e7b3994c1412090d5ae593d4 and 369433f7eb4e1d3f60bfd8e84643eb6ef8d8a28b.
📒 Files selected for processing (24)
src/renderer/src/components/cmd-j/quick-action-context.tssrc/renderer/src/components/right-sidebar/useGitStatusPolling.tssrc/renderer/src/components/sidebar/ForgetSshWorkspaceDialog.tsxsrc/renderer/src/components/sidebar/SshDisconnectedDialog.tsxsrc/renderer/src/components/sidebar/WorktreeCard.tsxsrc/renderer/src/components/sidebar/WorktreeList.tsxsrc/renderer/src/components/sidebar/delete-worktree-flow.tssrc/renderer/src/components/sidebar/runtime-aware-ssh-workspace-forget.tssrc/renderer/src/components/sidebar/ssh-workspace-forget-resolution.test.tssrc/renderer/src/components/sidebar/ssh-workspace-forget-resolution.tssrc/renderer/src/components/terminal-pane/pty-connection.tssrc/renderer/src/components/terminal-pane/ssh-pane-connect-gate.test.tssrc/renderer/src/components/terminal-pane/ssh-pane-connect-gate.tssrc/renderer/src/hooks/useAutomationDispatchEvents.tssrc/renderer/src/hooks/useComposerState-host-context-boundaries.test.tssrc/renderer/src/hooks/useComposerState.tssrc/renderer/src/hooks/useDetectedAgents.tssrc/renderer/src/lib/runtime-agent-detection-key.tssrc/renderer/src/runtime/runtime-environment-ssh-state.test.tssrc/renderer/src/runtime/runtime-environment-ssh-state.tssrc/renderer/src/store/slices/detected-agents.test.tssrc/renderer/src/store/slices/detected-agents.tssrc/renderer/src/store/slices/terminals.tssrc/renderer/src/store/slices/worktrees.test.ts
|
Follow-up packaged E2E validation on the composite-routing fix (
The installed-build failure is now covered by regression tests for the composer route and the downstream nested-runtime boundaries. |
d5647d5 to
eddde1d
Compare
|
Final review follow-up on current head
Both inline review threads are resolved, with implementation/test details replied in-thread. |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@OrcaWin, would #8492 be easier to review and land if I split it into smaller staged PRs? The current PR spans three layers, and I can separate it into:
I’m happy to keep the current PR as-is or restructure it based on your preference. |
Merges stablyai#8492 (fix(ssh): enable server-owned SSH projects in paired clients) on top of an upstream/main sync, resolving conflicts against later upstream work in the same SSH/runtime area (STA-1468 desktop topology, the AddRemoteHostDialog panel refactor, the WorktreeCardSshHostControl pill that replaced SshDisconnectedDialog, and folder-workspace-aware automation dispatch). Notable non-mechanical resolutions: - runtime-detected-agents.ts: extended with connectionId-aware composite keys instead of duplicating state in detected-agents.ts (would have silently shadowed in the store's slice spread order). - add-remote-host-ssh-actions.ts / AddRemoteHostSshFormPanel.tsx: threaded an optional server-owner routing through the shared save/import helpers so PR 8492's server-owned flow rides HEAD's later dialog refactor instead of reverting it. - WorktreeCard.tsx: dropped PR 8492's SshDisconnectedDialog render (and the now-orphaned component/test files) in favor of the newer inline WorktreeCardSshHostControl pill, which already carries owner-aware reconnect logic. - useAutomationDispatchEvents.ts: layered runtime-owner-aware SSH connect onto HEAD's folder-workspace-aware target resolution, scoping runtime ownership to the repo case since folder workspaces resolve their SSH target independently. Verified with `pnpm run typecheck` (node/cli/web projects, clean) and `oxlint` on every manually resolved file (clean). Could not run `vitest` in this environment — the repo's vitest config passes `--no-experimental-webstorage`, which requires Node 24+ and this sandbox has Node 20.19. Co-Authored-By: Claude Sonnet 5 <[email protected]>
… client addSshTargetForOwner/importSshConfigForOwner reached for window.api.ssh directly on the local (owner=null) path, bypassing the ssh client that add-remote-host-ssh-actions.ts's callers inject for testability. Every test in add-remote-host-ssh-actions.test.ts that exercised the local save/import path threw on window.api being undefined and silently returned 'failed'. The bug isn't in PR stablyai#8492 as authored — that PR's AddRemoteHostDialog.tsx called window.api.ssh directly with no injected-client pattern; the shared save/import helpers with an injected ssh client are a newer upstream file this fork's Aug-5 merge had to thread PR 8492's server-owned flow onto, and the threading dropped the injection for the local branch. Adds an optional addLocalTarget/importLocalConfig parameter defaulting to window.api.ssh.* (so runtime-ssh-target-management.test.ts's existing window-stubbing tests are unaffected) and passes ssh.addTarget/ ssh.importConfig through explicitly from the one production call site.
|
Thank you, @jae-heo. This PR mapped the whole problem in #8489 and showed a working path through it. It is now superseded by two merged PRs on current
Headless Closing as superseded, with credit in both PR descriptions. Thanks again for the thorough write-up and the live repro. |
Summary
orca serveruntime accepts requests.Desktop → paired runtime → SSH host), including connect/status, agent detection, terminals, worktree creation, polling, deletion, and automation dispatch.Fixes #8489.
Screenshots
This change reuses Orca's existing Add Project, host selector, Add SSH Host, and Remote File Browser surfaces instead of introducing a standalone screen. Visible changes are contextual:
<server>makes ownership explicit;An end-to-end static screenshot would require committing pairing credentials or server state, so the conditional UI and routing are covered by renderer tests instead.
Testing
pnpm lintpnpm typecheckpnpm test(29,137 passed, 40 skipped)AI Review Report
Reviewed the headless and desktop startup paths, SSH manager lifecycle, runtime RPC ordering, environment-scoped renderer routing, repository persistence, and the null-
BrowserWindowpath. The review covered macOS, Linux, and Windows behavior; local, paired-server, and SSH execution hosts; POSIX and PowerShell remote directory browsing; nested repository scanning; session creation dependencies; and unchanged local Desktop flows.The implementation reuses existing SSH, Git, filesystem, PTY, repository, and UI primitives. Server-scoped actions are selected only when a runtime environment owns the operation; local SSH IPC remains the fallback. Tests verify server and local routing, SSH target management, connection/browse behavior, remote repository creation, nested scans, and startup registration order.
CodeRabbit follow-up review was addressed by keeping failed runtime reconnect dialogs open, bounding runtime agent detection to 30 seconds, and reusing the centralized paired-client detector. Dedicated dialog tests cover unsuccessful and successful runtime reconnect results.
Security Audit
Reviewed RPC authorization, input validation, target ownership, paths, credentials, command construction, secrets, dependencies, and mobile exposure.
MOBILE_RPC_METHOD_ALLOWLIST, so phone/mobile pairing cannot manage server SSH targets or add server projects.ownerfields and config-derived proxy/jump fields cannot be injected by the client.No follow-up security work was identified.
Notes
ssh_handlers_not_registeredwhile direct SSH connectivity worked.ssh-p8; the fixed build routes it through the owning runtime RPC instead.ELI5
Paired desktop clients can now add and use SSH projects that live on an Orca remote server. You pick the server, add or import an SSH host, browse folders, and create the project without doing that only on the server machine itself.