Repository navigation
Conversation
Devin runs hook commands through Git Bash sh -c, which strips the backslashes from the bare .cmd path Orca registered, so every Devin status hook exited 127 on Windows. Register the cmd-safe script path with forward slashes instead; spaced paths keep the PowerShell launcher. Fixes stablyai#20855
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughOn Windows, Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The change targets the reported Windows hook-path issue, and no remaining defect is established. Windows end-to-end behavior was not exercised, so confirm the fix in a Windows environment. 🚥 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 |
ELI5
On Windows, Orca tells the Devin CLI "run this little script whenever something happens" so Orca can show whether Devin is working or done. Orca wrote the script's location with Windows backslashes. Devin hands that line to a Unix-style shell, and that shell treats backslashes as escape characters and throws them away. The script location became nonsense, the script never ran, and Orca never learned anything about Devin. This PR writes the location with forward slashes, which both the shell and Windows understand.
What Changed
Before (as the user sees it): a Devin session on Windows shows no agent status at all. There is no working spinner and no done indicator, and
orca worktree ps --jsonreportsagents: []even while Devin is working. The reporter of #20855 traced it to the hook command Orca writes into%APPDATA%\devin\config.json:Devin runs hook commands through Git Bash
sh -c, which strips the backslashes, so every event fails:The reporter verified
sh -c "C:\Users\...\devin-hook.cmd"exits 127, whilesh -c "C:/Users/.../devin-hook.cmd"exits 0 and status starts flowing.After: Orca registers
C:/Users/<user>/.orca/agent-hooks/devin-hook.cmd, the same forward-slash form the reporter used as a workaround. Devin's status shows up again for sessions started after Orca rewrites the config.Mechanism:
getDevinManagedCommandinsrc/main/devin/hook-settings.tsused to return the sharedwrapWindowsCmdHookCommandresult, which is the bare backslash path when the path is cmd-safe. It now returns that same cmd-safe path with backslashes turned into forward slashes. Paths that are not cmd-safe (for example a user folder with a space) keep the existing PowerShell-EncodedCommandlauncher, whose executable path is already written with forward slashes. Upgrading users need no manual step: Orca's managed-hook matcher already normalises backslashes before matching, so the next hook install removes the old backslash entries and writes the new one. Only Devin changes. The shared wrapper and the other agents are untouched.Why
A forward-slash path is the narrowest change that works for every way Devin might run the command. An older code comment (from #8737) says Devin spawns the command directly as
argv[0]; the reporter's log shows it now goes throughsh -c. A bare forward-slash path to a.cmdfile should work under both.shleaves it alone, which the reporter verified. For a direct spawn, Rust'sstd::process::Commandroutes a.cmdthroughcmd.exewith the path quoted, and Windows accepts forward slashes in a drive-letter path. That direct-spawn case is reasoned from documentation, not tested on Windows. Alternatives considered:sh, but a direct spawn would then receive the quotes as part of the program name.sh, but it brings back the extra interpreter that fix(agent-hooks): make Windows cmd hook launcher directly spawnable (#8430 regression) #8737 and Windows: injected Claude Code hook (powershell.exe -EncodedCommandwrapper) adds 1-5 s per hook event and is killed under load, leaving suspended orphan processes #18875 removed for speed and antivirus reasons.wrapWindowsCmdHookCommandwould alter Codex, Cursor and Antigravity hooks, which have no reported problem.The cmd-safe check still runs on the original path, so the forward-slash output only ever contains letters, digits,
_ . : ~ -and/. None of those need quoting insh,cmd.exeor a direct spawn.Linked Issue
Fixes #20855
Visual Proof
N/A. The change is the text of a command written into Devin's config file. There is no Orca UI change. The visible effect is that Devin's existing status indicator starts working on Windows.
Testing
Tested on macOS only. I did not run this on a Windows host, so the end-to-end Devin run on Windows relies on the reporter's verified
sh -cresult above.src/main/devin/hook-service.test.tsadds two tests. The first pins that a Windows backslash script path becomesC:/Users/ada/.orca/agent-hooks/devin-hook.cmd, and that a reinstall replaces an old backslash entry with the new one. It failed onmainwithReceived: "C:\Users\ada\.orca\agent-hooks\devin-hook.cmd"and passes with the fix. The second pins that POSIX paths still produce the unchanged POSIX wrapper.Ran the Devin tests plus the shared hook contract, stdin lifecycle, Windows hook interpreter, installer, remote installer and timeout suites: 8 files, all passing.
oxlintandoxfmt --checkon the changed files are clean.Full main-process typecheck (
tsc --noEmit -p config/tsconfig.node.json) passes.I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Written with Claude (Anthropic) in Claude Code. Reviewed by OpenAI Codex (
codex exec, read-only) before pushing.Review
OpenAI Codex reviewed the diff read-only and reported no actionable findings. It confirmed that the matcher sweeps old backslash entries, the PowerShell fallback is unchanged, and the new tests restore
process.platform. It noted one remaining risk: if Devin ever handed a.cmdpath straight to rawCreateProcesswithout a command interpreter, it might not run. The old backslash command had the same exposure, so this PR does not make that worse.getDevinRemoteManagedCommand, which is unchanged and always POSIX..cmdlaunch.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Not verified on a Windows machine. Open PR #11081 adds a test that expects Devin's Windows command to be a backslash path. If both land, that one assertion needs to accept the forward-slash form.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)