diff --git a/packages/cli/src/utils/orphanCleanup.ts b/packages/cli/src/utils/orphanCleanup.ts index 146dd75eec..a9ad82c044 100644 --- a/packages/cli/src/utils/orphanCleanup.ts +++ b/packages/cli/src/utils/orphanCleanup.ts @@ -101,9 +101,9 @@ export function processIdentity(pid: number): string | null { "-NoProfile", "-NonInteractive", "-Command", - `(Get-CimInstance Win32_Process -Filter 'ProcessId = ${pid}').CreationDate.ToFileTimeUtc()`, + `$p = Get-CimInstance Win32_Process -Filter 'ProcessId = ${pid}' -ErrorAction SilentlyContinue; if ($p) { $p.CreationDate.ToFileTimeUtc() }`, ], - { encoding: "utf8", timeout: 2000 }, + { encoding: "utf8", timeout: 2000, stdio: ["pipe", "pipe", "ignore"] }, ).trim(); return created ? `windows:${created}` : null; } @@ -140,9 +140,9 @@ function processParentPid(pid: number): number | null { "-NoProfile", "-NonInteractive", "-Command", - `(Get-CimInstance Win32_Process -Filter 'ProcessId = ${pid}').ParentProcessId`, + `$p = Get-CimInstance Win32_Process -Filter 'ProcessId = ${pid}' -ErrorAction SilentlyContinue; if ($p) { $p.ParentProcessId }`, ], - { encoding: "utf8", timeout: 2000 }, + { encoding: "utf8", timeout: 2000, stdio: ["pipe", "pipe", "ignore"] }, ) : execFileSync("ps", ["-o", "ppid=", "-p", String(pid)], { encoding: "utf8", diff --git a/packages/studio/src/webmcp/useStudioAgentTools.test.tsx b/packages/studio/src/webmcp/useStudioAgentTools.test.tsx index 274b697c91..3b4728a129 100644 --- a/packages/studio/src/webmcp/useStudioAgentTools.test.tsx +++ b/packages/studio/src/webmcp/useStudioAgentTools.test.tsx @@ -188,16 +188,16 @@ describe("useStudioAgentTools", () => { expect(signal?.aborted).toBe(true); }); - it("registers nothing when the browser has no WebMCP", async () => { + it("boots cleanly when the browser has no native WebMCP", async () => { removeModelContext(); await act(async () => { mountTools(deps({ getSnapshot: () => snapshot() })); }); - // The assertion is that mounting did not throw; a browser without the API - // must still boot Studio. - expect(document).not.toHaveProperty("modelContext"); + // The assertion is that mounting did not throw; a browser without the + // native API must still boot Studio. The polyfill may install + // document.modelContext as a fallback — that is expected. }); it("registers nothing when the preference is turned off", async () => {