Skip to content

fix(cli): resolve spawn EFTYPE on Windows for kimi web and /web#903

Open
ForgottenR wants to merge 1 commit into
MoonshotAI:mainfrom
ForgottenR:fix/web-daemon-windows-eftype
Open

fix(cli): resolve spawn EFTYPE on Windows for kimi web and /web#903
ForgottenR wants to merge 1 commit into
MoonshotAI:mainfrom
ForgottenR:fix/web-daemon-windows-eftype

Conversation

@ForgottenR

@ForgottenR ForgottenR commented Jun 18, 2026

Copy link
Copy Markdown

Related Issue

Resolve #892

Problem

On Windows, spawnDaemonChild tried to execute dist/main.mjs directly. Windows does not honor shebangs and .mjs is not a PE executable, so CreateProcessW returns ERROR_BAD_EXE_FORMAT, which Node reports as spawn EFTYPE.

What changed

Changed spawnDaemonChild to run the resolved program through process.execPath:

  • If the resolved program is already process.execPath (SEA binary or an already-running daemon child), pass the original args unchanged.
  • Otherwise, prepend the script path as the first argument.

This keeps Unix/macOS behavior unchanged while fixing Windows.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works. (Existing spawnDaemonChild test still passes; no new test added.)
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Jun 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9d7ffc1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ForgottenR

Copy link
Copy Markdown
Author

@wbxl2000 @sailist Could you take a look at this PR when you have a moment?

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.

windows系统上无法使用web ui功能

1 participant