Repository navigation
Conversation
Greptile SummaryThis PR fixes Windows command override paths being corrupted by the POSIX tokenizer when users specify agent command paths like
Confidence Score: 5/5The change is a well-scoped, additive fix: backslash handling in the tokenizer is gated by a new parameter with a safe POSIX default, and all call sites consistently derive the flavor from the SSH provider's reported host platform. No existing behavior changes for macOS, Linux, or WSL targets. All call sites use optional chaining with a 'posix' fallback, so the feature degrades gracefully when getHostPlatform is absent. The options parameter to discoverCommitMessageModelsLocal defaults to {}, making options.wslDistro safely undefined. The non-null assertion (provider!) in orca-runtime-git.ts is backed by an explicit early return on target.connectionId && !provider. New tests cover the Windows native, remote-Windows, and WSL POSIX paths. Files Needing Attention: No files require special attention.
|
| Filename | Overview |
|---|---|
| src/shared/commit-message-prompt.ts | Adds CommandTemplatePathFlavor type and pathFlavor parameter to tokenizeCustomCommandTemplate and planCustomCommand; backslash escape logic is gated on pathFlavor === 'posix' so Windows backslashes are passed through literally. |
| src/shared/commit-message-plan.ts | Adds CommitMessagePlanOptions with optional commandPathFlavor; propagates pathFlavor through planAgentBinary, planAdditionalAgentArgs, and planCommitMessageGeneration. |
| src/main/text-generation/commit-message-text-generation.ts | Adds optional commandPathFlavor to remote CommitMessageGenerationTarget; adds getCommandPathFlavor helper; plumbs flavor into all three generation functions and both local/remote model discovery paths. |
| src/main/ipc/filesystem.ts | Three remote target construction sites updated to set commandPathFlavor from provider.getHostPlatform?.()?.pathFlavor ?? 'posix'; remote model discovery call updated with same flavor. |
| src/main/runtime/orca-runtime-git.ts | Four remote target / discovery call sites updated with commandPathFlavor; one uses provider!.getHostPlatform?.() which is safe given the preceding null guard at line 720. |
| src/main/agent-hooks/first-work-generation-target.ts | Adds commandPathFlavor to the remote generation target built from an SSH provider, propagating path flavor into branch-name generation. |
| src/shared/commit-message-plan.test.ts | Adds a test verifying that Windows agentCommandOverride paths with backslashes are preserved when commandPathFlavor: 'windows' is passed. |
| src/shared/commit-message-prompt.test.ts | Adds unit tests for the two new tokenizer behaviors: Windows paths keep backslashes, POSIX paths still honor backslash-escape sequences. |
| src/main/text-generation/commit-message-text-generation.test.ts | Adds tests for native Windows local spawn, remote Windows target with Windows paths, and WSL POSIX override paths; updates existing WSL test to include a POSIX override command. |
| src/main/ipc/filesystem.test.ts | Updates SSH provider mock to return getHostPlatform with pathFlavor: 'windows'; extends expectations to assert commandPathFlavor: 'windows' propagates correctly. |
Reviews (2): Last reviewed commit: "style: condense command tokenizer commen..." | Re-trigger Greptile
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (10)
🚧 Files skipped from review as they are similar to previous changes (10)
📝 WalkthroughWalkthroughCommand planning now accepts POSIX or Windows path flavors and preserves backslashes according to the selected platform. Local, WSL, and remote model discovery and generation paths derive and propagate this flavor. SSH providers expose host platform information to remote commit message, pull request field, and model discovery flows. Tests cover Windows command overrides, PowerShell paths, WSL path mapping, remote planning, and SSH propagation. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/shared/commit-message-prompt.ts (1)
140-142: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueCondense this implementation comment.
The new three-line comment exceeds the repository’s concise, preferably one-line comment convention.
Proposed change
-// Why: this parser only groups argv; Windows keeps path separators literal, -// while POSIX targets retain the existing backslash escapes. We do not expand -// variables, substitutions, globs, or `~`. +// Why: POSIX honors backslash escapes; Windows preserves them literally.Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: bb5f4673-4c57-40f5-b515-77912a295381
📥 Commits
Reviewing files that changed from the base of the PR and between 4543bb6 and 9fe3b10c1ba1fb9b74ac7583be6d66e31995608a.
📒 Files selected for processing (10)
src/main/agent-hooks/first-work-generation-target.tssrc/main/ipc/filesystem.test.tssrc/main/ipc/filesystem.tssrc/main/runtime/orca-runtime-git.tssrc/main/text-generation/commit-message-text-generation.test.tssrc/main/text-generation/commit-message-text-generation.tssrc/shared/commit-message-plan.test.tssrc/shared/commit-message-plan.tssrc/shared/commit-message-prompt.test.tssrc/shared/commit-message-prompt.ts
8a55e3b to
1fa8bdc
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
Closing as part of fork PR backlog cleanup. This branch is long-conflicted (DIRTY) against current |
Summary
Fixes #11375
Screenshots
No visual change.
Testing
Focused checks:
AI Review Report
Reviewed command tokenization, all local and SSH generation callers, WSL isolation, and model discovery. Greptile rated the change 5/5 with no files needing attention. CodeRabbit flagged one verbose comment; commit 8a55e3ba8 condensed it. Cross-platform review verified that macOS, Linux, WSL, and POSIX SSH keep existing backslash escapes while native and SSH Windows preserve path separators.
Security Audit
The tokenizer remains argv-only and does not add shell execution, variable expansion, command substitution, globbing, or home expansion. The review covered arbitrary command overrides, quoted paths, WSL host separation, SSH host path flavor, and fallback behavior when remote platform detection is unavailable. No secrets or dependency changes are included.
Notes
The path flavor defaults to POSIX for backward compatibility. Native Windows is selected only for a local win32 target without WSL or an SSH host explicitly detected as Windows.