Skip to content

fix(v2): detect MSYS2 bash from native toolchain git exec paths#1590

Merged
sailist merged 1 commit into
MoonshotAI:mainfrom
sailist:fix/v2-msys2-bash-detection
Jul 13, 2026
Merged

fix(v2): detect MSYS2 bash from native toolchain git exec paths#1590
sailist merged 1 commit into
MoonshotAI:mainfrom
sailist:fix/v2-msys2-bash-detection

Conversation

@sailist

@sailist sailist commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Related Issue

Ports the fix from #1580 (which resolves #1579) to the experimental v2 engine.

Problem

agent-core-v2 vendors the kaos shell probe in src/_base/execEnv/environmentProbe.ts, and it still only recognizes the legacy mingw32/mingw64 prefixes when inferring the bash location from git --exec-path. On a Windows host where git comes from a native MSYS2 toolchain (e.g. exec path C:/msys64/ucrt64/libexec/git-core), the v2 engine fails to detect bash even though it exists at C:\msys64\usr\bin\bash.exe.

What changed

  • Added MINGW_PREFIX_SET covering all current MSYS2 toolchain prefixes (ucrt64/clang64/clangarm64 next to the legacy mingw32/mingw64) and switched the exec-path scan to a set lookup, mirroring the kaos fix from fix(kaos): detect bash when git comes from a native MSYS2 toolchain #1580.
  • Git for Windows layouts are unaffected — their exec paths still hit the legacy prefixes first.
  • Added test/_base/execEnv/environmentProbe.test.ts with the three MSYS2 regression cases ported from the kaos suite, adapted to the v2 probeHostEnvironment API (the v2 probe previously had no dedicated test file).

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.

- recognize ucrt64/clang64/clangarm64 prefixes in git --exec-path
  alongside legacy mingw32/mingw64 when locating bash on Windows
- port the three MSYS2 regression tests from kaos to the v2 probe
@changeset-bot

changeset-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 94821ba

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 Jul 13, 2026

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

commit: 94821ba

@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: 94821bab11

ℹ️ 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 on lines +14 to +16
* Ported from `packages/kaos/test/environment.test.ts` (the MSYS2 cases added
* by the bash-detection fix); the v1 file carries the full POSIX / Git for
* Windows / Scoop shim matrix, which the vendored probe shares verbatim.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Remove porting notes from the test header

packages/agent-core-v2/AGENTS.md says comments in this package should not "note porting / skeleton status"; this new header adds provenance about being ported from the kaos suite instead of describing only the test scenario/responsibility. Please drop the porting note or move any necessary rationale into the commit/PR text rather than the source header.

Useful? React with 👍 / 👎.

@sailist sailist merged commit 8a4ee05 into MoonshotAI:main Jul 13, 2026
11 checks passed
creatiVision added a commit to creatiVision/kimi-code that referenced this pull request Jul 13, 2026
fix(v2): detect MSYS2 bash from native toolchain git exec paths (MoonshotAI#1590)
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 bash detection fails when git comes from a native MSYS2 environment (ucrt64/clang64/clangarm64)

1 participant