fix(config): preserve captured environments across provider launches

This commit is contained in:
morluto committed 2026-10-26 17:39:23 +08:00
1 parent ccdeda7a27
commit 3864c7d667
4 files changed
+141 -50

No files matched your search

+8 -2
View File
@@ -1,3 +1,4 @@
import { snapshotEnvironment } from "../../process/snapshotEnvironment.js";
import { isAbsolute } from "node:path";
import { z } from "zod";
import type {
@@ -78,10 +79,14 @@ export class NativeModuleResolver implements WebModuleResolutionPort {
#closePromise: Promise<void> | undefined;
#pendingCleanup: AnalysisCleanupLease | undefined;
readonly environment: Readonly<Record<string, string | undefined>>;
constructor(
readonly environment: Readonly<Record<string, string | undefined>>,
environment: Readonly<Record<string, string | undefined>>,
readonly launcher: ModuleResolverLauncher = launch,
) {}
) {
this.environment = snapshotEnvironment(environment);
}
resolve(
input: Parameters<WebModuleResolutionPort["resolve"]>[0],
@@ -180,6 +185,7 @@ export class NativeModuleResolver implements WebModuleResolutionPort {
const browser = await observe(() =>
this.launcher({
executablePath: executable,
env: this.environment,
headless: true,
timeout: Math.max(1, deadline.remainingMs()),
handleSIGINT: false,