Skip to content

[codex] Add file explorer open in terminal - #7029

Merged
Jinwoo-H merged 3 commits into
stablyai:mainfrom
mmarabel:feat/open-directory-terminal
Jul 2, 2026
Merged

Jinwoo-H merged 3 commits into
stablyai:mainfrom
mmarabel:feat/open-directory-terminal

Conversation

@mmarabel

@mmarabel mmarabel commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds an Open in Terminal context-menu action for directories in the file explorer.
  • Starts the new terminal tab in the selected directory while keeping the tab owned by the current workspace.
  • Threads the requested startup cwd through local tabs, renderer-backed runtime terminals, web/mobile session RPC, IPC/preload types, and workspace-session persistence.
  • Adds regression coverage for the explorer action, terminal tab creation, runtime RPC, IPC handling, store behavior, and session schema persistence.

Closes #6271.

Demo

open-directory-terminal-dark-redacted.mp4

Validation

  • pnpm lint
  • focused Vitest suite for changed areas
  • pnpm test (2054 files passed, 20812 tests passed)
  • pnpm build
  • manual dev-app check: right-clicked terminal-cwd-test, selected Open in Terminal, and confirmed the new terminal opened in that directory

AI Code Review Summary

  • Cross-platform compatibility: Uses existing terminal creation paths and avoids platform-specific path parsing or shortcut changes.
  • SSH/remote/local compatibility: Propagates cwd through renderer-backed runtime and session RPC paths instead of assuming local-only terminal creation.
  • Agent/integration compatibility: Keeps terminal ownership tied to the workspace and preserves existing command/env/launch options.
  • Performance risk: Low; the new action is menu-driven and stores a single optional cwd string on terminal tabs.
  • UI quality: Uses the existing shadcn context menu pattern and a lucide terminal icon; action is only shown for directories.
  • Security risk: Low; the cwd comes from the existing file explorer node path and is passed through existing terminal launch boundaries.

Notes

  • X handle: TODO

Open in Stage

@ghost

ghost commented Jul 1, 2026 •

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 6 individual chapters for you:

Title
1 Define terminal startup CWD types and utilities
2 Update terminal store and tab actions
3 Propagate CWD through runtime and RPC layers
4 Wire CWD through IPC and Web Runtime
5 Add 'Open in Terminal' to File Explorer
6 Render terminals with startup CWD
Open in Stage

Chapters generated by Stage for commit 9827b2c on Jul 1, 2026 5:39pm UTC.

@coderabbitai

coderabbitai Bot commented Jul 1, 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

Run ID: f0190bc1-188e-4f90-8285-32b677c468f5

📥 Commits

Reviewing files that changed from the base of the PR and between 8723d82 and dd9b774.

📒 Files selected for processing (12)
  • src/main/ipc/pty.test.ts
  • src/main/ipc/pty.ts
  • src/main/persistence.ts
  • src/main/runtime/orca-runtime.ts
  • src/preload/api-types.ts
  • src/preload/index.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
  • src/shared/types.ts
💤 Files with no reviewable changes (6)
  • src/shared/types.ts
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/en.json
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/preload/index.ts
  • src/preload/api-types.ts
  • src/main/ipc/pty.ts
  • src/main/ipc/pty.test.ts
  • src/main/runtime/orca-runtime.ts

📝 Walkthrough

Walkthrough

This change adds optional cwd and startupCwd fields to terminal creation and persistence flows. File explorer rows gain an “Open in Terminal” action for directories. The renderer, preload, IPC, runtime, PTY, and workspace session paths now carry the working directory through terminal creation, activation, hydration, and persistence, and the related schemas and tests were updated accordingly.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR includes unrelated i18n edits, including SSH string removals and failedUnnestWorkspace locale additions, beyond the terminal feature. Remove or separate the unrelated localization changes, keeping only the Open in Terminal and startup cwd work tied to #6271.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main user-facing change: adding an Open in Terminal action in the file explorer.
Description check ✅ Passed The description covers summary, validation, AI review notes, and notes, with only the screenshots and security audit headings missing.
Linked Issues check ✅ Passed The PR implements the requested directory right-click Open in Terminal action and starts terminals in the selected folder.

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.

