Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions integrations/mcp/server.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ function runMixEvalJson(jsonBody) {
cwd: repoRoot,
stdio: ["pipe", "pipe", "pipe"],
env: { ...process.env },
// Windows distributes Mix through a command shim, which CreateProcess
// cannot launch directly. The command and argument are fixed here.
shell: process.platform === "win32",
windowsHide: true,
});
let out = "";
let err = "";
Expand Down
10 changes: 9 additions & 1 deletion integrations/mcp/smoke.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ echo '{"ok":true,"outcome":"ALLOW","status":"accepted","stop_reason":null}'
const stubPath = path.join(dir, "mix");
writeFileSync(stubPath, stub);
chmodSync(stubPath, 0o755);

// Windows resolves command names through PATHEXT. Keep the smoke stub in
// that executable form as well, so the server's normal `spawn("mix", ...)`
// path is exercised on both platforms.
writeFileSync(
path.join(dir, "mix.cmd"),
"@echo off\r\nmore > nul\r\necho {\"ok\":true,\"outcome\":\"ALLOW\",\"status\":\"accepted\",\"stop_reason\":null}\r\n",
);
return dir;
}

Expand Down Expand Up @@ -100,7 +108,7 @@ function rpcDriver(child) {
async function main() {
const stubDir = setupStubMix();
const child = spawnServer({
PATH: `${stubDir}:${process.env.PATH ?? ""}`,
PATH: `${stubDir}${path.delimiter}${process.env.PATH ?? ""}`,
PYTHIA_REPO_ROOT: repoRoot,
});
const { call } = rpcDriver(child);
Expand Down