fix: detect npm kimi process - #3318
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe detector now identifies node-wrapped Kimi processes by matching the trailing ChangesKimi detection
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change narrowly improves Kimi detection for the Windows PowerShell npm entry point without altering process selection or lifecycle behavior. No actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
| .split(['/', '\\']) | ||
| .filter(|component| !component.is_empty()) | ||
| .collect(); | ||
| let kimi_entrypoint = [ |
There was a problem hiding this comment.
@akbash-bot why do we need to add exact kimi paths? how do we solve this for other agents? this feels weird
There was a problem hiding this comment.
PowerShell exposes this launch as generic node.exe, so the argv script is the only process-identity signal Herdr receives. The exact match avoids treating unrelated Node programs as Kimi. This follows existing special cases for Pi, Qwen, MastraCode, and Cursor; it is not a scalable Kimi-specific design.
I agree the current shape is awkward. The general fix is a table-driven process-signature registry per canonical agent: executable aliases plus exact generic-runtime argv/package signatures. Platform code would only collect name/argv, and the shared detector would evaluate that registry for every agent. I would not put process identity in remotely updated screen manifests because identity gates lifecycle authority. Hooks also cannot bootstrap this today because known-agent reports require existing process ownership. This PR is the smallest restoration; replacing the existing special cases with a registry would be a broader refactor.
Issue
Starting Kimi with the plain
kimicommand in Windows PowerShell leaves its pane undetected. Kimi only appears when it is launched throughkimi.cmd.Problem
The PowerShell npm shim starts Kimi as
node.exewith Kimi's package entry point. Herdr did not recognize that entry point, so it never associated the installed lifecycle reports with Kimi.How did we fix it?
Herdr now recognizes the exact
@moonshot-ai/kimi-code/dist/main.mjspackage entry point as Kimi. The match is case-insensitive but rejects package lookalikes, helper scripts, and trailing path components. Existing process selection and lifecycle behavior are unchanged.Verification
The exact reported Node command returned no agent before the change and returns Kimi afterward. Focused tests cover the reported path and near misses, and all 58 detector tests plus formatting and clippy pass. All PR checks pass on Linux, macOS, and Windows. Local CI passed 3,535 tests; one live-handoff test could not inspect the issue-isolated target path even though its replacement server started successfully.
refs #3317