Skip to content

Per-Workspace Environments (on-demand disposable runtimes) + Add Project remote host setup - #6320

Merged
Jinwoo-H merged 67 commits into
mainfrom
Jinwoo-H/vm-improve-2
Jun 30, 2026
Merged

Jinwoo-H merged 67 commits into
mainfrom
Jinwoo-H/vm-improve-2

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds Per-Workspace Environments (formerly "Ephemeral VMs"): repo-owned recipes that provision an on-demand, disposable runtime — a cloud sandbox, a VM, or a local container — fresh for each workspace and torn down after. Orca stays a thin wrapper: it sequences setup, detects what's detectable, scaffolds provider-templated lifecycle scripts, and drives validation; it never owns the user's cloud account, images, or credentials.

This branch also includes an earlier improvement to the Add Project remote-host setup flow (first commit on the branch).

Per-Workspace Environments

  • vmRecipes in orca.yaml with a create / suspend / resume / destroy lifecycle contract; recipes surface in the New Workspace composer under a "Run on" → Per-Workspace Environment submenu.
  • Two connection modes:
    • Orca server — the runtime runs orca serve and Orca pairs over its pairing URL (registered as a runtime environment).
    • SSH — Orca connects to the runtime over a hidden, runtime-owned SSH target + relay. These targets are kept out of every user-facing SSH / run-target / status surface.
  • Provisioning UX — an in-frame "Provisioning VM" view streams live recipe output in a fixed-height, auto-scrolling log (pins to the tail unless the user scrolls up), with a Cancel control. On failure it keeps the same layout and surfaces the captured recipe output so the user can see why it failed and Retry/Dismiss.
  • Lifecycle — sleep/wake maps to recipe suspend/resume (gracefully skipped when a recipe defines no suspend hook); deleting a workspace or removing the project tears down the backing runtime and its hidden SSH target, and purges the orphaned runtime-backed project so it can't linger as a dead, never-connectable entry.
  • Project grouping — runtime-backed repo copies are grouped under their canonical project identity, and runtime-owned SSH repos are excluded from the composer's project picker (so creating one keeps the composer on the source project rather than resetting it).
  • orca vm recipe doctor — a free static check plus a --provision live self-test loop (create → validate → destroy) that returns a full transcript so an agent can diagnose and fix recipes itself.
  • orca-per-workspace-env agent skill — drives first-time setup end to end (prerequisites → reusable base snapshot → coding-agent auth snapshot → state file → per-workspace scripts), with worked examples (Vercel Sandbox, existing SSH host, local Docker SSH, Windows).
  • Cross-platform (macOS / Linux / Windows) lifecycle handling, and web-client build kept clean (Node-only recipe-doctor stays out of the browser bundle).

Add Project remote host setup (earlier work on this branch)

  • Inline reconnect actions for disconnected SSH hosts in the Add Project host picker.
  • An in-flow "Add remote host" menu with SSH host and remote Orca-server setup dialogs.
  • Import ~/.ssh/config from the SSH setup dialog; refresh host metadata after saves/imports.

Notable behavior / limitations

  • The composer reads vmRecipes from the project's primary checkout of orca.yaml, so a recipe added only on a branch won't appear in the picker until it's merged to primary (doctor/--provision still validate from the working copy on any branch).
  • On client disconnect (network drop / app quit), the remote runtime keeps running — Orca has no quit-time or idle auto-suspend; suspend/destroy are user-triggered (or provider/recipe-driven). Network blips auto-reconnect; terminal-session resume across a blip depends on the recipe's relayGracePeriodSeconds.

Validation

  • Typecheck (node/cli/web) and oxlint clean across the changed surface.
  • Focused unit tests for: composer repo/host selection and runtime-owned-SSH exclusion, the new-workspace SSH gate, runtime cleanup on delete/project-removal, the active-worktree focus-after-delete handoff, the provisioning panel (provisioning / failure / Cancel / auto-scroll), and recipe parsing/doctor.
  • Live end-to-end pass against a local Docker SSH recipe: create → terminal connects over SSH → sleep/wake → delete, with the runtime cleaned up and no leaked SSH targets, blank panes, stale toasts, or dead connect cards.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds ephemeral VM recipe parsing, doctoring, provisioning, runtime storage, CLI, IPC, preload, settings, composer, worktree, and trust flows, plus remote host selector and dialog updates with SSH connect and add-server actions.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 1.52% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description covers summary and validation, but it omits required template sections for screenshots, AI review report, security audit, and notes. Add the missing Screenshots, AI Review Report, Security Audit, and Notes sections, or explicitly state when no visual change applies.
