Skip to content

Fix duplicate paired hosts in worktree run target picker - #10218

Merged
OrcaWin merged 1 commit into
mainfrom
snipefish
Jul 23, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
snipefish

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • remove the duplicate paired-runtime row from the Create worktree “Run on” picker
  • let an authoritative project-host setup replace its repo-derived compatibility fallback using stable host + repo identity
  • preserve the richer routing identity used to keep distinct SSH execution setups behind the same paired runtime
  • add cardinality assertions for regular paired runtimes, nested SSH setups, and local + remote all-host catalogs

The regression came from #9994: authoritative setups gained runtimeOwnerEnvironmentId, while repo-derived fallbacks did not. Using the richer owner key to decide fallback coverage caused both records to survive even though they represented the same setup.

Screenshots

Before — one saved windows 2 runtime and one authoritative setup rendered twice:

Duplicate windows 2 rows

After — no styling changes; the store-level integration oracle requires exactly one authoritative row for this topology.

Testing

  • pnpm lint
  • pnpm typecheck
  • pnpm test
  • pnpm build
  • Added or updated high-quality tests that would catch regressions

Focused and broad validation:

  • red-before / green-after: repos-nested-ssh-projection.test.ts
  • 129 project-host compatibility tests passed across 10 files
  • 157 repo/composer/host-registry tests passed across 22 files
  • post-rebase focused run: 23 tests passed
  • full lint, TypeScript, formatting, reliability manifest, localization, and max-lines ratchet passed

Full-suite note: one run reached 36,509 passing tests with two unrelated relay environment-expectation failures caused by inherited Git config entries; that file passes with a clean Git env. A clean-env rerun reached 36,510 passing tests with one unrelated concurrent E2EE keepalive flake; remote-runtime-client.test.ts passes in isolation (9/9). No failed full-suite test imports or exercises the changed renderer store code.

AI Review Report

The review traced the live topology and confirmed there is one saved runtime, one remote repo, and one authoritative setup. It checked the main regression risks:

  • Nested SSH: distinct executionHostId setups behind one runtime remain separate; the test now asserts exact cardinality of two, with no synthetic third fallback.
  • Older servers: when project-host APIs are unavailable, the repo-derived fallback remains present; existing capability coverage passes.
  • Multi-host catalogs: host identity remains part of fallback coverage, and the all-host test asserts one local plus one remote setup.
  • Authority: fetched project-host metadata remains authoritative; only its compatibility fallback is removed.
  • Performance: merge complexity stays linear and duplicate downstream rows are eliminated.

Cross-platform review found no OS-specific branches, shortcuts, shell behavior, filesystem operations, or path parsing in the change. Windows, macOS, Linux, SSH, and paired-runtime paths remain opaque catalog data; the Windows path shown in the report is not normalized or rewritten.

Security Audit

No new input handling, command execution, filesystem access, auth, secrets, dependencies, IPC, or network behavior. The change only compares already-hydrated in-memory setup identity fields. No follow-up security work is needed.

Notes

Regression risk is low but concentrated in catalog identity. The fix deliberately uses a narrower key only to decide whether an authoritative record covers a repo-derived fallback; authoritative-to-authoritative merging still uses the richer runtime/execution-host identity from #9994. This avoids undoing nested SSH routing while removing the duplicate UI row.

This is client-side and protocol-compatible: updated clients work with both old servers (repo fallback) and current servers (authoritative setup), while older clients can continue showing the duplicate until upgraded.

@OrcaWin
OrcaWin merged commit 84968df into main Jul 23, 2026
2 checks passed
@OrcaWin
OrcaWin deleted the snipefish branch July 23, 2026 20:01
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d8776a05-16dc-4afa-9ca6-e11a65e95a76

📥 Commits

Reviewing files that changed from the base of the PR and between 5dc6799 and 2aadc4e.

📒 Files selected for processing (3)
  • src/renderer/src/store/slices/repos-all-hosts.test.ts
  • src/renderer/src/store/slices/repos-nested-ssh-projection.test.ts
  • src/renderer/src/store/slices/repos.ts

📝 Walkthrough

Walkthrough

Updated project host setup compatibility merging to deduplicate repo-derived setups using host and repository identity. Expanded tests to require exact setup counts and contents, and added coverage confirming that an authoritative paired-runtime setup takes precedence over its repo-derived fallback.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
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