Skip to content

refactor(renderer): no client SSH operation arms in project creation or native chat - #27593

Merged
OrcaWin merged 2 commits into
mainfrom
OrcaWin/p399-C4
Oct 11, 2026
Merged

OrcaWin merged 2 commits into
mainfrom
OrcaWin/p399-C4

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

Since the old SSH relay was removed, a project on an SSH host lives on the Orca server that Orca runs on that host. In Add Project and in chat, the app still had code paths that tried to do the work over SSH from this computer. Those paths always failed. This PR removes them. SSH hosts now work in two ways only: you connect them, or you work through their server.

What Changed

Add Project dialog

  • canSelectAddRepoHost refuses SSH rows. An SSH row can still be connected. Once connected, the host's server row is what you pick.
  • Bug fix: right after a connect, before the server list has loaded, a connected SSH host could appear as its own row. Picking it sent the clone, create or add to this computer's SSH path, which failed. Now that row holds the dialog's actions disabled until the server row stands for it. It never falls back to this computer. A disconnected SSH host that was asked for also stays displayed and blocked instead of switching to Local.
  • Removed the client-SSH arms: cloneRemote (clone flow), createRemote (create flow), the local addRemote remote step (target list, local connect, nested scan, "Add in Settings"), the SSH browse arm, SSH-only copy and the always-true canCreateProject/isSshLikely/showRemoteAction props. Also removed use-add-repo-remote-nested-scan.ts and handleOpenSshSettings.
  • The "project on this server's SSH host" step (serverEnvironmentId → addRuntimeSshRepo) is unchanged. It is now the only way to reach the remote step. If that server goes away while the remote step is open, the start step renders instead of an empty body.
  • Folder flow: NonGitFolderDialog adds an SSH folder only through its server (addRuntimeSshRepo). If it has an SSH id but no server, it shows today's error (SSH connection "…" not found or not connected) and adds nothing on this computer. AddProjectFromFolderDialog loses its addRemote arm. The file explorer no longer offers "Add as project" inside an ssh:-owned folder. That arm could only fail, and it must not fall through to a local add.
  • setupProjectClone (Settings › Repository hosts and Set Project Location) on an ssh: host now throws that same text before any clone. Before, it called cloneRemote, which failed with that text.

Native chat

  • Removed NativeChatSshAttachmentOwner and uploadNativeChatAttachmentPaths. An ssh:-owned chat resolves to the owner that refuses client files: { kind: 'remote' }, renamed from 'runtime'. It shows "Local attachments are not available for remote sessions." Before, it tried an upload that failed with a connection error.
  • The clipboard-image save, paste settle and paste lifetime lose their SSH arms. The owner-unchanged check is now kind equality.
  • Internal workspace-file drops on an ssh: host still tag paths with the host's target id, so they are never read as client files.
  • Transcript images: an ssh: route with no server returns no context, so nothing is read. Nested server SSH hosts are unchanged.
  • Corrected the stale comment in runtime-client-target.ts about direct SSH riding this app's IPC.

Other

  • Removed 14 locale keys that nothing references any more, in all 6 locales plus the Korean overrides.
  • Telemetry: adding a project on a server's SSH host no longer emits add_repo_nested_scan_result with scan_failed. No scan runs there, so that event was a misreport.

Net lines: production −577 (+277/−854), tests −1090 (+278/−1368), locales −93.

Left for B3, which owns main and preload: deleting the repos:cloneRemote/createRemote/addRemote handlers and their preload and web API, and the nested-import connectionId plumbing into importNestedRepos. The renderer no longer produces a connectionId for it.

Why

This is Phase 3.99 C4 (design K19 / UI survey F1). Every arm removed here always failed. ssh-connect-flow never yields a client SSH workspace, and registerSsh{Git,Filesystem}Provider has no production caller. Keeping the arms meant a host picker that could choose a row that then failed, and Add Project code that every new flow had to copy. I considered keeping SSH rows pickable and routing them to the server, but that is new routing behaviour (design D-1, deferred). The plan chose a refusal, which matches today's error text. Wherever a removed arm could otherwise have fallen through to this computer, it refuses or blocks instead.

Linked Issue

Maintainer PR. Part of Phase 3.99 (stack entry C4, Wave 1).

Visual Proof

N/A. The only visible changes are on paths that already failed: an un-merged SSH row is disabled instead of selectable, the file-explorer "Add as project" item is hidden in relay-era ssh: folders, and SSH chat attachments show the remote-session notice instead of a connection error.

