Skip to content

fix(wsl): refuse Windows drive folders on a WSL host, offer Add on this computer - #34530

Merged
nwparker merged 3 commits into
mainfrom
nwparker/wsl-host-refuse-drvfs
Oct 27, 2026
Merged

nwparker merged 3 commits into
mainfrom
nwparker/wsl-host-refuse-drvfs

Conversation

@nwparker

@nwparker nwparker commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 12 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​698 $\color{#cf222e}{\Huge{\mathbf{−}}}$​21 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​677
Prod 30 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​608 $\color{#cf222e}{\Huge{\mathbf{−}}}$​54 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​554

ELI5

On a computer running Windows, a project can be added to a WSL host (Orca's server running inside a Linux distro). If that project folder is really on a Windows drive (the distro sees C: as /mnt/c), Git inside Linux gets it wrong: every file looks changed because of line endings, edits made from Windows are missed, and searches are slow. Orca now refuses those folders on a WSL host and offers a one-click Add on this computer, which adds the same folder as a normal Windows project.

What Changed

User risk: none outside WSL hosts. Every check runs only for a WSL host: on the desktop, only when the selected host maps to a WSL distro; on the host, only in an orcad launched as a WSL host. Add Project for this computer and for SSH hosts behaves as before. An earlier revision made Add Project select this computer whenever it opened with a dropped local folder, which every user would have seen. That is removed. The "Add on this computer" entry point now uses its own dialog field, addOnThisComputerPath.

Before: typing /mnt/c/... in Add Project for a WSL host, or picking \\wsl.localhost\<distro>\mnt\c\..., added the folder to the WSL host. A picked C:\... folder was refused, but only with a hint to switch hosts.

After:

  • Desktop, inside Add Project. The dialog refuses these and shows the reason inline, together with an Add on this computer button:

    • a typed /mnt/<drive> path, normalized first, so /mnt/c/../../home is allowed and /mnt/C/x is refused;
    • a picked C:\... folder;
    • a picked \\wsl.localhost\<any distro>\mnt\<drive> folder, including the \\?\UNC\ long-path spelling;
    • a refusal sent back by the host.

    The refusal is inline rather than a toast because toasts above a modal can't be clicked. The button switches the open dialog to this computer and then adds the folder there. The add waits one render after the switch so the dialog's host-change reset can't cancel it, and nothing closes or reopens. A refused create switches to this computer and opens the create step with the parent folder filled in. The button is offered only on a Windows desktop. If the switch to this computer can't happen, the pending add is dropped.

  • Desktop, sidebar drop. With WSL hosts turned on, a dropped drvfs folder from any distro is routed as the Windows folder it is, the same way a picked one is. With them off, the drop is routed exactly as on main: it stays a WSL-bridge project at its UNC path. A Windows-drive drop while a WSL host is focused gets a toast whose Add on this computer opens Add Project on this computer. No dialog is open at that moment, so the toast can be clicked.

  • WSL host (orcad). These operations check the path against the distro's Windows-drive mounts:

    • repo.add;
    • repo.create (the parent folder);
    • repo.clone (the destination);
    • folderWorkspace.create (only when an explicit folder is passed);
    • the nested-repo scan and import.

    Symlinks are resolved first. Mounts come from /proc/self/mountinfo and are read on every check, so a drive mounted after orcad started is still caught. A mount counts as a Windows drive if it is drvfs, virtiofs, or 9p with aname=drvfs, so /usr/lib/wsl/drivers is not one. The host only suggests a C:\ path when the mount source is a drive letter and the mount covers the whole drive. A drvfs mount of a network share, or a bind of a drive subfolder, is refused with no suggested path, because a wrong suggestion is worse than none.

  • Wire compatibility. repo.add, repo.clone, folderWorkspace.create and the scan/import keep the existing runtime_error code and add an optional data: { kind: 'wsl_host_windows_drive_path', windowsPath }. repo.create keeps its { error } result and adds an optional windowsDriveRefusal field. Older desktops and the CLI show the plain message, which also says to add the folder on this computer.

Why

The owner's decision is that Windows-drive folders are native Windows projects, which can still use WSL terminals. Checking only on the desktop would let an older client, or a symlink into /mnt/c, through. Checking only on the host would scan the drive first and leave older clients without the offer, so both are needed. Switching the host inside the open dialog avoids a close-and-reopen sequence whose host selection could race.

Linked Issue

Internal gate E8 for making the WSL host the default; no issue.

Visual Proof

The e2e (tests/e2e/wsl-host-fake-transport.spec.ts, C8 section) saves screenshots of the inline refusal for a picked drive folder, a picked \\wsl.localhost\Ubuntu\mnt\c folder and a typed /mnt/d path. It also checks that the dialog switched off the WSL host after the click. Not run locally because the machine is overloaded; CI produces them.

Testing

  • Unit tests:

    • Typed-path normalization, picked-path classification (drive, any distro's drvfs, long paths) and refusal parsing.
    • The mountinfo parser: drvfs only with aname=drvfs, and no suggested path for share or bind mounts.
    • The host guard: drive mounts, symlinks, missing folders, mounts re-read per check, and non-WSL hosts such as SSH.
    • The host backstop for clone, create (which keeps its typed detail) and explicit folder workspaces.
    • Error mapping.
    • Picker and drop parity.
    • The server-path flow: inline refusal before any scan, normalization, and SSH/paired hosts unaffected.
    • The store: the refusal goes to the dialog when it is open, and is a plain toast otherwise.
    • The inline hook: it adds only after the host switch lands, the create action fills the parent folder, and there is no button without a known path or on a web client.
  • e2e: the updated C8 section, as above.

  • pnpm tc, pnpm run typecheck:ci, check:code-quality:changed and the touched tests pass. Full lint and test are left to CI under the overloaded-machine rule.

  • I manually tested these changes locally

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

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • SSH: no change. The host check needs the WSL-host launch marker, and the desktop check needs a WSL host's distro mapping.
  • Folder workspaces get the same refusal as Git projects.
  • Mixed versions: older clients get the readable message; older hosts don't refuse, but a newer desktop still stops typed and picked drive paths first.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • 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)

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in 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

The changes add WSL mount parsing and Windows-drive path detection. Runtime repository operations reject selected paths that map to Windows drives and return typed refusal details. Renderer flows detect and propagate refusals, display notices in the Add Project dialog, and offer a local-host action for supported paths. Project-drop routing also converts supported WSL UNC paths to Windows paths.

Priority: Normal

Merge Risk: Moderate · up to b3f72

Some Windows-drive projects can still bypass protection or fail without the offered local-host recovery, and the e2e test does not fully guard the refusal behavior.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 36.36% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surv… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title "fix(wsl): refuse Windows drive folders on a WSL host, offer Add on this computer" names the main change: WSL hosts refuse Windows-drive folders and offer an Add on this computer option. The…
Description check Passed The description follows the template sections: ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist. It explains the…
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.
Full details: Title check

Explanation

The title "fix(wsl): refuse Windows drive folders on a WSL host, offer Add on this computer" names the main change: WSL hosts refuse Windows-drive folders and offer an Add on this computer option. The changeset implements exactly this, across the desktop dialog, sidebar drop routing, and host-side guards. The title is a single sentence, but at 80 characters it is slightly long and uses a conventional-commit prefix.

Full details: Description check

Explanation

The description follows the template sections: ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist. It explains the before and after behavior, the mechanism, and the reasons for the approach. Gaps: the Linked Issue section has no issue link (it cites an internal gate instead, and the template says outside contributors need a real issue), the Visual Proof section has no before/after attachments and the screenshot checkbox is unchecked, the AI Disclosure section is empty, and the lint, typecheck, test, and build checkbox is unchecked. The e2e run was not performed locally.

Full details: Docstring Coverage

Explanation

Docstring coverage is 36.36% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 44 functions across 40 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Nitpick comments: 2
src/renderer/src/lib/wsl-host-windows-drive-refusal-toast.ts: 1

33-37: Trivial · Maintainability & Code Quality · Quick win

Use a named placeholder in the new string.

The new descriptionWithPath string uses the positional placeholder {{value0}}. The localization guideline requires intent-named IDs with named interpolation placeholders for new strings. Only existing hash-based strings are grandfathered. Rename the placeholder to {{path}}. Update the matching entry in src/renderer/src/i18n/locales/en.json (Line 1471) in the same change.

♻️ Proposed change
-            '{{value0}} is on a Windows drive. Git in WSL reports false line-ending changes there, misses edits made from Windows, and searches it slowly.',
-            { value0: windowsPath }
+            '{{path}} is on a Windows drive. Git in WSL reports false line-ending changes there, misses edits made from Windows, and searches it slowly.',
+            { path: windowsPath }

Based on learnings: for newly added user-facing strings in stablyai/orca, follow config/i18n-translation-source.md and use intent-named localization IDs with named interpolation placeholders.

Source: Learnings

tests/e2e/wsl-host-fake-transport.spec.ts: 1

199-206: Trivial · Maintainability & Code Quality · Quick win

Assert the reopened dialog through the DOM, not through store state.

expectDriveRefusal polls window.__store for activeModal === 'add-repo' and modalData.droppedLocalPath. The tests/e2e/** guideline says to use window.__store for setup and to assert user-visible behavior through the DOM. Reading store state cannot catch a dialog that fails to render. This applies to hidden CDP-driven renderers too.

Keep the store poll if you want the exact path check. Add a DOM assertion that the "Add a project" dialog is visible after the click. Assert the selected host label there if the dialog exposes it.

♻️ Proposed addition
     await toast.getByRole('button', { name: 'Add on this computer' }).click()
+    await expect(page.getByRole('dialog', { name: /Add a project/i })).toBeVisible()
     await expect
       .poll(() =>

As per coding guidelines: "Use window.__store for setup; assert user-visible behavior through the DOM (getByRole, toBeVisible, toHaveText)."

Source: Coding guidelines


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3a098de2-f20c-4a11-8649-80fda8168397
Commits

Reviewing files that changed from the base of the PR and between 1d2778f and ef1d07c.

Files selected for processing: 26
  • src/main/ipc/wsl-guest-windows-drive-path.test.ts
  • src/main/ipc/wsl-guest-windows-drive-path.ts
  • src/main/runtime/rpc/errors.test.ts
  • src/main/runtime/rpc/errors.ts
  • src/main/runtime/runtime-nested-repo-import.ts
  • src/main/runtime/runtime-repository-registration-controller.ts
  • src/main/runtime/wsl-host-windows-drive-guard.test.ts
  • src/main/runtime/wsl-host-windows-drive-guard.ts
  • src/renderer/src/components/sidebar/AddRepoDialog.tsx
  • src/renderer/src/components/sidebar/add-repo-wsl-host-folder-picker.test.ts
  • src/renderer/src/components/sidebar/add-repo-wsl-host-folder-picker.ts
  • src/renderer/src/components/sidebar/sidebar-project-drop.test.ts
  • src/renderer/src/components/sidebar/sidebar-project-drop.ts
  • src/renderer/src/components/sidebar/use-add-repo-wsl-host-paths.ts
  • src/renderer/src/components/sidebar/useAddRepoServerPathFlow.test.ts
  • src/renderer/src/components/sidebar/useAddRepoServerPathFlow.ts
  • src/renderer/src/components/sidebar/useSidebarProjectDrop.ts
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/windows-path-access.ts
  • src/renderer/src/lib/wsl-host-windows-drive-refusal-toast.ts
  • src/renderer/src/store/repos/repo-add-actions.ts
  • src/renderer/src/store/slices/repos-wsl-host-windows-drive-refusal.test.ts
  • src/shared/wsl-host-windows-drive-refusal.test.ts
  • src/shared/wsl-host-windows-drive-refusal.ts
  • tests/e2e/wsl-host-fake-transport.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

@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
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0c74ec84-4bbd-4896-b887-1da459be6bd5
Commits

Reviewing files that changed from the base of the PR and between ef1d07c and e3d5567.

Files selected for processing: 36
  • src/main/runtime/runtime-project-group-controller.ts
  • src/main/runtime/runtime-repository-clone-controller.ts
  • src/main/runtime/runtime-repository-registration-controller.ts
  • src/main/runtime/wsl-guest-drive-mountinfo.test.ts
  • src/main/runtime/wsl-guest-drive-mountinfo.ts
  • src/main/runtime/wsl-host-windows-drive-backstop.test.ts
  • src/main/runtime/wsl-host-windows-drive-guard.test.ts
  • src/main/runtime/wsl-host-windows-drive-guard.ts
  • src/renderer/src/components/sidebar/AddRepoCreateStep.tsx
  • src/renderer/src/components/sidebar/AddRepoDialog.tsx
  • src/renderer/src/components/sidebar/AddRepoDialogStepContent.tsx
  • src/renderer/src/components/sidebar/AddRepoServerStartStep.tsx
  • src/renderer/src/components/sidebar/AddRepoStartSteps.tsx
  • src/renderer/src/components/sidebar/AddRepoWindowsDriveNotice.tsx
  • src/renderer/src/components/sidebar/add-repo-wsl-host-folder-picker.test.ts
  • src/renderer/src/components/sidebar/add-repo-wsl-host-folder-picker.ts
  • src/renderer/src/components/sidebar/sidebar-project-drop.test.ts
  • src/renderer/src/components/sidebar/sidebar-project-drop.ts
  • src/renderer/src/components/sidebar/use-add-repo-dialog-modal-paths.ts
  • src/renderer/src/components/sidebar/use-add-repo-windows-drive-refusal.test.tsx
  • src/renderer/src/components/sidebar/use-add-repo-windows-drive-refusal.tsx
  • src/renderer/src/components/sidebar/use-add-repo-wsl-host-paths.test.tsx
  • src/renderer/src/components/sidebar/use-add-repo-wsl-host-paths.ts
  • src/renderer/src/components/sidebar/useAddRepoLocalFolderFlow.ts
  • src/renderer/src/components/sidebar/useAddRepoServerPathFlow.test.ts
  • src/renderer/src/components/sidebar/useAddRepoServerPathFlow.ts
  • src/renderer/src/components/sidebar/useCreateRepo.ts
  • src/renderer/src/components/sidebar/useSidebarProjectDrop.ts
  • src/renderer/src/lib/wsl-host-windows-drive-refusal-toast.ts
  • src/renderer/src/store/repos/repo-add-actions.ts
  • src/renderer/src/store/repos/repo-state.ts
  • src/renderer/src/store/slices/repos-wsl-host-windows-drive-refusal.test.ts
  • src/shared/windows-path-access.ts
  • src/shared/wsl-host-windows-drive-refusal.test.ts
  • src/shared/wsl-host-windows-drive-refusal.ts
  • tests/e2e/wsl-host-fake-transport.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

return
}
// A missing path cannot resolve; its spelling is still checked.
const resolved = await deps.realpath(path).catch(() => null)

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.

Major · Functional Correctness · Heavy lift

Resolve existing ancestors of a new destination.

If /home/me/drive links to /mnt/c and /home/me/drive/new does not exist, realpath(path) fails. The guard then checks only the /home/me spelling and permits the path. create and clone can subsequently create the project on the Windows drive. Resolve the nearest existing ancestor and append the missing components before matching mounts. Node 24 documents that realpath returns ENOENT for a nonexistent path. (nodejs.org)

… them on this computer

A /mnt/<drive> project on a WSL host shows false line-ending changes, misses
edits made from Windows, and searches slowly. Add Project refuses typed,
picked and dropped Windows drive folders for a WSL host and shows the refusal
inline with Add on this computer, which switches the open dialog to this
computer. The WSL-host orcad re-checks by /proc/self/mountinfo (after
resolving symlinks) in repo.add, repo.create, repo.clone, explicit
folderWorkspace.create and the nested scan/import, answering with the
existing runtime_error code plus optional data, so older clients still show a
readable message. Everything is behind the WSL hosts gate; SSH is untouched.
@nwparker
nwparker force-pushed the nwparker/wsl-host-refuse-drvfs branch from fa17ad8 to 96892c6 Compare October 27, 2026 22:30

@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
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b4d95379-0877-4186-9c0f-ab5c5fbef51c
Commits

Reviewing files that changed from the base of the PR and between e3d5567 and 96892c6.

Files selected for processing: 15
  • src/main/runtime/rpc/errors.ts
  • src/main/runtime/runtime-repository-registration-controller.ts
  • src/renderer/src/components/sidebar/sidebar-project-drop.test.ts
  • src/renderer/src/components/sidebar/sidebar-project-drop.ts
  • src/renderer/src/components/sidebar/use-add-repo-host-selection.ts
  • src/renderer/src/components/sidebar/use-add-repo-windows-drive-refusal.test.tsx
  • src/renderer/src/components/sidebar/use-add-repo-windows-drive-refusal.tsx
  • src/renderer/src/components/sidebar/useAddRepoLocalFolderFlow.ts
  • src/renderer/src/components/sidebar/useAddRepoServerPathFlow.ts
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/windows-path-access.ts
  • src/renderer/src/store/repos/repo-add-actions.ts
  • src/renderer/src/store/repos/repo-state.ts
  • tests/e2e/wsl-host-fake-transport.spec.ts
Files skipped from review as they are similar to previous changes: 2
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/locales/en.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

return { error: 'Parent directory must be an absolute path' }
}
try {
await refuseWslHostWindowsDrivePath(trimmedParentPath)

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.

Major · Functional Correctness · Quick win

Guard the repository target as well as its parent.

If /home/me/projects/link is a symlink to an empty directory under /mnt/c, create('/home/me/projects', 'link') passes this parent-path check. The later stat and readdir accept the target directory. Git initialization or folder registration then proceeds on the Windows drive without a refusal. Check targetPath before using an existing directory, and return the same structured refusal when that check fails. (raw.githubusercontent.com)

@blacksmith-sh

This comment has been minimized.

…lure

On the Linux CI host the switched local add of a Windows path fails its nested
scan and hands off to the Open as Folder modal, closing Add Project before the
test looked. The refusal itself already came before any scan. The e2e now
records the local add at its scan step and asserts it went to this computer
with the Windows path; a unit test pins that a refused pick never reaches the
host path step.

@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
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e129ce92-6f20-429b-a80c-8efd754812d9
Commits

Reviewing files that changed from the base of the PR and between 96892c6 and cb6c38e.

Files selected for processing: 2
  • src/renderer/src/components/sidebar/use-add-repo-wsl-host-paths.test.tsx
  • tests/e2e/wsl-host-fake-transport.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

.filter({ hasText: windowsPath })
await expect(notice).toBeVisible({ timeout: 30_000 })
// Refused before any scan: nothing has been added yet, on either host.
expect(localAdds).toEqual([])

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.

Minor · Functional Correctness · Quick win

Record scans before asserting that no scan occurred.

If a refused pick starts a scan before the user clicks “Add on this computer,” this assertion still passes. The test installs its scan recorder only after the assertion. Install a recorder before each pick or typed-path submission, then assert that it recorded no pre-action scan. (raw.githubusercontent.com)

@blacksmith-sh

This comment has been minimized.

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

⚠️ Outside diff range comments (2)

Minor · Guard each resolved nested import path before persistence. · runtime-nested-repo-import.ts:81-128

src/main/runtime/runtime-nested-repo-import.ts:81-128
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Guard each resolved nested import path before persistence.

RuntimeNestedRepoImport.import checks only args.parentPath. A nested scan can discover a Git repository inside a Windows-drive mount below an otherwise valid Linux parent. The loop then resolves that path and calls store.addRepo(repo) without checking importRepoPath, so the WSL host can persist a Windows-drive repository.

Suggested fix
        const importRepoPath = await importTargetResolver.resolveLocal(repoPath)
+       await refuseWslHostWindowsDrivePath(importRepoPath)
        const normalizedImportRepoPath = normalizeRuntimePathForComparison(importRepoPath)
Minor · Preserve nested-import WSL refusals. · nested-repository-operations.ts:81-115

src/renderer/src/store/project-groups/nested-repository-operations.ts:81-115
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Preserve nested-import WSL refusals.

A WSL nested import can reject its parent path with WslHostWindowsDriveRefusalError. importNestedRepos catches that error, shows only Failed to import repositories, and returns null. The nested Add Project flow then exits without showing the Windows-drive refusal or offering the local-host action.

Preserve the refusal at src/renderer/src/store/project-groups/nested-repository-operations.ts:107-115, then pass it through useAddRepoNestedImportFlow and useAddRepoNestedReviewController to windowsDrive.showRefusal in AddRepoDialog. Use the same readWslHostWindowsDriveRefusal handling as addRepoPath. This is separate from guarding each nested repository path: those guards produce the refusal, while this renderer boundary must preserve it.


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f9c9b295-c149-4a71-bfcd-1db2b05b9ba0
Commits

Reviewing files that changed from the base of the PR and between cb6c38e and b3f7240.

Files selected for processing: 1
  • tests/e2e/wsl-host-fake-transport.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@nwparker
nwparker merged commit 90c713a into main Oct 27, 2026
84 of 85 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.

1 participant