✅ Passed checks (3 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 matches the main changes: per-workspace environments and add project remote host setup.

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: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 90cb604f-34dc-4514-8f99-d7d1ccd02f3f

📥 Commits

Reviewing files that changed from the base of the PR and between 634a1b2 and 035fbe7.

📒 Files selected for processing (13)
  • src/renderer/src/components/sidebar/AddRemoteHostDialog.tsx
  • src/renderer/src/components/sidebar/AddRemoteHostFields.tsx
  • src/renderer/src/components/sidebar/AddRepoHostSelector.test.tsx
  • src/renderer/src/components/sidebar/AddRepoHostSelector.tsx
  • src/renderer/src/components/sidebar/AddRepoHostSelectorSlot.tsx
  • src/renderer/src/components/sidebar/add-repo-host-availability.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/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json

Comment on lines +145 to +151
toast.success(
translate(
'auto.components.sidebar.AddRemoteHostDialog.sshImportSynced',
'Synced {{value0}} host{{value1}}.',
{ value0: synced.length, value1: synced.length > 1 ? 's' : '' }
)
)

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.

📐 Maintainability & Code Quality | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
fd -t f 'i18n.ts' src/renderer/src/i18n --exec sed -n '1,80p' {}
rg -nP 'pluralSeparator|_one|_other|count' src/renderer/src/i18n

Repository: stablyai/orca

Length of output: 50370


Replace manual pluralization with i18next count handling.

The current code uses manual suffix logic (value1) for plurals, which fails in non-English locales (e.g., es, ja, zh). Use the count option to leverage i18next's built-in pluralization rules via _one and _other keys.

♻️ Suggested approach

Update the translation call to pass count and define plural keys in the locale files:

-        toast.success(
-          translate(
-            'auto.components.sidebar.AddRemoteHostDialog.sshImportSynced',
-            'Synced {{value0}} host{{value1}}.',
-            { value0: synced.length, value1: synced.length > 1 ? 's' : '' }
-          )
-        )
+        toast.success(
+          translate(
+            'auto.components.sidebar.AddRemoteHostDialog.sshImportSynced',
+            'Synced {{count}} host.',
+            { count: synced.length }
+          )
+        )

Add auto.components.sidebar.AddRemoteHostDialog.sshImportSynced_one and auto.components.sidebar.AddRemoteHostDialog.sshImportSynced_other entries to src/renderer/src/i18n/locales/en.json (and other locales) to handle singular and plural forms correctly.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
toast.success(
translate(
'auto.components.sidebar.AddRemoteHostDialog.sshImportSynced',
'Synced {{value0}} host{{value1}}.',
{ value0: synced.length, value1: synced.length > 1 ? 's' : '' }
)
)
toast.success(
translate(
'auto.components.sidebar.AddRemoteHostDialog.sshImportSynced',
'Synced {{count}} host.',
{ count: synced.length }
)
)

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

Run ID: fbff9002-ce79-4fce-96df-393ef18d201c

📥 Commits

Reviewing files that changed from the base of the PR and between 2c89e5b and 77b6b77.

📒 Files selected for processing (1)
  • docs/ephemeral-vm-recipes.md

Comment thread docs/ephemeral-vm-recipes.md Resolved
Comment thread docs/ephemeral-vm-recipes.md Resolved

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

🧹 Nitpick comments (8)
src/shared/ephemeral-vm-runtime-store.ts (1)

122-137: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Catch-all relabels every read failure as corruption.

hardenExistingSecureFile, readFileSync, and JSON.parse all funnel into the same runtime_error "file is invalid" message. A transient permission/IO error (e.g. hardenExistingSecureFile failing) is then surfaced to the user as data corruption, and the original cause is discarded with no logging. Consider preserving the original error via cause (or logging it) so genuine corruption can be distinguished from environmental failures.

src/main/ephemeral-vm-runtime-service.ts (1)

139-153: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Final status updates ignore the injected now, reducing test determinism.

The cleanup_failed/cleaned transitions call Date.now() directly while the cleanup_pending transition (Line 124-126) honors args.now. For consistency and deterministic tests, consider threading now (or a fresh injected timestamp) through these updates as well.

src/main/ipc/ephemeral-vm-runtime-handlers.ts (1)

49-77: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Cleanup resolution duplicates getRuntimeRecipeContext.

The runtime/repo/recipe lookup here mirrors getRuntimeRecipeContext in ephemeral-vm-recipe-context.ts (used by getCleanupCommand below). The difference is that this path converts each failure into a cleanup_failed status update instead of throwing. Consider factoring the shared lookup into a helper that returns a discriminated result, letting both call sites branch on it — keeping the failure-to-status mapping local here while removing the copied resolution logic.

src/renderer/src/components/settings/EphemeralVmRecipeDialogs.tsx (1)

19-24: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

User-facing strings are not localized.

Recipe doctor, ready, and needs attention are hardcoded English, whereas the rest of this pane (and EphemeralVmsPane) routes user-facing copy through translate(...). Wrap these for i18n consistency.

♻️ Proposed localization
-          <DialogTitle>Recipe doctor</DialogTitle>
+          <DialogTitle>
+            {translate('auto.components.settings.EphemeralVmRecipeDialogs.title', 'Recipe doctor')}
+          </DialogTitle>
         </DialogHeader>
         {result ? (
           <div className="space-y-2">
             <div className="text-sm">
-              {result.recipeId} · {result.ok ? 'ready' : 'needs attention'}
+              {result.recipeId} ·{' '}
+              {result.ok
+                ? translate('auto.components.settings.EphemeralVmRecipeDialogs.ready', 'ready')
+                : translate(
+                    'auto.components.settings.EphemeralVmRecipeDialogs.needsAttention',
+                    'needs attention'
+                  )}

(Requires importing translate from @/i18n/i18n.)

src/renderer/src/components/settings/EphemeralVmRecipeRow.tsx (1)

25-29: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Localize the cleanupLabel strings.

The button labels below use translate(...), but these status strings are hardcoded English. Route them through translate for consistency with the rest of the row.

src/renderer/src/components/NewWorkspaceComposerCard.tsx (1)

254-261: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

CommandEmpty is unreachable here.

Command has no CommandInput, so cmdk never enters a filtered/empty state and CommandEmpty (the noVmRecipes message) will never render. The parent already gates this combobox on ephemeralVmRecipes.length > 0, so the dead branch is harmless but can be dropped to reduce noise.

src/shared/orca-yaml.ts (1)

106-114: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Optional: cleanup: none sentinel collides with a literal command named none.

A recipe whose cleanup command is literally none would be silently treated as cleanup-disabled rather than executing none. This is almost certainly a non-issue in practice, but worth a one-line doc note that none is reserved as a disable sentinel.

src/cli/handlers/vm.ts (1)

193-196: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

loadRecipe re-reads and re-parses orca.yaml already parsed in doctorRecipe.

In the provision path, orca.yaml is read+parsed in doctorRecipe (Line 59) and again here. Beyond the redundant I/O, the two parse paths can drift if file contents change between reads. Consider threading the parsed hooks/recipe out of doctorRecipe so a single parse feeds both the checks and the recipe lookup.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 328399e1-b299-4ea2-be15-e7253360b328

📥 Commits

Reviewing files that changed from the base of the PR and between f8c4f4f and f44a3f4.

📒 Files selected for processing (73)
  • skills/ephemeral-vms/SKILL.md
  • src/cli/args.ts
  • src/cli/dispatch.ts
  • src/cli/handlers/core.ts
  • src/cli/handlers/vm.ts
  • src/cli/help.ts
  • src/cli/index.test.ts
  • src/cli/index.ts
  • src/cli/runtime/launch.test.ts
  • src/cli/runtime/launch.ts
  • src/cli/specs/core.ts
  • src/cli/specs/index.ts
  • src/cli/specs/serve.ts
  • src/cli/specs/vm.ts
  • src/main/ephemeral-vm-recipe-runner.test.ts
  • src/main/ephemeral-vm-recipe-runner.ts
  • src/main/ephemeral-vm-runtime-service.test.ts
  • src/main/ephemeral-vm-runtime-service.ts
  • src/main/hooks.test.ts
  • src/main/hooks.ts
  • src/main/index.ts
  • src/main/ipc/ephemeral-vm-recipe-context.ts
  • src/main/ipc/ephemeral-vm-runtime-handlers.ts
  • src/main/ipc/ephemeral-vm.test.ts
  • src/main/ipc/ephemeral-vm.ts
  • src/main/ipc/register-core-handlers.test.ts
  • src/main/ipc/register-core-handlers.ts
  • src/preload/api-types.ts
  • src/preload/index.ts
  • src/renderer/src/components/NewWorkspaceComposerCard.tsx
  • src/renderer/src/components/NewWorkspaceComposerModal.tsx
  • src/renderer/src/components/settings/EphemeralVmRecipeDialogs.tsx
  • src/renderer/src/components/settings/EphemeralVmRecipeRow.tsx
  • src/renderer/src/components/settings/EphemeralVmRuntimesSection.test.tsx
  • src/renderer/src/components/settings/EphemeralVmRuntimesSection.tsx
  • src/renderer/src/components/settings/EphemeralVmsPane.test.tsx
  • src/renderer/src/components/settings/EphemeralVmsPane.tsx
  • src/renderer/src/components/settings/RuntimeEnvironmentsPane.tsx
  • src/renderer/src/components/settings/Settings.tsx
  • src/renderer/src/components/settings/ephemeral-vms-search.ts
  • src/renderer/src/components/sidebar/OrcaYamlTrustDialog.tsx
  • src/renderer/src/components/worktree-creation/WorktreeCreationPanel.test.tsx
  • src/renderer/src/components/worktree-creation/WorktreeCreationPanel.tsx
  • src/renderer/src/hooks/useComposerState.ts
  • src/renderer/src/hooks/useSettingsNavigationMetadata.ts
  • src/renderer/src/lib/agent-feature-install-commands.ts
  • src/renderer/src/lib/ensure-hooks-confirmed.test.ts
  • src/renderer/src/lib/ensure-hooks-confirmed.ts
  • src/renderer/src/lib/ephemeral-vm-workspace-target.integration.test.ts
  • src/renderer/src/lib/ephemeral-vm-workspace-target.test.ts
  • src/renderer/src/lib/ephemeral-vm-workspace-target.ts
  • src/renderer/src/lib/ephemeral-vm-worktree-creation.ts
  • src/renderer/src/lib/orca-hook-trust.ts
  • src/renderer/src/lib/pending-worktree-creation.ts
  • src/renderer/src/lib/settings-navigation-types.ts
  • src/renderer/src/lib/worktree-creation-flow.test.ts
  • src/renderer/src/lib/worktree-creation-flow.ts
  • src/renderer/src/store/slices/worktree-helpers.ts
  • src/renderer/src/store/slices/worktrees.test.ts
  • src/renderer/src/store/slices/worktrees.ts
  • src/shared/agent-feature-install-commands.test.ts
  • src/shared/agent-feature-install-commands.ts
  • src/shared/ephemeral-vm-recipe-diagnostics.ts
  • src/shared/ephemeral-vm-recipe-doctor.ts
  • src/shared/ephemeral-vm-recipe-process.ts
  • src/shared/ephemeral-vm-recipe-runner.ts
  • src/shared/ephemeral-vm-recipes.test.ts
  • src/shared/ephemeral-vm-recipes.ts
  • src/shared/ephemeral-vm-runtime-store.test.ts
  • src/shared/ephemeral-vm-runtime-store.ts
  • src/shared/ephemeral-vm-runtimes.ts
  • src/shared/orca-yaml.ts
  • src/shared/types.ts
✅ Files skipped from review due to trivial changes (1)
  • src/cli/help.ts

Comment thread skills/ephemeral-vms/SKILL.md Resolved
Comment thread skills/ephemeral-vms/SKILL.md Resolved
Comment thread src/main/ipc/ephemeral-vm.ts Resolved
Comment thread src/preload/api-types.ts
Comment on lines +1948 to +1954
listRecipes: (args: { repoId: string }) => Promise<{
status: 'ok' | 'error'
repoPath: string | null
recipes: OrcaHooks['vmRecipes']
diagnostics: NonNullable<OrcaHooks['vmRecipeDiagnostics']>
message?: string
}>

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

recipes type is wider than the handler return; inconsistent with listRecipeCatalog.

The IPC handler (EphemeralVmRecipeListResult.recipes) always returns an OrcaVmRecipe[] (defaulting via ?? []), but OrcaHooks['vmRecipes'] is OrcaVmRecipe[] | undefined. This forces renderer callers to null-check a value that is never undefined, and it diverges from listRecipeCatalog just below which correctly uses NonNullable<OrcaHooks['vmRecipes']>.

Proposed fix
-      recipes: OrcaHooks['vmRecipes']
+      recipes: NonNullable<OrcaHooks['vmRecipes']>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
listRecipes: (args: { repoId: string }) => Promise<{
status: 'ok' | 'error'
repoPath: string | null
recipes: OrcaHooks['vmRecipes']
diagnostics: NonNullable<OrcaHooks['vmRecipeDiagnostics']>
message?: string
}>
listRecipes: (args: { repoId: string }) => Promise<{
status: 'ok' | 'error'
repoPath: string | null
recipes: NonNullable<OrcaHooks['vmRecipes']>
diagnostics: NonNullable<OrcaHooks['vmRecipeDiagnostics']>
message?: string
}>

Comment on lines +135 to +137
const text = result.command
? `${result.command}\n\n# Cleanup payload:\n${result.payloadJson}`
: result.payloadJson

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 | 🟠 Major | ⚡ Quick win

Copy only the runnable cleanup command here.

When result.command is present, this copies the command plus a comment header and raw JSON payload. That makes the clipboard contents non-runnable if the user pastes them straight into a shell, despite the button and toast both saying “Copy command”. Copy just result.command here, and expose the payload through a separate action if it still needs to be available.

Suggested fix
-      const text = result.command
-        ? `${result.command}\n\n# Cleanup payload:\n${result.payloadJson}`
-        : result.payloadJson
+      const text = result.command ?? result.payloadJson
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const text = result.command
? `${result.command}\n\n# Cleanup payload:\n${result.payloadJson}`
: result.payloadJson
const text = result.command ?? result.payloadJson

</div>
</div>

<EphemeralVmRuntimesSection />

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.

🩺 Stability & Availability | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find EphemeralVmRuntimesSection definition
find src -type f -name "*.tsx" -o -name "*.ts" | xargs grep -l "EphemeralVmRuntimesSection" | head -5

Repository: find_file

Length of output: 2011


🏁 Script executed:

#!/bin/bash
# Search for window.api usage in the section
grep -r "window\.api" src/renderer/src/components/ | grep -i "ephemeral" | head -10

Repository: find_api_usage

Length of output: 2026


🏁 Script executed:

#!/bin/bash
# Find the file defining EphemeralVmRuntimesSection
grep -r "const EphemeralVmRuntimesSection" src --include="*.tsx" --include="*.ts"

Repository: stablyai/orca

Length of output: 151


🏁 Script executed:

#!/bin/bash
# Search for window.api usage in EphemeralVmRuntimesSection specifically
find src -type f \( -name "*.tsx" -o -name "*.ts" \) -exec grep -l "EphemeralVmRuntimesSection" {} \; | xargs grep -n "window\.api"

Repository: stablyai/orca

Length of output: 2658


🏁 Script executed:

#!/bin/bash
# Check Settings.tsx for how RuntimeEnvironmentsPane is rendered
grep -n "RuntimeEnvironmentsPane\|isWebClient" src/renderer/pages/Settings.tsx 2>/dev/null || grep -n "RuntimeEnvironmentsPane\|isWebClient" src/renderer/src/pages/Settings.tsx 2>/dev/null

Repository: stablyai/orca

Length of output: 151


🏁 Script executed:

#!/bin/bash
# Find Settings.tsx location
find src -type f -name "Settings.tsx" -o -name "Settings.ts"

Repository: stablyai/orca

Length of output: 201


🏁 Script executed:

#!/bin/bash
# Once path is found, grep for RuntimeEnvironmentsPane usage and isWebClient
# Will update this after finding the file

Repository: stablyai/orca

Length of output: 151


🏁 Script executed:

#!/bin/bash
# Check how RuntimeEnvironmentsPane is used in Settings.tsx and if isWebClient affects it
grep -n "RuntimeEnvironmentsPane\|isWebClient" src/renderer/src/components/settings/Settings.tsx | head -30

Repository: stablyai/orca

Length of output: 597


🏁 Script executed:

#!/bin/bash
# Also check if there's any web guard pattern in the codebase for window.api
grep -r "isWebClient\|canGeneratePairingUrl" src/renderer/src --include="*.tsx" --include="*.ts" | grep -v "test" | head -20

Repository: stablyai/orca

Length of output: 2190


🏁 Script executed:

#!/bin/bash
# Check if EphemeralVmRuntimesSection has any internal web checks or accepts isWebClient prop
grep -n "isWebClient\|window\.api" src/renderer/src/components/settings/EphemeralVmRuntimesSection.tsx | head -20

Repository: stablyai/orca

Length of output: 468


🏁 Script executed:

#!/bin/bash
# Check how EphemeralVmRuntimesSection is rendered in RuntimeEnvironmentsPane to see if it receives props
grep -B5 -A5 "EphemeralVmRuntimesSection" src/renderer/src/components/settings/RuntimeEnvironmentsPane.tsx

Repository: stablyai/orca

Length of output: 781


Confirm web-client behavior for the cleanup section.

RuntimeEnvironmentsPane is rendered on both desktop and web clients. The EphemeralVmRuntimesSection component unconditionally accesses window.api.ephemeralVm.listRuntimes() on mount (line 60 of EphemeralVmRuntimesSection.tsx), which will throw a runtime error (Cannot read properties of undefined) when the window.api bridge is unavailable on web.

While Settings.tsx gates specific pairing features via the canGeneratePairingUrl prop, the cleanup section remains unconditionally rendered. Gate the <EphemeralVmRuntimesSection /> render in RuntimeEnvironmentsPane using the existing canGeneratePairingUrl prop (or pass isWebClient explicitly) to prevent execution on web clients.

Snippet
// src/renderer/src/components/settings/RuntimeEnvironmentsPane.tsx
// Current (line ~994):
<EphemeralVmRuntimesSection />

// Suggested:
{canGeneratePairingUrl && <EphemeralVmRuntimesSection />}

Comment on lines +1510 to +1524
<SettingsSection
id="ephemeral-vms"
title={translate(
'auto.components.settings.Settings.ephemeralVms',
'Ephemeral VMs'
)}
badge="Beta"
description={translate(
'auto.components.settings.Settings.ephemeralVmsDescription',
'Use repo-owned recipes to create one temporary cloud runtime per workspace.'
)}
searchEntries={getSectionSearchEntries('ephemeral-vms')}
>
{isSectionMounted('ephemeral-vms') ? <EphemeralVmsPane /> : null}
</SettingsSection>

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.

🩺 Stability & Availability | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check whether ephemeralVm API is exposed in the web/browser preload shim
rg -nP "ephemeralVm" --type=ts -g '!**/*.test.*' | rg -i "web|browser|shim|stub"
# Confirm how other desktop-only panes are gated vs ephemeral-vms
rg -nP "showDesktopOnlySettings \?" src/renderer/src/components/settings/Settings.tsx

Repository: stablyai/orca

Length of output: 151


🏁 Script executed:

#!/bin/bash
# Find EphemeralVmsPane file
fd "EphemeralVmsPane" --type f -e ts,tsx
# Search for window.api usage in EphemeralVmsPane if found
# Check definition of showDesktopOnlySettings
rg -n "showDesktopOnlySettings" src/renderer/src/components/settings/Settings.tsx | head -20
# Check if there is a web preload or shim for window.api
find src -name "*shim*" -o -name "*web*" -o -name "*preload*" | grep -E "(preload|shim|web)"

Repository: stablyai/orca

Length of output: 3398


🏁 Script executed:

#!/bin/bash
# Find the EphemeralVmsPane component
fd "EphemeralVmsPane" --type f -e ts,tsx
# Check the web preload API to see if ephemeralVm is exposed
cat src/renderer/src/web/web-preload-api.ts | grep -i "ephemeral"
# Re-check the specific lines in Settings.tsx to confirm the missing wrapper
sed -n '1505,1530p' src/renderer/src/components/settings/Settings.tsx

Repository: stablyai/orca

Length of output: 1247


🏁 Script executed:

#!/bin/bash
# Locate EphemeralVmsPane
fd "EphemeralVmsPane" --type f
# Check web-preload-api.ts for ephemeralVm
grep -i "ephemeral" src/renderer/src/web/web-preload-api.ts
# If EphemeralVmsPane is found, check its content
find . -name "EphemeralVmsPane*" -type f -exec head -50 {} \;

Repository: stablyai/orca

Length of output: 3574


🏁 Script executed:

#!/bin/bash
# Confirm ephemeralVm is missing in web-preload-api.ts
cat src/renderer/src/web/web-preload-api.ts
# Check if isSectionMounted for ephemeral-vms returns true on web
grep -n "isSectionMounted" src/renderer/src/components/settings/Settings.tsx | head -10

Repository: stablyai/orca

Length of output: 50370


Gate the Ephemeral VMs section with showDesktopOnlySettings.

The ephemeral-vms section (lines 1510-1524) is rendered on web clients, but EphemeralVmsPane relies on window.api.ephemeralVm, which is not exposed in the web preload API. This causes a crash or error toast on web.

Wrap the section in {showDesktopOnlySettings ? ... : null} to match the pattern used for computer-use, voice, ssh, and mobile sections (e.g., lines 1151, 1332, 1526).

Current code
<SettingsSection
  id="ephemeral-vms"
  title={translate(
    'auto.components.settings.Settings.ephemeralVms',
    'Ephemeral VMs'
  )}
  badge="Beta"
  description={translate(
    'auto.components.settings.Settings.ephemeralVmsDescription',
    'Use repo-owned recipes to create one temporary cloud runtime per workspace.'
  )}
  searchEntries={getSectionSearchEntries('ephemeral-vms')}
>
  {isSectionMounted('ephemeral-vms') ? <EphemeralVmsPane /> : null}
</SettingsSection>

Comment on lines +695 to +739
useEffect(() => {
let cancelled = false
setEphemeralVmRecipes([])
setSelectedEphemeralVmRecipeId(null)
setEphemeralVmRecipeError(null)
if (!selectedRepo || !selectedRepoIsGit || selectedRepo.connectionId || isProjectGroupTarget) {
return () => {
cancelled = true
}
}
void window.api.ephemeralVm
.listRecipes({ repoId: selectedRepo.id })
.then((result) => {
if (cancelled) {
return
}
setEphemeralVmRecipes(result.recipes ?? [])
setSelectedEphemeralVmRecipeId(
initialEphemeralVmRecipeId &&
result.recipes?.some((recipe) => recipe.id === initialEphemeralVmRecipeId)
? initialEphemeralVmRecipeId
: null
)
const diagnosticMessages = (result.diagnostics ?? []).map((diagnostic) => {
const recipeLabel = `vmRecipes[${diagnostic.index}]`
const fieldLabel = diagnostic.field ? `.${diagnostic.field}` : ''
return `${recipeLabel}${fieldLabel}: ${diagnostic.message}`
})
setEphemeralVmRecipeError(
[result.status === 'error' ? result.message : null, ...diagnosticMessages]
.filter((message): message is string => Boolean(message))
.join('\n') || null
)
})
.catch((error) => {
if (cancelled) {
return
}
setEphemeralVmRecipes([])
setEphemeralVmRecipeError(error instanceof Error ? error.message : String(error))
})
return () => {
cancelled = true
}
}, [initialEphemeralVmRecipeId, isProjectGroupTarget, selectedRepo, selectedRepoIsGit])

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check the context around the hook to see how selectedRepo and initialEphemeralVmRecipeId are obtained
# and if selectedRepo might change reference.
grep -n "selectedRepo" src/renderer/src/hooks/useComposerState.ts | head -30

Repository: use-_state

Length of output: 2048


Preserve user-selected recipe ID when the recipe list refreshes.

The useEffect currently clears selectedEphemeralVmRecipeId to null on every run and subsequently restores only initialEphemeralVmRecipeId. If selectedRepo changes reference (triggering a re-run due to background updates), any user selection that differs from the initial value is silently lost.

Modify the resolution logic to check if the current selectedEphemeralVmRecipeId still exists in the result.recipes list. Prioritize preserving the current selection if valid, falling back to initialEphemeralVmRecipeId only if the current selection is invalid or absent.

// Proposed logic change
setSelectedEphemeralVmRecipeId((currentSelection) => {
  // Prefer current selection if it still exists in the new list
  if (currentSelection && result.recipes?.some((r) => r.id === currentSelection)) {
    return currentSelection
  }
  // Fallback to initial if valid
  if (
    initialEphemeralVmRecipeId &&
    result.recipes?.some((recipe) => recipe.id === initialEphemeralVmRecipeId)
  ) {
    return initialEphemeralVmRecipeId
  }
  return null
})

Comment on lines +53 to +60
const abort = (): void => {
if (settled) {
return
}
child.kill()
}

args.signal?.addEventListener('abort', abort, { once: true })

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.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Pre-aborted signal won't terminate the child.

The abort listener is registered with { once: true }, so if args.signal is already aborted when runRecipeCommand runs, the handler never fires and the command runs to completion. Guard the already-aborted case.

Proposed fix
     args.signal?.addEventListener('abort', abort, { once: true })
+    if (args.signal?.aborted) {
+      abort()
+    }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const abort = (): void => {
if (settled) {
return
}
child.kill()
}
args.signal?.addEventListener('abort', abort, { once: true })
const abort = (): void => {
if (settled) {
return
}
child.kill()
}
args.signal?.addEventListener('abort', abort, { once: true })
if (args.signal?.aborted) {
abort()
}
🧰 Tools
🪛 ast-grep (0.44.0)

[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { spawn, type ChildProcessWithoutNullStreams } from 'node:child_process'
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)

Comment on lines +113 to +119
function appendBounded(current: string, chunk: string, maxBytes: number): string {
const next = current + chunk
if (Buffer.byteLength(next, 'utf8') <= maxBytes) {
return next
}
return next.slice(-maxBytes)
}

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.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

appendBounded mixes byte budget with character slicing.

maxBytes is a byte count, but next.slice(-maxBytes) slices by UTF-16 code units. For multibyte output the retained tail can exceed maxBytes bytes, so the capture bound isn't actually enforced. Truncate against the byte length instead.

Proposed fix
-function appendBounded(current: string, chunk: string, maxBytes: number): string {
-  const next = current + chunk
-  if (Buffer.byteLength(next, 'utf8') <= maxBytes) {
-    return next
-  }
-  return next.slice(-maxBytes)
-}
+function appendBounded(current: string, chunk: string, maxBytes: number): string {
+  const next = current + chunk
+  const buf = Buffer.from(next, 'utf8')
+  if (buf.length <= maxBytes) {
+    return next
+  }
+  return buf.subarray(buf.length - maxBytes).toString('utf8')
+}
🧰 Tools
🪛 ast-grep (0.44.0)

[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { spawn, type ChildProcessWithoutNullStreams } from 'node:child_process'
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)

@Jinwoo-H
Jinwoo-H force-pushed the Jinwoo-H/vm-improve-2 branch from d6c707a to 9ccec47 Compare June 26, 2026 21:29
Jinwoo-H and others added 25 commits June 28, 2026 22:08
Jinwoo-H and others added 10 commits June 29, 2026 23:05
…ject

An SSH-mode per-workspace-env's workspace is the runtime repo's main
worktree, so deleting it routes through removeProject, not removeWorktree.
removeProject never tore down the ephemeral runtime, leaking the live
Docker/VM and its hidden SSH target on every delete.

- Extract the runtime-cleanup-by-workspace logic into a shared module that
  matches runtimes by workspace id AND by a removed repo's runtime-owned
  SSH connectionId, so both delete paths tear the runtime down.
- removeProject now cleans up the backing runtime when the repo's
  connectionId is a runtime-owned SSH target.
- The orphan-project purge now also removes a repo whose only host was the
  destroyed runtime even when its project-host-setup was already pruned, so
  no dead, never-connectable project lingers in the sidebar/composer.

Co-authored-by: Orca <[email protected]>
After creating a per-workspace-env, its runtime-owned SSH repo became the
active repo. The composer seeds its project from the active repo, so the
next 'Create workspace' selected that repo — which has a connectionId, so
recipe loading is suppressed — hiding the 'Run on' host/recipe picker
entirely with no way to pick a different host or recipe.

Exclude runtime-owned SSH repos from the dialog's eligible repos (they're
hidden plumbing, like every other user-facing surface already treats them),
so the composer falls back to the project's real local repo and the host/
recipe picker stays available.

Co-authored-by: Orca <[email protected]>
On failure the panel showed only the short status (e.g. 'Recipe exited
with code 1'), discarding the recipe output we already captured — leaving
the user with nothing to act on. Surface the captured recipe stderr in the
same fixed-height log panel below the error + Retry/Dismiss, so the real
cause (and what to fix) is visible. Non-VM creation failures, which have no
recipe output, render unchanged.

Co-authored-by: Orca <[email protected]>
A failed VM recipe now renders in the same centered 'Provisioning VM'
layout — the recipe log stays in the same place and style; only the
spinner header swaps to the error + Retry/Dismiss. Previously the failure
jumped to a separate top-left error style, moving the log. Non-VM creation
failures keep the original compact error line (they have no recipe log).

Co-authored-by: Orca <[email protected]>
The run-target row had only a label, so it rendered shorter than the
two-line host options. Add a one-line subtitle ('Provision an on-demand
environment from a recipe') so it matches their height and hints what the
submenu opens.

Co-authored-by: Orca <[email protected]>
The provisioning view said 'Cancel stops provisioning' but had no visible
Cancel control (only the tiny tab X) — add a Cancel button under the
header. The recipe log now follows the tail as output streams, unless the
user scrolls up (then it holds their position until they scroll back down).

Co-authored-by: Orca <[email protected]>
…e-env

After creating a per-workspace-env, its runtime-owned SSH repo becomes the
active repo, but that repo is excluded from the composer's eligible repos,
so seeding from activeRepoId failed and fell back to the first eligible
repo (a different project). Map an active runtime-owned SSH repo to its
local same-project sibling so the composer stays on that project.

Co-authored-by: Orca <[email protected]>
The 'Cancel stops provisioning. Cleanup runs if a runtime was created.'
line was unneeded — the Cancel button speaks for itself.

Co-authored-by: Orca <[email protected]>
Mirror improvements made to the installed skill after live use:
- §1: verify a provider's SSH mode exposes a real dialable target, not
  an interactive-only shell.
- §3/§4 + §10: don't bind-mount/copy the host agent home (e.g. ~/.codex)
  as the auth snapshot — its sqlite/hook/cache state breaks in a
  disposable runtime; authenticate inside the runtime and commit that layer.
- New §7h worked example: local Docker SSH (auth image via docker commit,
  random localhost port, entrypoint reset); old Windows section renumbered §7i.
- §9: SSH/Docker smoke-test steps before declaring a recipe ready.
- §10: failure modes for host-copied auth and a Docker auth image that
  exits immediately.

Co-authored-by: Orca <[email protected]>
A recipe added to orca.yaml only on a branch/worktree won't appear as a
Run-on option in the workspace composer until that change is merged to the
project's primary branch (loadHooks reads orca.yaml from the project's main
checkout). doctor/--provision still validate from the working copy on any
branch; only picker creation needs it on primary.

Co-authored-by: Orca <[email protected]>
@Jinwoo-H Jinwoo-H changed the title Improve Add Project remote host setup Per-Workspace Environments (on-demand disposable runtimes) + Add Project remote host setup Jun 30, 2026
Jinwoo-H and others added 7 commits June 30, 2026 02:56
Resolve 4 import conflicts (node: protocol migration from main's oxlint
autofix): keep the symbols this branch added (statSync/isAbsolute in
index.ts; execFileSync in orca-runtime.test; fs/os imports in
cli/index.test; node:fs in hooks) under main's node:-prefixed convention,
and drop a dead 'yaml' import. pnpm install picks up main's new
@testing-library deps.

Co-authored-by: Orca <[email protected]>
main's oxlint upgrade made unicorn/prefer-node-protocol an error; these
branch-only files still used bare fs/os/path imports and tripped the
full-repo lint in CI. Autofixed to node:-prefixed specifiers.

Co-authored-by: Orca <[email protected]>
The user-facing feature is 'Per-Workspace Environments', so the config
contract should match: a Docker container / SSH host / cloud sandbox isn't
literally a VM. Hard-rename the orca.yaml key, the OrcaHooks type field
(vmRecipes/vmRecipeDiagnostics -> environmentRecipes/
environmentRecipeDiagnostics), and all user-facing copy (doctor diagnostics,
remediations, trust-confirmation labels, CLI help, skill, vercel doc).

Internal ephemeralVm-prefixed plumbing (symbols, filenames, IPC channels)
is left unchanged. The CLI verb stays 'orca vm recipe doctor' because an
'orca environment ...' command already exists for runtime environments (the
Orca-server pairing concept) and reusing it would conflate two concepts.

Co-authored-by: Orca <[email protected]>
…utton

- Shorten the section description and remove the trailing 'The skill sets
  it up for this repo.' so it no longer wraps awkwardly; widen the shared
  settings-section description cap (max-w-2xl -> max-w-3xl) so descriptions
  stop breaking early under the wider title row.
- Remove the per-recipe Doctor button (and its now-orphaned RecipeDoctorDialog
  + pane state); recipe rows keep just 'Use in workspace'. The CLI
  'vm recipe doctor' self-test the skill uses is unaffected.

Co-authored-by: Orca <[email protected]>
Show just the copy icon by default (with an aria-label for accessibility);
on click show the 'Copied' text with no checkmark.

Co-authored-by: Orca <[email protected]>
Icon-only Copy button by default; on click show a checkmark + 'Copied'.

Co-authored-by: Orca <[email protected]>
'Appear here once your agent adds them...' read as a fragment; replace with
'Recipes your agent adds to orca.yaml show up here, ready to launch a
workspace on.'

Co-authored-by: Orca <[email protected]>
Jinwoo-H and others added 2 commits June 30, 2026 04:49
The orca-per-workspace-env skill is now the maintained source of truth for
setup; docs/ephemeral-vm-recipes.md and docs/vercel-sandbox-ephemeral-vms.md
were earlier design-era artifacts that overlapped with it and risked drift.

Co-authored-by: Orca <[email protected]>
@Jinwoo-H
Jinwoo-H merged commit 3996414 into main Jun 30, 2026
6 of 7 checks passed
@Jinwoo-H
Jinwoo-H deleted the Jinwoo-H/vm-improve-2 branch June 30, 2026 18:31
brennanb2025 added a commit that referenced this pull request Jul 3, 2026
…very tests

Post-merge adjustments: executeWorktreeCreation now flows through
prepareRequestForCreate (#6320), so thread issueCommand from the prepared
request, and assert delivery via vi.waitFor — the fixed two-tick flush
starved once main added awaits ahead of the activation branches, which is
exactly how the merge-build verify check failed.

Co-authored-by: Orca <[email protected]>
nwparker added a commit that referenced this pull request Jul 3, 2026
…arate projects (#7237)

* fix(sidebar): keep independent same-host checkouts of one repo as separate projects

Re-regression of #5374: PR #6320 removed the per-host-surface separation
added by #5375, so independent local clones of the same repo (shared origin
=> same github:owner/repo identity) collapse into one sidebar project again.

Restore the surface-key separation in worktree-list-groups.ts, scoped by
ProjectHostSetup.setupMethod: 'provisioned' (ephemeral-VM runtime copies)
still nest under the project header (preserving #6320), while real user
checkouts (legacy-repo / imported-existing-folder / cloned) each get their
own header when duplicated on one host surface.

Revert the two tests #6320 inverted and add coverage for a provisioned copy
nesting alongside a same-host user checkout.

* test(cmd-j): update palette grouping tests for same-host checkout split

The Cmd+J palette shares getProjectGroupingForRepo (via
getProjectHeaderRevealTarget) with the sidebar, so restoring same-host
checkout separation also splits independent `cloned` checkouts into
per-setup palette entries. Update the multi-setup test to assert the split
and add coverage that a `provisioned` runtime copy still nests under one
project key.

* test(sidebar): cover split + provisioned-nest on one host together

Guard the intersection of #5374 and #6320: when a project has two real
same-host user checkouts AND a provisioned copy, the real checkouts each get
their own per-setup header while the provisioned copy stays under the plain
project key (never a path-scoped ::setup: header). Locks the two features'
combined behavior so a future change can't silently regress either half.

* refactor(sidebar): reuse shared Windows-path helper, single-pass surface count

Take-over polish of #7237:
- Use shared isWindowsAbsolutePathLike instead of an inline drive-letter
  regex, deduplicating the pattern and also bucketing UNC \\server\share
  paths as a Windows surface instead of falling through to default.
- Collapse buildProjectGroupingIndex's two passes over projectHostSetups into
  one, computing each surface key once and flagging ambiguous projects from
  the aggregated counts.
- Tighten why-comments to AGENTS.md's two-line rule.

No behavior change to the fix; all 123 sidebar/palette grouping tests pass.

Co-authored-by: Orca <[email protected]>

---------

Co-authored-by: Neil <[email protected]>
Co-authored-by: Orca <[email protected]>
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…arate projects (stablyai#7237)

* fix(sidebar): keep independent same-host checkouts of one repo as separate projects

Re-regression of stablyai#5374: PR stablyai#6320 removed the per-host-surface separation
added by stablyai#5375, so independent local clones of the same repo (shared origin
=> same github:owner/repo identity) collapse into one sidebar project again.

Restore the surface-key separation in worktree-list-groups.ts, scoped by
ProjectHostSetup.setupMethod: 'provisioned' (ephemeral-VM runtime copies)
still nest under the project header (preserving stablyai#6320), while real user
checkouts (legacy-repo / imported-existing-folder / cloned) each get their
own header when duplicated on one host surface.

Revert the two tests stablyai#6320 inverted and add coverage for a provisioned copy
nesting alongside a same-host user checkout.

* test(cmd-j): update palette grouping tests for same-host checkout split

The Cmd+J palette shares getProjectGroupingForRepo (via
getProjectHeaderRevealTarget) with the sidebar, so restoring same-host
checkout separation also splits independent `cloned` checkouts into
per-setup palette entries. Update the multi-setup test to assert the split
and add coverage that a `provisioned` runtime copy still nests under one
project key.

* test(sidebar): cover split + provisioned-nest on one host together

Guard the intersection of stablyai#5374 and stablyai#6320: when a project has two real
same-host user checkouts AND a provisioned copy, the real checkouts each get
their own per-setup header while the provisioned copy stays under the plain
project key (never a path-scoped ::setup: header). Locks the two features'
combined behavior so a future change can't silently regress either half.

* refactor(sidebar): reuse shared Windows-path helper, single-pass surface count

Take-over polish of stablyai#7237:
- Use shared isWindowsAbsolutePathLike instead of an inline drive-letter
  regex, deduplicating the pattern and also bucketing UNC \\server\share
  paths as a Windows surface instead of falling through to default.
- Collapse buildProjectGroupingIndex's two passes over projectHostSetups into
  one, computing each surface key once and flagging ambiguous projects from
  the aggregated counts.
- Tighten why-comments to AGENTS.md's two-line rule.

No behavior change to the fix; all 123 sidebar/palette grouping tests pass.

Co-authored-by: Orca <[email protected]>

---------

Co-authored-by: Neil <[email protected]>
Co-authored-by: Orca <[email protected]>
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