Skip to content

fix(agent-core): search usr\bin\bash.exe paths for Git Bash on Windows#145

Open
OPBR wants to merge 1 commit into
MoonshotAI:mainfrom
OPBR:fix/windows-git-bash-path-detection
Open

fix(agent-core): search usr\bin\bash.exe paths for Git Bash on Windows#145
OPBR wants to merge 1 commit into
MoonshotAI:mainfrom
OPBR:fix/windows-git-bash-path-detection

Conversation

@OPBR
Copy link
Copy Markdown

@OPBR OPBR commented May 28, 2026

Related Issue

This is a clear, reproducible bug fix (Windows Git Bash path detection
missing usr\bin\bash.exe candidates).

Problem

On some Git for Windows installations, bash.exe only exists at
<root>\usr\bin\bash.exe while <root>\bin\bash.exe is absent.
The current detection logic only searches bin\bash.exe paths,
causing a "Git Bash not found" startup error on these systems.

What changed

Added usr\bin\bash.exe candidates alongside each bin\bash.exe
entry in both the hardcoded fallback list and inferGitBashFromGitExe().
The function now returns a string[] of two candidates so the caller
checks them in preference order — bin\bash.exe first (it initializes
the MSYS2 environment), then usr\bin\bash.exe as fallback.

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
Copy link
Copy Markdown

changeset-bot Bot commented May 28, 2026

🦋 Changeset detected

Latest commit: f96e4e6

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

This PR includes changesets to release 2 packages
Name Type
@moonshot-ai/kimi-code Patch
@moonshot-ai/kimi-code-sdk 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

Copy link
Copy Markdown

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

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: eeaa22a429

ℹ️ 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".

@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
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 Add the SDK to the release changeset

For Windows SDK users who create sessions, this fix is part of the published SDK artifact too: packages/node-sdk/tsdown.config.ts aliases @moonshot-ai/agent-core to source and alwaysBundles @moonshot-ai/*, while packages/node-sdk/src/rpc.ts constructs KimiCore from that bundled code. With only @moonshot-ai/kimi-code listed here, the release PR will not version/publish @moonshot-ai/kimi-code-sdk, so npm SDK users will not receive the Git Bash detection fix.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed in 45786e3 — added @moonshot-ai/kimi-code-sdk: patch to the changeset.

Some Git for Windows installations have bash.exe only at
<root>\usr\bin\bash.exe while <root>\bin\bash.exe does not exist.
Add usr\bin\bash.exe candidates alongside each bin\bash.exe entry in
both the hardcoded fallback list and the git.exe inference logic.

Also add @moonshot-ai/kimi-code-sdk to the changeset since the SDK
bundles agent-core code and calls detectEnvironmentFromNode() on
session creation, so Windows SDK users also need this fix.
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