Repository navigation
refactor(renderer): fold four lib callers off the deprecated runtime-owner resolver - #30458
Conversation
…owner resolver Open-in owner, execution-host platform facts, doc-preview grants and the activation PTY inventory read the owner through resolveOwnerWithLegacyFallback. Open in now refuses a twin instead of launching it as this desktop's checkout; the others keep reading a twin as not server-owned. A row whose only repo row is a server proxying its SSH target routes through that server. The creation-action policy stays until browser creation folds with it. Deprecated importers 57 -> 53.
cf01012 to
0aad21a
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
ELI5
Four places in Orca asked the old "which machine owns this workspace?" question. They now ask the new one. For almost every workspace the answer is identical. Two deliberate differences:
What Changed
The callers now read the owner through
resolveOwnerWithLegacyFallback(from #30451), via a newruntimeEnvironmentIdWithLegacyFallbackUnlessTwin:lib/worktree-row-open-in-owner.ts(sidebar "Open in", for rows without a host). A twin is nowownerUnresolved; it used to launch as this desktop's checkout. A row with no placing owner reads as this desktop, as before.lib/execution-host-facts.ts: the server proxying an SSH host's platform facts.lib/doc-preview-grants.ts: a twin still gets no grant.lib/worktree-activation-pty-inventory.ts: a twin still reads as not server-owned.Other details:
client-creation-action-policy.tsstays on the deprecated resolver until browser creation (browser-tab-actions.ts) folds with it. Codex showed that moving one without the other makes a server-proxied SSH row offer a browser tab that creation then refuses.Why
This is batch F1 of the SSH-hardening round 3 design (§6). It uses the read-only lib callers, the lowest-risk tier. Each caller's twin decision is written in its diff.
The other deliberate change is C (§4): a worktree row that lost its server stamp, whose only repo row is a server proxying its SSH target. It now routes through that server, which matches where terminals for that row already spawn.
Linked Issue
None (internal hardening; maintainer PR). Stacked on #30451. Its base is that branch, and it retargets to
mainwhen #30451 merges.Visual Proof
N/A: no UI change beyond Open-in refusing a twin, which is the existing unresolved-owner state.
Testing
New behaviour tests in
worktree-row-open-in-owner.test.ts. Both fail on main:hub-env.doc-preview-grants.test.tsgains a twin case.Every suite that mocks
worktree-runtime-owner(73 files) passes. The mocks on the folded paths name the new helper.Unit tests, single worker:
src/renderer/src/lib,components,runtimeandstore(4,651 files, before the clean-code tidy), plus the 78 affected suites after it.Full local pr.yml static job: 0 failures.
The managed-orcad Docker lane is dispatched on this head; the link is added when green.
Codex review (
gpt-6.1-sol, high):missingmust read as before. Fixed.I manually tested these changes locally
Automated tests added/updated, or explained why not below