Skip to content

Commit 90f39bf

Browse files
committed
core: prevent parallel test runs from contaminating environment variables
1 parent 95bf01a commit 90f39bf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/opencode/src/env/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import { Instance } from "../project/instance"
22

33
export namespace Env {
44
const state = Instance.state(() => {
5-
return process.env as Record<string, string | undefined>
5+
// Create a shallow copy to isolate environment per instance
6+
// Prevents parallel tests from interfering with each other's env vars
7+
return { ...process.env } as Record<string, string | undefined>
68
})
79

810
export function get(key: string) {

0 commit comments

Comments
 (0)