Address Copilot review comments from #34#35
Merged
Conversation
- Make HYPA_PI_CONFIG sentinel 'none' case-insensitive so NONE/None also disable config file loading - Handle uppercase and .bat extensions in getExecArgs on Windows - Use getExecArgs in MCP proxy bridge (runHypaMcpJson) so Windows .js/.cmd/.bat binary paths are wrapped correctly Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Follow-up to PR #34 to harden the pi-hypa extension’s config loading and Windows execution behavior, ensuring consistent handling of disable-sentinels and Windows shim scripts across normal and MCP proxy execution paths.
Changes:
- Made
HYPA_PI_CONFIG=nonesentinel handling case-insensitive when resolving the config file path. - Updated Windows executable argument normalization to treat
.js/.cmd/.batextensions case-insensitively and added.batsupport. - Routed MCP proxy execution through
getExecArgsand added tests covering the new Windows behaviors and sentinel variants.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/pi-hypa/test/rewrite-client.test.ts | Adds Windows .bat + uppercase extension coverage for getExecArgs. |
| packages/pi-hypa/test/policy.test.ts | Adds coverage for case-insensitive HYPA_PI_CONFIG=none sentinel behavior. |
| packages/pi-hypa/extensions/rewrite-client.ts | Makes Windows extension matching case-insensitive and adds .bat handling. |
| packages/pi-hypa/extensions/policy.ts | Updates config disable sentinel check to be case-insensitive. |
| packages/pi-hypa/extensions/mcp-proxy-bridge.ts | Ensures MCP proxy calls use getExecArgs to avoid Windows shim execution issues. |
| export function resolveConfigFilePath(env: NodeJS.ProcessEnv): string | undefined { | ||
| const fromEnv = env.HYPA_PI_CONFIG?.trim(); | ||
| if (fromEnv === "" || fromEnv === "none") return undefined; | ||
| if (fromEnv === "" || fromEnv.toLowerCase() === "none") return undefined; |
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.
Follow-up to #34 addressing the valid Copilot review comments:
Fixed:
nonesentinel (policy.ts):HYPA_PI_CONFIG=NONE/None/noneall now disable config file loading..batand uppercase extensions ingetExecArgs(rewrite-client.ts): Windows.batwrapper scripts are now handled, and extension matching is case-insensitive (.JS,.CMD,.BATall work).getExecArgs(mcp-proxy-bridge.ts):runHypaMcpJsonnow routes throughgetExecArgsso Windows.js/.cmd/.batshims don't produceEFTYPEerrors in MCP proxy calls.Not changed (by design):
loadConfigFilestill throws on malformed JSON with a descriptive message. Silently swallowing a parse error would hide user typos and make config failures undiagnosable. The descriptive error is intentional.JsonConfigLoaderchanges were already merged with Add JSON config file support to pi-hypa extension #34 and are out of scope here.