@mmarabel
mmarabel force-pushed the feat/open-directory-terminal branch from 5976da9 to 08df405 Compare July 1, 2026 17:02
@mmarabel
mmarabel marked this pull request as ready for review July 1, 2026 17:03

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/renderer/src/runtime/web-runtime-session.ts (1)

74-91: 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

Clamp cwd to the selected worktree before launching the terminal. CreateTerminalTab.cwd is forwarded unchanged all the way to pty.spawn, so a paired client can start the shell outside the target worktree.

🧹 Nitpick comments (2)
src/shared/workspace-session-schema.ts (1)

81-81: 🗄️ Data Integrity & Integration | 🔵 Trivial | 💤 Low value

Consider matching the .min(1) constraint used for cwd at the RPC layer.

startupCwd here accepts empty strings, while session-tabs-schemas.ts's cwd field requires non-empty. Store writes always omit empty values, but this leaves the persisted-schema layer more permissive than necessary for consistency.

♻️ Proposed fix
-  startupCwd: z.string().optional(),
+  startupCwd: z.string().min(1).optional(),
src/main/runtime/orca-runtime.ts (1)

3831-3834: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Positional-argument fragility in createHeadlessMobileSessionTerminal.

The new cwd parameter was inserted mid-signature (position 5 of 11), and all three call sites use long lists of positional undefined placeholders to reach later params (identity, launchAgent, targetGroupId, launchConfig). This diff appears correctly threaded at all three call sites, but this pattern makes any future parameter insertion/reorder a silent-miscount risk (a wrong argument count wouldn't always be caught by TypeScript if adjacent optional params share compatible types).

Consider converting this private method's trailing optional params into a single options object so future additions can't silently shift positions.

♻️ Suggested direction
-  private async createHeadlessMobileSessionTerminal(
-    worktreeId: string,
-    activate: boolean,
-    afterTabId?: string,
-    command?: string,
-    cwd?: string,
-    env?: Record<string, string>,
-    startupCommandDelivery?: WorktreeStartupLaunch['startupCommandDelivery'],
-    identity?: { tabId: string; leafId: string; sessionId?: string },
-    launchAgent?: TuiAgent,
-    targetGroupId?: string,
-    launchConfig?: SleepingAgentLaunchConfig
-  ): Promise<RuntimeMobileSessionCreateTerminalResult> {
+  private async createHeadlessMobileSessionTerminal(
+    worktreeId: string,
+    activate: boolean,
+    afterTabId: string | undefined,
+    opts: {
+      command?: string
+      cwd?: string
+      env?: Record<string, string>
+      startupCommandDelivery?: WorktreeStartupLaunch['startupCommandDelivery']
+      identity?: { tabId: string; leafId: string; sessionId?: string }
+      launchAgent?: TuiAgent
+      targetGroupId?: string
+      launchConfig?: SleepingAgentLaunchConfig
+    } = {}
+  ): Promise<RuntimeMobileSessionCreateTerminalResult> {

Also applies to: 15693-15716


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 193a8e9b-15d3-4ad0-81c8-59b36768365c

📥 Commits

Reviewing files that changed from the base of the PR and between 021cfc4 and 08df4053c08206c616ecab10b21e0b9fa3343197.

📒 Files selected for processing (33)
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/rpc/methods/session-tabs-schemas.ts
  • src/main/runtime/rpc/methods/session-tabs.test.ts
  • src/main/runtime/rpc/methods/session-tabs.ts
  • src/main/window/attach-main-window-services.ts
  • src/preload/api-types.ts
  • src/preload/index.ts
  • src/renderer/src/components/Terminal.tsx
  • src/renderer/src/components/right-sidebar/FileExplorer.test.tsx
  • src/renderer/src/components/right-sidebar/FileExplorer.tsx
  • src/renderer/src/components/right-sidebar/FileExplorerRow.tsx
  • src/renderer/src/components/right-sidebar/FileExplorerVirtualRows.tsx
  • src/renderer/src/components/right-sidebar/FileExplorerVirtualRowsAddProject.test.tsx
  • src/renderer/src/components/right-sidebar/file-explorer-drag-scroll-marker.test.tsx
  • src/renderer/src/components/tab-group/useTabGroupWorkspaceModel.ts
  • src/renderer/src/components/terminal-pane/TerminalPaneOverlayLayer.tsx
  • src/renderer/src/components/terminal/terminal-tab-actions.test.ts
  • src/renderer/src/components/terminal/terminal-tab-actions.ts
  • src/renderer/src/hooks/useIpcEvents.test.ts
  • src/renderer/src/hooks/useIpcEvents.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
  • src/renderer/src/runtime/web-runtime-session.test.ts
  • src/renderer/src/runtime/web-runtime-session.ts
  • src/renderer/src/store/slices/store-cascades.test.ts
  • src/renderer/src/store/slices/terminals.ts
  • src/shared/runtime-types.ts
  • src/shared/types.ts
  • src/shared/workspace-session-schema.ts
  • src/shared/workspace-session-terminal-schema.test.ts

@mmarabel
mmarabel force-pushed the feat/open-directory-terminal branch from 08df405 to 9827b2c Compare July 1, 2026 17:38

@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: 27861500-95f5-4143-8e04-ae94e3c0a558

📥 Commits

Reviewing files that changed from the base of the PR and between 08df4053c08206c616ecab10b21e0b9fa3343197 and 9827b2c.

📒 Files selected for processing (36)
  • src/main/runtime/orca-runtime-terminal-cwd.test.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/rpc/methods/session-tabs-schemas.ts
  • src/main/runtime/rpc/methods/session-tabs.test.ts
  • src/main/runtime/rpc/methods/session-tabs.ts
  • src/main/window/attach-main-window-services.ts
  • src/preload/api-types.ts
  • src/preload/index.ts
  • src/renderer/src/components/Terminal.tsx
  • src/renderer/src/components/right-sidebar/FileExplorer.test.tsx
  • src/renderer/src/components/right-sidebar/FileExplorer.tsx
  • src/renderer/src/components/right-sidebar/FileExplorerRow.tsx
  • src/renderer/src/components/right-sidebar/FileExplorerVirtualRows.tsx
  • src/renderer/src/components/right-sidebar/FileExplorerVirtualRowsAddProject.test.tsx
  • src/renderer/src/components/right-sidebar/file-explorer-drag-scroll-marker.test.tsx
  • src/renderer/src/components/tab-group/useTabGroupWorkspaceModel.ts
  • src/renderer/src/components/terminal-pane/TerminalPaneOverlayLayer.tsx
  • src/renderer/src/components/terminal/terminal-tab-actions.test.ts
  • src/renderer/src/components/terminal/terminal-tab-actions.ts
  • src/renderer/src/hooks/useIpcEvents.test.ts
  • src/renderer/src/hooks/useIpcEvents.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
  • src/renderer/src/runtime/web-runtime-session.test.ts
  • src/renderer/src/runtime/web-runtime-session.ts
  • src/renderer/src/store/slices/store-cascades.test.ts
  • src/renderer/src/store/slices/terminals.ts
  • src/shared/runtime-types.ts
  • src/shared/terminal-startup-cwd.test.ts
  • src/shared/terminal-startup-cwd.ts
  • src/shared/types.ts
  • src/shared/workspace-session-schema.ts
  • src/shared/workspace-session-terminal-schema.test.ts
✅ Files skipped from review due to trivial changes (7)
  • src/main/runtime/rpc/methods/session-tabs.ts
  • src/renderer/src/runtime/web-runtime-session.test.ts
  • src/renderer/src/components/right-sidebar/file-explorer-drag-scroll-marker.test.tsx
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/en.json
  • src/main/runtime/rpc/methods/session-tabs.test.ts
  • src/renderer/src/i18n/locales/zh.json
🚧 Files skipped from review as they are similar to previous changes (26)
  • src/main/runtime/rpc/methods/session-tabs-schemas.ts
  • src/shared/runtime-types.ts
  • src/shared/types.ts
  • src/renderer/src/components/Terminal.tsx
  • src/preload/index.ts
  • src/renderer/src/components/right-sidebar/FileExplorerVirtualRowsAddProject.test.tsx
  • src/renderer/src/components/right-sidebar/FileExplorerVirtualRows.tsx
  • src/shared/workspace-session-terminal-schema.test.ts
  • src/renderer/src/components/tab-group/useTabGroupWorkspaceModel.ts
  • src/renderer/src/i18n/locales/ja.json
  • src/shared/workspace-session-schema.ts
  • src/renderer/src/runtime/web-runtime-session.ts
  • src/renderer/src/components/terminal/terminal-tab-actions.test.ts
  • src/renderer/src/components/terminal/terminal-tab-actions.ts
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/components/right-sidebar/FileExplorer.test.tsx
  • src/renderer/src/components/terminal-pane/TerminalPaneOverlayLayer.tsx
  • src/renderer/src/components/right-sidebar/FileExplorer.tsx
  • src/preload/api-types.ts
  • src/renderer/src/hooks/useIpcEvents.test.ts
  • src/renderer/src/hooks/useIpcEvents.ts
  • src/main/window/attach-main-window-services.ts
  • src/renderer/src/components/right-sidebar/FileExplorerRow.tsx
  • src/renderer/src/store/slices/terminals.ts
  • src/renderer/src/store/slices/store-cascades.test.ts
  • src/main/runtime/orca-runtime.ts

Comment on lines +7 to +10
if (!requestedCwd || requestedCwd.trim().length === 0) {
return undefined
}
const resolvedCwd = resolveRuntimePath(worktreePath, requestedCwd)

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

Untrimmed requestedCwd passed to resolveRuntimePath.

requestedCwd.trim() is only used for the emptiness check; the raw (potentially whitespace-padded) value is then passed to resolveRuntimePath. A value like "packages/web " would resolve to a cwd with trailing whitespace, likely causing an ENOENT at pty spawn time instead of being sanitized upfront.

🩹 Proposed fix
   if (!requestedCwd || requestedCwd.trim().length === 0) {
     return undefined
   }
-  const resolvedCwd = resolveRuntimePath(worktreePath, requestedCwd)
+  const resolvedCwd = resolveRuntimePath(worktreePath, requestedCwd.trim())
📝 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
if (!requestedCwd || requestedCwd.trim().length === 0) {
return undefined
}
const resolvedCwd = resolveRuntimePath(worktreePath, requestedCwd)
if (!requestedCwd || requestedCwd.trim().length === 0) {
return undefined
}
const resolvedCwd = resolveRuntimePath(worktreePath, requestedCwd.trim())

Comment on lines +11 to +15
if (!isPathInsideOrEqual(worktreePath, resolvedCwd)) {
// Why: remote/session clients can request terminal cwd; never let that
// become a shell outside the selected workspace.
throw new Error('Terminal cwd must be inside the selected worktree.')
}

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.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check whether cross-platform-path.ts performs any realpath/symlink resolution
rg -n -A5 -B5 'realpath|lstat|fs\.' src/shared/cross-platform-path.ts

Repository: stablyai/orca

Length of output: 151


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== Files ==\n'
git ls-files 'src/shared/*path*' 'src/shared/terminal-startup-cwd.ts'

printf '\n== Outline: src/shared/cross-platform-path.ts ==\n'
ast-grep outline src/shared/cross-platform-path.ts --view expanded || true

printf '\n== Outline: src/shared/terminal-startup-cwd.ts ==\n'
ast-grep outline src/shared/terminal-startup-cwd.ts --view expanded || true

printf '\n== Read relevant sections ==\n'
sed -n '1,220p' src/shared/cross-platform-path.ts
printf '\n---\n'
sed -n '1,120p' src/shared/terminal-startup-cwd.ts

Repository: stablyai/orca

Length of output: 7260


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== Usages of resolveTerminalStartupCwd ==\n'
rg -n "resolveTerminalStartupCwd\(" src

printf '\n== Usages of isPathInsideOrEqual / resolveRuntimePath ==\n'
rg -n "isPathInsideOrEqual\(|resolveRuntimePath\(" src

printf '\n== Worktree path origin candidates ==\n'
rg -n "worktreePath|selected worktree|selected workspace|realpath|canonical" src/shared src | head -n 200

Repository: stablyai/orca

Length of output: 28665


Resolve symlink targets before the containment check. resolveRuntimePath/isPathInsideOrEqual only normalize separators and ..; they do not canonicalize symlinks, so a symlink inside the worktree can still point outside it and bypass this boundary.

@Jinwoo-H Jinwoo-H 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.

Thanks! I made a few review fixes before landing:

  • localized the new file-explorer context-menu label
  • preserved and validated terminal startup cwd through main/runtime restore paths
  • covered crash-safe PTY persistence and web-session mirroring edge cases
  • verified the directory context-menu flow in Electron with screenshots

Validated with focused tests, typecheck, lint, and Electron UI/PTY cwd checks.

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/persistence.ts (1)

5513-5529: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

persistPtyBinding drops startupCwd when the tab record already exists.

The new else branch (tab doesn't exist yet) persists startupCwd via createMinimalPersistedTerminalTab, but the if (tab) branch only patches tab.ptyId and never applies args.startupCwd to the existing tab. Given this function exists specifically to win the race against the renderer's debounced session writer, an existing-but-not-yet-fully-synced tab record could permanently lose the requested startup cwd if a crash happens before the debounced writer's next flush — undermining the commit's stated goal of preserving startup cwd "across restore paths."

🛠️ Proposed fix
     const tabs = session.tabsByWorktree?.[args.worktreeId]
     const tab = tabs?.find((t) => t.id === args.tabId)
     if (tab) {
       tab.ptyId = args.ptyId
+      if (args.startupCwd && !tab.startupCwd) {
+        tab.startupCwd = args.startupCwd
+      }
     } else {

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f55e60a0-4506-4b17-811c-6ccae2d6fcf0

📥 Commits

Reviewing files that changed from the base of the PR and between 9827b2c and 8723d82.

📒 Files selected for processing (16)
  • src/main/ipc/pty.test.ts
  • src/main/ipc/pty.ts
  • src/main/persistence.ts
  • src/main/runtime/orca-runtime-terminal-cwd.test.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/window/attach-main-window-services.test.ts
  • src/main/window/attach-main-window-services.ts
  • 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
  • src/renderer/src/runtime/web-session-tabs-sync.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync.ts
  • src/shared/runtime-types.ts
  • src/shared/terminal-startup-cwd.test.ts
  • src/shared/terminal-startup-cwd.ts
✅ Files skipped from review due to trivial changes (3)
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/es.json
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/main/window/attach-main-window-services.ts
  • src/renderer/src/i18n/locales/zh.json
  • src/main/runtime/orca-runtime.ts

Comment on lines +33 to +35
if (!workspacePath) {
return args.requestedCwd
}

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.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Fallback silently bypasses the worktree containment check.

When workspacePath can't be resolved (e.g. workspaceId is undefined, or resolveFolderWorkspacePath returns nothing), the function returns the raw, unchecked args.requestedCwd. This defeats the entire purpose of this module — enforcing that the terminal cwd stays inside the selected worktree — for any caller where the workspace can't be resolved (e.g. pty.ts's resolveGuardedPtySpawnCwd is called with a possibly-undefined worktreeId).

🔒 Proposed fix: fail closed instead of trusting an unvalidated path
   if (!workspacePath) {
-    return args.requestedCwd
+    // Why: without a resolvable workspace root we cannot enforce the
+    // in-worktree containment check, so refuse the requested cwd rather
+    // than trusting an unvalidated path.
+    return undefined
   }
📝 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
if (!workspacePath) {
return args.requestedCwd
}
if (!workspacePath) {
// Why: without a resolvable workspace root we cannot enforce the
// in-worktree containment check, so refuse the requested cwd rather
// than trusting an unvalidated path.
return undefined
}

@Jinwoo-H
Jinwoo-H merged commit 5da41d4 into stablyai:main Jul 2, 2026
2 checks passed
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.

[Feature]: Open in Terminal option for right click on the dir in the explorer view

2 participants