Skip to content

fix: decouple Floating Workspace shell selection - #13995

Merged
Jinwoo-H merged 1 commit into
mainfrom
OrcaWin/bug-floating-workspace-terminal-shell-selection
Aug 12, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
OrcaWin/bug-floating-workspace-terminal-shell-selection

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Aug 12, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

Floating Workspace is not a project, so it should not inherit whichever Windows or WSL runtime the active project uses. The runtime resolver now recognizes Floating Workspace directly and leaves its shell chooser independent.

What Changed

  • Return no project runtime for FLOATING_TERMINAL_WORKTREE_ID at the central project-runtime authority boundary.
  • Preserve the existing active-project fallback for detected-only worktrees that are selectable before primary catalog hydration.
  • Add regression coverage for both behaviors.
  • Add concise contracts for the touched exported runtime helpers.

Why

getLocalProjectExecutionRuntimeContext accepted the Floating Workspace synthetic ID, found no real worktree, then fell back to activeRepoId. That false authority made the TabBar filter Floating Workspace shells to the active project's Windows/WSL runtime.

The central sentinel guard covers menu modeling, creation, restore, spawn, restart, resume, and other resolver callers. A Floating Panel-only override would miss lifecycle paths, while a TabBar-only special case would mask only the menu symptom. A broad unresolved-ID guard was rejected because detected-only local worktrees intentionally retain the active project's runtime until primary catalog hydration.

Linked Issue

Fixes #13512

Visual Proof

N/A — this diff changes runtime authority only; it does not change layout, styling, or component rendering. Physical Windows interaction validation was still completed on an Ubuntu 24.04 WSL project:

  • Floating Workspace offered PowerShell, CMD Prompt, Git Bash, and WSL.
  • Selecting PowerShell recorded shellOverride: "pwsh.exe".
  • The rendered terminal returned ISSUE13512:Win32NT:Core.
  • Retained local evidence: issue-13512-wsl-project-floating-shell-menu.png and issue-13512-floating-powershell-running.png (not committed per template policy).

Testing

Invariant: the Floating Workspace synthetic ID must not resolve to the active project's runtime.

Byte-identical oracle:

pnpm vitest run --config config/vitest.config.ts src/renderer/src/lib/local-preflight-context.test.ts -t 'does not assign the active project runtime to the floating workspace'

On final origin/main 346e59c879:

  • baseline implementation blob verified identical to main: RED, received repo-1:wsl:Ubuntu instead of undefined
  • candidate: GREEN
  • candidate with the Floating Workspace guard disabled: RED with the identical received runtime
  • restored candidate: GREEN

Additional validation:

  • focused runtime, TabBar shell-menu, and PTY routing suites: 606/606 passed

  • local runtime suite, including detected-only ownership: 30/30 passed

  • pnpm typecheck: passed

  • touched-file oxlint and diff checks: passed

  • reliability gate manifest: passed (74 gates)

  • max-lines ratchet: passed; no bypasses

  • physical Windows/WSL Electron validation: passed

  • all 44 final CI checks: terminal with zero failures

  • full pnpm lint passed code-quality, type-aware, reliability, max-lines, and bundled-guide stages, then stopped on repository-wide stale generated skill manifests unrelated to this diff

  • I manually tested these changes locally

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

AI Disclosure

OpenAI Codex was used for investigation, implementation, validation, review orchestration, and PR preparation. All generated changes were verified with deterministic tests, physical Windows validation, and independent specialist review.

Review

Fresh exact-head reviews are clean for security/adversarial correctness, architecture/elegance, performance/resources, Windows/WSL and macOS/Linux compatibility, SSH/remote and folder/git workspaces, remote wire compatibility, shell UX/accessibility, and release readiness. CodeRabbit generated no actionable comments and reports 100% docstring coverage.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

CI covers the repository-wide test/build matrix. The local full-lint caveat is the unrelated stale generated manifests documented above.

Author

@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 82f91aa1-9cdf-475c-941d-f634d1b54a9e

📥 Commits

Reviewing files that changed from the base of the PR and between 1f3faa059f859c27deb2778a30c20de15ca25df1 and 49e7c1af16d607176df8b45ab146da3a79fb0173.

📒 Files selected for processing (1)
  • src/renderer/src/lib/local-preflight-context.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/lib/local-preflight-context.ts

📝 Walkthrough

Walkthrough

getLocalProjectExecutionRuntimeContext now returns undefined for the floating terminal worktree before repository and runtime resolution. Tests verify that floating workspaces do not inherit the active project’s WSL runtime and that detected-only worktrees still use the active project’s WSL runtime fallback.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The resolver guard and regression tests satisfy issue #13512 while preserving detected-only worktree runtime fallback behavior.
Out of Scope Changes check ✅ Passed The changes are limited to runtime resolution and regression tests required to make Floating Workspace shell selection independent.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Title check ✅ Passed The title clearly summarizes the main change: decoupling Floating Workspace shell selection from the active project runtime.
Description check ✅ Passed The description covers the required sections, explains the change and rationale, links the issue, documents testing, and records the unrelated full-lint caveat.
✨ 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.

@OrcaWin
OrcaWin force-pushed the OrcaWin/bug-floating-workspace-terminal-shell-selection branch 3 times, most recently from 3be00fc to 33f1ba8 Compare August 12, 2026 08:01
@OrcaWin

OrcaWin commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@OrcaWin
OrcaWin force-pushed the OrcaWin/bug-floating-workspace-terminal-shell-selection branch from 33f1ba8 to 1f3faa0 Compare August 12, 2026 08:09
@OrcaWin

OrcaWin commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@OrcaWin
OrcaWin force-pushed the OrcaWin/bug-floating-workspace-terminal-shell-selection branch from 1f3faa0 to 49e7c1a Compare August 12, 2026 08:14
@OrcaWin

OrcaWin commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@OrcaWin
OrcaWin force-pushed the OrcaWin/bug-floating-workspace-terminal-shell-selection branch from 49e7c1a to 319e075 Compare August 12, 2026 08:16
@OrcaWin

OrcaWin commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

No files to review.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@OrcaWin

OrcaWin commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

No files to review.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Jinwoo-H
Jinwoo-H merged commit e5cd5bf into main Aug 12, 2026
44 checks passed
@Jinwoo-H
Jinwoo-H deleted the OrcaWin/bug-floating-workspace-terminal-shell-selection branch August 12, 2026 09:10
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.

[Bug]: Floating workspace terminal shell selection is tied to the active project, not independent

2 participants