Testing

  • Dead-code proof: rg over src, config, tests and mobile, including the 159 @ts-nocheck files, finds no remaining reference to NativeChatSshAttachmentOwner, uploadNativeChatAttachmentPaths, useAddRepoRemoteNestedScan, selectedSshTargetId, lockSshTargetSelection, isScanningRemoteNested, stopRemoteNestedScan, handleOpenSshSettings, isSshLikely, showRemoteAction, canCreateProject, browseSsh or the removed locale keys. pnpm run build:electron-vite passes. The change is renderer-only, so CLI and orcad bundles are unaffected.

  • pnpm tc, pnpm lint (all ratchets at baseline; focus-read stays at 1138), oxlint, pnpm run check:code-quality:changed (0 new).

  • Focused tests: native-chat, sidebar, right-sidebar, new-workspace and the repo-slice suites (1043 files, 9559 tests). One timing test in ai-vault-session-worktree-map failed once under load and passed on rerun.

  • New and updated tests:

    • Host selection: an SSH row is never selected, a connected-but-unmerged SSH row blocks the actions instead of falling back to Local, and the server row is taken once merged.
    • useRemoteRepo with no server never lists, connects or adds.
    • Folder workspace on a server's SSH target goes through addRuntimeSshRepo, with the requested display name and duplicate repo IDs. This is a mocked server; no live older server was run. The same folder with no server refuses with today's text and adds nothing locally.
    • setupProjectClone on ssh: refuses before any clone.
    • The file-explorer action is hidden for ssh: folders.
    • Chat attachment owners for SSH resolve to remote.
    • Transcript images read nothing for an ssh: route with no server.
  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Review

Self-review and an independent reviewer (GPT-6.1 Sol, high) both found no P0/P1 on b7a1e71b4d. Reports: .build/runtime-strategy/phase399/reviews/C4-self.md and C4-codex.md.

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

  • Remote SSH: managed SSH hosts are paired runtimes and use the server path, which is unchanged. No removed arm becomes local execution: an unresolved host blocks the dialog, and the store and folder dialog refuse with today's text.
  • Folder workspaces: the server's SSH folder path is kept and tested.
  • Wire: no change. The renderer to main IPC ships in one build, and modal data and web stubs stay client-local.
  • Windows and WSL: unaffected.

@OrcaWin
OrcaWin requested a review from brennanb2025 as a code owner October 11, 2026 21:27
@coderabbitai

coderabbitai Bot commented Oct 11, 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: d3583e92-a51b-448b-aa2c-80f3374a10cb


📥 Commits

Reviewing files that changed from the base of the PR and between 50b3d2e and b7a1e71.



