Repository navigation
fix: avoid PowerShell startup for Muse Windows hooks - #26734
1aifanatic wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughOn Windows, Muse managed hook commands now prefer a direct-CMD wrapper and fall back to the existing Windows wrapper when unavailable. The payload-delivery test now covers Claude and Muse installations under cmd.exe and Git Bash. It checks POST payloads, pane keys, tokens, output, exit status, and behavior without Orca environment variables. Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: 🔵 Low · up to Muse Windows hooks now avoid starting PowerShell for ordinary drive-letter paths and keep the existing fallback otherwise. The only open item is a minor test-guard issue that could cause a false failure when the temp directory is a UNC path. 🚥 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.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
e9012562-bc07-4e26-b281-f89b94bdb008
📒 Files selected for processing (2)
src/main/agent-hooks/windows-hook-payload-delivery.test.tssrc/main/muse/hook-settings.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
| } | ||
| // ...with one exception: a cmd-safe profile must reach the script with no interpreter in | ||
| // front of it, or #18875's per-event PowerShell start-up has quietly come back. | ||
| if (WINDOWS_CMD_SAFE_PATH.test(join(home, '.orca', 'agent-hooks', provider.script))) { |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Match the direct-CMD path guard in this assertion.
If tmpdir() is a cmd-safe UNC path, this condition is true, but wrapWindowsDirectCmdHookCommand returns null because the path has no drive letter. The intended PowerShell fallback then fails this test. Require a drive-letter path here as well, so the test accepts the documented fallback.
|
Thanks @1aifanatic — your direct-launcher change is included in #26755, with Naveen Chatlapalli credited as a co-author. That PR also refreshes existing installations and has passed Windows verification and CI. Closing this as superseded; #26755 is still awaiting merge. |
Run Muse Windows hooks through the existing direct launcher on safe profile paths and refresh managed installations. Keep the PowerShell compatibility fallback for paths requiring special quoting. Verified on Windows; CI passed. Adapted the direct-launcher change from community PR #26734. Co-authored-by: Naveen Chatlapalli <[email protected]>
ELI5
Muse no longer starts PowerShell for every status update on ordinary Windows profile paths. Its existing batch script sends the update directly, reducing per-event process startup overhead.
What Changed
Use the existing Windows direct batch launcher for Muse hooks. It normalizes drive-letter paths for both cmd.exe and Git Bash. Paths requiring special quoting retain the existing fallback. The batch script already checks for Orca's environment before posting with the system curl executable.
Why
Reuse the launcher already used by Claude instead of introducing a second quoting implementation or changing the hook transport. A bare backslash path failed the real Git Bash test, so the shared cross-shell launcher is necessary.
Linked Issue
Fixes #26717
Visual Proof
N/A — background hook process launch only; no visual or interaction change.
Testing
Windows, Node 24.21.0, with ORCA_BACKGROUND_LAUNCH=1:
Full lint/test/build remain unverified locally: dependency installation stopped at the Windows registry native build because Visual Studio C++ tools are absent. The full Node typecheck exhausted memory; a constrained retry was stopped after more than ten minutes at roughly 4.7 GB. Full CI and native macOS/Linux coverage remain outstanding.
AI Disclosure
GPT-6 was used to investigate, implement, test and review this change.
Review
The change is guarded by Windows platform detection. Local macOS/Linux and remote SSH commands retain their POSIX launcher; no remote wire changes. The shared Windows launcher keeps the existing fallback for unsafe, Unicode and UNC paths. Other integrations are unchanged, and Claude's live delivery test still passes. No workspace Git assumptions or UI changes. Ordinary paths remove a per-event interpreter process; payloads still travel through stdin to the existing authenticated loopback endpoint. No new command interpolation or dependencies.
Agent skill upstream boundary
Notes
Specially quoted paths retain PowerShell compatibility; the fast path covers safe drive-letter paths.
Author
X: @1aifanatic
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)