From 4dcd7f3ca3ca719ad241592588dcfd9298b35ed6 Mon Sep 17 00:00:00 2001 From: garrytan Date: Mon, 26 Oct 2026 14:34:30 +0000 Subject: [PATCH] fix: pre-landing review fixes The new dotenv-isolation test spawns Bun with emptyBunConfig() instead of a literal --config=/dev/null, which the Windows lane cannot open; the runner's timeout case asserts the descendant published a pid before asking whether it is running, so a missed readiness window names itself. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- browse/test/dotenv-isolation.test.ts | 3 ++- test/claude-code-runner.test.ts | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/browse/test/dotenv-isolation.test.ts b/browse/test/dotenv-isolation.test.ts index 63bb82967..f08d70c4f 100644 --- a/browse/test/dotenv-isolation.test.ts +++ b/browse/test/dotenv-isolation.test.ts @@ -7,6 +7,7 @@ import { afterEach, beforeEach, describe, expect, test } from 'bun:test'; import * as fs from 'node:fs'; import * as os from 'node:os'; import * as path from 'node:path'; +import { emptyBunConfig } from '../src/bun-child-config'; import { spawnTerminalAgent } from '../src/terminal-agent-control'; const ROOT = path.resolve(import.meta.dir, '..', '..'); @@ -60,7 +61,7 @@ describe('D0: project .env and bunfig.toml are ignored', () => { expect(JSON.parse(await waitForFile(out))).toEqual({ sandbox: null }); const atomic = path.join(path.dirname(project), 'atomic.json'); fs.writeFileSync(path.join(path.dirname(project), 'atomic-probe.ts'), probeSource(atomic)); - const run = Bun.spawnSync([process.execPath, '--no-env-file', '--config=/dev/null', path.join(path.dirname(project), 'atomic-probe.ts')], { cwd: project, env: { PATH: process.env.PATH ?? '' }, stdout: 'pipe', stderr: 'pipe', timeout: 30_000 }); + const run = Bun.spawnSync([process.execPath, '--no-env-file', `--config=${emptyBunConfig()}`, path.join(path.dirname(project), 'atomic-probe.ts')], { cwd: project, env: { PATH: process.env.PATH ?? '' }, stdout: 'pipe', stderr: 'pipe', timeout: 30_000 }); expect(run.exitCode, run.stderr.toString()).toBe(0); expect(JSON.parse(fs.readFileSync(atomic, 'utf-8'))).toEqual({ sandbox: null }); expect(fs.existsSync(atomic + '.tmp')).toBe(false); diff --git a/test/claude-code-runner.test.ts b/test/claude-code-runner.test.ts index d4f22ac7e..a665d9906 100644 --- a/test/claude-code-runner.test.ts +++ b/test/claude-code-runner.test.ts @@ -306,7 +306,9 @@ describe('Claude Code restricted execution', () => { expect(fireTimeout).toBeDefined(); const readyBy = Date.now() + 2000; while (publishedPid() === undefined && Date.now() < readyBy) await Bun.sleep(5); - expect(running(publishedPid()!)).toBe(true); + const descendantPid = publishedPid(); + expect(descendantPid, 'descendant never published its pid within the readiness window').toBeDefined(); + expect(running(descendantPid!)).toBe(true); const start = Date.now(); const expire = fireTimeout!; fireTimeout = undefined;