📒 Files selected for processing (66)
  • config/scripts/locale-ko-key-overrides.json
  • src/renderer/src/components/native-chat/NativeChatComposer.paste-remount.test.tsx
  • src/renderer/src/components/native-chat/native-chat-attachment-upload.test.ts
  • src/renderer/src/components/native-chat/native-chat-attachment-upload.ts
  • src/renderer/src/components/native-chat/native-chat-clipboard-image-save.ts
  • src/renderer/src/components/native-chat/native-chat-composer-drop-scope.test.tsx
  • src/renderer/src/components/native-chat/native-chat-composer-ime-file-drop.test.tsx
  • src/renderer/src/components/native-chat/native-chat-composer-workspace-file-drop.test.tsx
  • src/renderer/src/components/native-chat/native-chat-external-attachments-destination.test.tsx
  • src/renderer/src/components/native-chat/native-chat-image-runtime-context.test.ts
  • src/renderer/src/components/native-chat/native-chat-image-runtime-context.ts
  • src/renderer/src/components/native-chat/native-chat-resolved-path-ownership.test.ts
  • src/renderer/src/components/native-chat/native-chat-resolved-path-ownership.ts
  • src/renderer/src/components/native-chat/use-native-chat-composer-paste.test.tsx
  • src/renderer/src/components/native-chat/use-native-chat-composer-paste.ts
  • src/renderer/src/components/native-chat/use-native-chat-external-attachments.test.tsx
  • src/renderer/src/components/native-chat/use-native-chat-external-attachments.ts
  • src/renderer/src/components/native-chat/use-native-chat-menu-paste-lifetime.test.tsx
  • src/renderer/src/components/native-chat/use-native-chat-paste-lifetime.test.tsx
  • src/renderer/src/components/native-chat/use-native-chat-paste-lifetime.ts
  • src/renderer/src/components/native-chat/use-native-chat-workspace-file-drop.ts
  • src/renderer/src/components/right-sidebar/file-explorer-add-project-action.test.ts
  • src/renderer/src/components/right-sidebar/file-explorer-add-project-action.ts
  • src/renderer/src/components/sidebar/AddProjectFromFolderDialog.test.tsx
  • src/renderer/src/components/sidebar/AddProjectFromFolderDialog.tsx
  • src/renderer/src/components/sidebar/AddRepoCloneStep.tsx
  • src/renderer/src/components/sidebar/AddRepoCreateStep.tsx
  • src/renderer/src/components/sidebar/AddRepoDialog.tsx
  • src/renderer/src/components/sidebar/AddRepoDialogStepContent.test.tsx
  • src/renderer/src/components/sidebar/AddRepoDialogStepContent.tsx
  • src/renderer/src/components/sidebar/AddRepoRemoteStep.tsx
  • src/renderer/src/components/sidebar/AddRepoStartSteps.test.tsx
  • src/renderer/src/components/sidebar/AddRepoStartSteps.tsx
  • src/renderer/src/components/sidebar/AddRepoSteps.default-checkout.test.ts
  • src/renderer/src/components/sidebar/AddRepoSteps.tsx
  • src/renderer/src/components/sidebar/CreateProjectLocationField.tsx
  • src/renderer/src/components/sidebar/NonGitFolderDialog.test.tsx
  • src/renderer/src/components/sidebar/NonGitFolderDialog.tsx
  • src/renderer/src/components/sidebar/add-repo-browse-authority.test.ts
  • src/renderer/src/components/sidebar/add-repo-browse-authority.ts
  • src/renderer/src/components/sidebar/add-repo-host-availability.ts
  • src/renderer/src/components/sidebar/add-repo-local-start-actions.ts
  • src/renderer/src/components/sidebar/add-repo-store-upsert.ts
  • src/renderer/src/components/sidebar/clone-defaults.test.ts
  • src/renderer/src/components/sidebar/clone-defaults.ts
  • src/renderer/src/components/sidebar/use-add-repo-host-selection.test.ts
  • src/renderer/src/components/sidebar/use-add-repo-host-selection.ts
  • src/renderer/src/components/sidebar/use-add-repo-hosted-controller.test.ts
  • src/renderer/src/components/sidebar/use-add-repo-hosted-controller.ts
  • src/renderer/src/components/sidebar/use-add-repo-remote-nested-scan.ts
  • src/renderer/src/components/sidebar/useAddRepoCloneFlow.test.ts
  • src/renderer/src/components/sidebar/useAddRepoCloneFlow.ts
  • src/renderer/src/components/sidebar/useAddRepoNestedReviewController.ts
  • src/renderer/src/components/sidebar/useCreateProjectDefaults.test.ts
  • src/renderer/src/components/sidebar/useCreateProjectDefaults.ts
  • src/renderer/src/components/sidebar/useCreateRepo.default-checkout.test.ts
  • src/renderer/src/components/sidebar/useCreateRepo.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/runtime/runtime-client-target.ts
  • src/renderer/src/store/projects/project-host-setup-actions.ts
  • src/renderer/src/store/slices/repos.test.ts


💤 Files with no reviewable changes (5)
  • src/renderer/src/components/sidebar/useCreateProjectDefaults.test.ts
  • src/renderer/src/components/sidebar/clone-defaults.test.ts
  • config/scripts/locale-ko-key-overrides.json
  • src/renderer/src/components/sidebar/use-add-repo-remote-nested-scan.ts
  • src/renderer/src/components/sidebar/add-repo-browse-authority.ts


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




📝 Walkthrough
📝 Walkthrough

Walkthrough

The change removes direct SSH-host repository and native-chat attachment paths. Native-chat ownership now uses local, remote, runtime-session, and not-ready states. SSH-specific uploads, clipboard saves, and connection metadata are removed. Repository creation, cloning, browsing, and folder import now use local or paired-server runtime paths. Related tests and localization entries were updated.



Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to b7a1e

The change removes client-side SSH paths from project creation and native chat attachments, and routes SSH operations through the paired server. No concrete merge-blocking risk was found in the supplied context.

Pre-merge checks | Passed 4 | Inconclusive 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage Inconclusive Docstring coverage is 23.68% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 38 functions across 50 files. (11 skipped… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check Passed The title clearly and concisely describes the main change: removing client-side SSH operation paths from renderer project creation and native chat.
Description check Passed The description covers the required sections and provides clear user-facing changes, rationale, testing evidence, visual-proof justification, review notes, and compatibility considerations. The unchec…

Full details: Docstring Coverage

Explanation

Docstring coverage is 23.68% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 38 functions across 50 files. (11 skipped: 6 unsupported, 5 over the file limit.)


✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR



🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
  • 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.

@OrcaWin
OrcaWin merged commit 6dafde4 into main Oct 11, 2026
49 of 51 checks passed
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.

1 participant