Skip to content

fix(kimi-code): select compatible PowerShell for Computer Use - #2686

Merged
wbxl2000 merged 5 commits into
mainfrom
qer/kimi-cu-powershell-fallback
Aug 6, 2026
Merged

fix(kimi-code): select compatible PowerShell for Computer Use#2686
wbxl2000 merged 5 commits into
mainfrom
qer/kimi-cu-powershell-fallback

Conversation

@wbxl2000

@wbxl2000 wbxl2000 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Related Issue

No linked issue. This fixes Windows installation failures reproduced from Kimi Computer Use debug sessions and a naming mismatch observed after installation.

Problem

The Windows Kimi Computer Use installer was always launched with the system powershell.exe. On systems where that PowerShell installation does not provide commands required by the official setup script, such as Get-FileHash, installation fails even when a compatible PowerShell 7 installation is available.

The failure also happened after entering the capability installation flow, without first checking whether the selected PowerShell could run the official installer.

A runtime repair also replaced the plugin even when its wiring was already healthy. On Windows, a live plugin MCP process can keep that managed directory locked, exposing a raw EBUSY rename error instead of actionable recovery guidance.

Before installation, the Official marketplace used the built-in capability name Kimi Computer Use. After installation, the Installed tab used the Windows plugin manifest name Kimi Computer Use for Windows, making the same product appear to change names.

What changed

  • Probe the system Windows PowerShell for the version and commands required by the official installer.
  • Fall back to PowerShell 7 from its trusted Program Files installation path when the system PowerShell is incompatible.
  • Fail with path-specific diagnostics before downloading the installer or changing plugin wiring when neither installation is compatible.
  • Continue to run the unchanged official setup script, while forcing UTF-8 console output so PowerShell diagnostics remain readable.
  • Keep healthy plugin wiring untouched when only the Windows runtime needs repair.
  • Explain that Kimi Code must be restarted when live plugin files are locked, including after removing a built-in capability plugin.
  • Use Kimi Computer Use for Windows for the Windows capability so the Official and Installed tabs display the same name.
  • Cover the PowerShell selection, fail-before-mutation, healthy-plugin, locked-file, removal-hint, and Windows display-name paths with focused tests.
  • Add a patch changeset for @moonshot-ai/kimi-code.

Verification

  • pnpm --filter @moonshot-ai/agent-core-v2 exec vitest run test/app/capability/kimiCu.test.ts — 31 tests passed.
  • pnpm exec vitest run apps/kimi-code/test/tui/commands/plugin-commands.test.ts apps/kimi-code/test/tui/commands/plugins-capability.test.ts — 13 tests passed.
  • pnpm --filter @moonshot-ai/agent-core-v2 test — 300 test files and 4757 tests passed.
  • pnpm --filter @moonshot-ai/agent-core-v2 typecheck — passed.
  • pnpm --filter @moonshot-ai/agent-core-v2 lint:imports — passed.
  • pnpm --filter @moonshot-ai/kimi-code typecheck — passed.
  • pnpm exec oxlint --type-aware on the changed TypeScript files — passed.
  • pnpm exec changeset status — passed.

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.
  • 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 Aug 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b675c91

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

@pkg-pr-new

pkg-pr-new Bot commented Aug 6, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@b675c91
npx https://pkg.pr.new/@moonshot-ai/kimi-code@b675c91

commit: b675c91

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4632b8ebec

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/agent-core-v2/src/app/capability/entries/kimiCu.ts
@wbxl2000

wbxl2000 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

@codex

@wbxl2000

wbxl2000 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3b687d753a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/agent-core-v2/src/app/capability/entries/kimiCu.ts Outdated
@wbxl2000

wbxl2000 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: b675c916c2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@wbxl2000
wbxl2000 merged commit ef61084 into main Aug 6, 2026
14 checks passed
@wbxl2000
wbxl2000 deleted the qer/kimi-cu-powershell-fallback branch August 6, 2026 10:08
@github-actions github-actions Bot mentioned this pull request Aug 6, 2026
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.

1 participant