Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolve agent executables with
shutil.whichbefore launching them withsubprocess.Popenon Windows.Windows
CreateProcessdoes not applyPATHEXTto bare command names. As a result, npm-installed agents such asclaude.cmdcan be available onPATHbut still fail to launch withFileNotFoundError.The POSIX launch path remains unchanged. If executable resolution fails, the original command name is preserved.
Reproduction
On Windows, install Claude Code through npm:
where.exefinds the npm-installedclaude.cmd, confirming that Claude Code is available onPATH.Before this change, launching it through Unity Gateway fails:
After this change, the same command succeeds:
Changes
shutil.whichon Windows before passing it tosubprocess.Popen..cmdexecutable.Validation environment
Testing
A short pytest base directory was used to avoid the macOS
AF_UNIXsocket path length limit.The change was also validated on Windows Server. Both the Claude Code launch and a real request through the gateway completed successfully.
This pull request addresses the agent launch path only. Other subprocess call sites described in the related issues are outside its scope.
Related to #185 and #247.