Explorar o código

core: prevent parallel test runs from contaminating environment variables

Dax Raad hai 3 semanas
pai
achega
90f39bf672
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      packages/opencode/src/env/index.ts

+ 3 - 1
packages/opencode/src/env/index.ts

@@ -2,7 +2,9 @@ import { Instance } from "../project/instance"
 
 export namespace Env {
   const state = Instance.state(() => {
-    return process.env as Record<string, string | undefined>
+    // Create a shallow copy to isolate environment per instance
+    // Prevents parallel tests from interfering with each other's env vars
+    return { ...process.env } as Record<string, string | undefined>
   })
 
   export function get(key: string) {