Skip to content

fix(renderer): say which saved servers are the same machine paired twice, and how to fix it - #31100

Merged
nwparker merged 4 commits into
mainfrom
nwparker/duplicate-server-message
Oct 20, 2026
Merged

nwparker merged 4 commits into
mainfrom
nwparker/duplicate-server-message

Conversation

@nwparker

@nwparker nwparker commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​225 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​224
Prod 13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​208 $\color{#cf222e}{\Huge{\mathbf{−}}}$​17 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​191

ELI5

If the same Orca server got saved twice, every edit to its workspaces failed with a vague "ambiguous" error that refreshing never fixed. Now the error names the two saved entries and says to remove one, and Settings marks both entries.

What Changed

Before: a write to a workspace two saved servers published was refused with "Workspace identity is ambiguous across hosts. Refresh projects and try again." When the two entries were the same machine paired twice, refreshing never helped, and nothing pointed at the real fix: removing one entry.

After:

  • When every host publishing the workspace is a saved server, they all share one host key, and they publish it at the same place, the refusal reads: "Studio and Studio relay are the same server paired twice. Remove one in Settings > Remote Orca Servers." This applies to remove, preserved-branch cleanup, owner resolution and terminal input.
  • In every other ambiguity, the generic message stays. That includes two different servers, a twin plus another host, twins proxying two different SSH targets, and a caller that already named a host.
  • Settings > Remote Orca Servers: each duplicate entry shows a destructive-colored line, "Same server as , paired twice. Remove one so its projects can be edited." Existing users with duplicates find the fix without hitting an error first.

Mechanism: a new src/renderer/src/lib/duplicate-paired-servers.ts reads the rows that publish the workspace. These are repo worktree rows, detected worktrees, and folder workspaces (including folders that inherit their host from a project group). It compares the renderer's existing per-server hostKeyFingerprint, which main already publishes as a digest of the host key the pairing handshake proves. Every throw site that used the generic constant now calls ambiguousWorkspaceOwnerMessage.

Why

  • Ambiguity has several causes, and only the duplicate case has a one-step fix, so the specific advice is shown only when removing one entry would actually end the refusal. Every other case keeps the existing text.
  • Fingerprint, not name or address: the same machine shows up under different names and addresses. Two different machines never share a host key.
  • Client-side only. Nothing changes on the wire or in what the host publishes.
  • PR fix(pairing): adding a server you already saved updates it instead of saving it twice #31080 stops new duplicates. This PR is the way out for users who already have them.

Linked Issue

N/A (internal follow-up from the SSH reliability review)

Visual Proof

Settings > Remote Orca Servers in a hidden renderer (ORCA_BACKGROUND_LAUNCH=1, CDP screenshot), with an isolated profile seeded with two saved servers sharing one host key:

Settings marks both duplicate entries

Testing

  • New tests:

    • src/renderer/src/lib/duplicate-paired-servers.test.ts: twins named; generic for different servers, a twin plus another host, twins over two SSH targets, a single publishing twin, and unknown keys; folder and project-group inheritance.
    • src/renderer/src/store/slices/worktrees-duplicate-server-removal.test.ts: the removal refusal text through the real store; a named host keeps the generic text.
    • runtime-server-row-unverifiable-host.test.tsx: the Settings marker.
  • New tests fail on origin/main (they expect the new message, marker or module).

  • Locally: pnpm tc; the static-analysis job steps; src/renderer/src/lib, src/renderer/src/components/settings, src/renderer/src/store/slices and the pty-connection folder, single worker.

  • Verified live: the Settings marker, in the hidden-renderer screenshot above. The refusal text is covered only in tests.

  • I manually tested these changes locally

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

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 15d0218f-ee59-4231-a092-0dcb01bcbaea
📥 Commits

Reviewing files that changed from the base of the PR and between c633177 and 021ce51.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

The change adds detection for saved server entries that share a host-key fingerprint. Settings rows display a warning with the other server’s name when a duplicate is found. Workspace-owner lookup, terminal input recovery, and worktree-removal paths use a contextual ambiguity message when duplicate servers own the workspace. Tests cover duplicate detection, Settings warnings, and removal behavior. English, Spanish, French, Japanese, Korean, and Simplified Chinese locale strings are added.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: 🔵 Low · up to c6331

Some duplicate-server configurations may give misleading removal guidance. The change is mergeable with owner awareness, though these messages should be corrected.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 56.25% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 10 files. (6 skipped:… 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: identifying duplicate saved servers and explaining how users can fix the issue.
Description check Passed The description covers the user impact, behavior changes, implementation mechanism, rationale, visual proof, and testing. It also distinguishes duplicate-server ambiguity from other ambiguity cases. T…
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.
Full details: Description check

Explanation

The description covers the user impact, behavior changes, implementation mechanism, rationale, visual proof, and testing. It also distinguishes duplicate-server ambiguity from other ambiguity cases. The linked issue is marked N/A with an internal follow-up explanation, and the automated testing checkbox is selected.

Full details: Docstring Coverage

Explanation

Docstring coverage is 56.25% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 10 files. (6 skipped: 6 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ 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.

@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: 2


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e6b5c456-8e1f-4e7a-a586-8797a138818d
📥 Commits

Reviewing files that changed from the base of the PR and between 63246eb and c633177.

📒 Files selected for processing: 16
  • src/renderer/src/components/settings/runtime-server-row-unverifiable-host.test.tsx
  • src/renderer/src/components/settings/runtime-server-row.tsx
  • src/renderer/src/components/settings/runtime-servers-connect-section.tsx
  • src/renderer/src/components/terminal-pane/pty-connection/pty-input-recovery.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/lib/duplicate-paired-servers.test.ts
  • src/renderer/src/lib/duplicate-paired-servers.ts
  • src/renderer/src/store/slices/worktrees-duplicate-server-removal.test.ts
  • src/renderer/src/store/slices/worktrees/listing/worktree-owner-target.ts
  • src/renderer/src/store/slices/worktrees/teardown/force-delete-preserved-branch.ts
  • src/renderer/src/store/slices/worktrees/teardown/host-qualified-worktree-removal.ts

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

Comment on lines +122 to +124
const [first, second] = environments
const key = first?.hostKeyFingerprint
if (!first || !second || !key) {

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Handle more than two pairings before advising users to remove one.

If three saved entries share a fingerprint and publish the workspace at one location, this function names only the first two. The message says to remove one, but two publishers will remain. Require exactly two publishers for this message, or name all entries and tell users to remove the extras. Update the Settings warning for the same case.

// on screen.
get().clearWorktreeDeleteState(worktreeId)
return { ok: false, error: WORKTREE_REMOVAL_AMBIGUOUS_ERROR }
return { ok: false, error: ambiguousWorkspaceOwnerMessage(get(), worktreeId) }

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep the generic refusal for a host-qualified removal.

If requiredExecutionHostId is set and route resolution fails, this branch can still return the duplicate-pairing message. That differs from the host-qualified owner lookup and the stated rule for callers that named a host. Use the generic ambiguity error when requiredExecutionHostId is set.

@nwparker
nwparker merged commit 41b219d into main Oct 20, 2026
45 checks passed
nwparker added a commit that referenced this pull request Oct 20, 2026
… into the new server list

Ports #31099 and #31100 into the redesigned rows, install dialog and SSH
host dialogs.
nwparker added a commit that referenced this pull request Oct 20, 2026
…k remove that stays removed (#31082)

* feat(settings): one-list Remote Orca Servers page and bulk-manageable SSH Hosts

Remote Orca Servers: replace the three mode cards, Advanced fold, duplicate
managed/SSH-access lists and troubleshooting accordion with a single list
(one row per server: status, one action, overflow menu), an always-visible
'New projects open on' row, and Share / Cloud VM cards that open dialogs.

SSH Hosts: group by source, filter, checkbox + shift-range selection, one
confirm for bulk remove (skipping hosts with a managed server or
workspaces), bulk Test. 'Sync ~/.ssh/config' no longer clears removal
tombstones; 'Restore removed hosts (n)' is a separate confirmed action.

* fix(settings): address review findings on servers and SSH hosts redesign

- SSH filter stays clearable when the list shrinks under the threshold
- Cmd/Ctrl-A only selects hosts when pressed in the list itself
- group legacy no-source hosts with main's import predicate (now shared)
- capture the shift-range anchor before queuing the selection update
- blank server names de-duplicate instead of colliding
- Share dialog Done refreshes link count and resets name editing
- Install / SSH-route dialogs reload SSH hosts when opened
- default-host row shows the selector when the default is a WSL host
- managed 'Not running' no longer masks connecting/revoked/update states
- servers without a dropped transport can be re-checked

* test(e2e): WSL host spec matches repo.rm ending a removed project's shells

repo.rm now stops the project's terminals on the host (#29964), so the
'orphan left by older builds' setup can no longer be built; use a shell
only the host knows of instead. Resolve the project path so macOS
/private/var matches what the host reports.

* fix(settings): carry 'Orca on <host>' naming and paired-twice warning into the new server list

Ports #31099 and #31100 into the redesigned rows, install dialog and SSH
host dialogs.

* test(e2e): keep the WSL spec's project path as created
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