diff --git a/src/flows/doctor-health-contributions.ts b/src/flows/doctor-health-contributions.ts index 052a05ed22a..12c61a14f87 100644 --- a/src/flows/doctor-health-contributions.ts +++ b/src/flows/doctor-health-contributions.ts @@ -25,6 +25,7 @@ export type DoctorHealthFlowContext = { cfgForPersistence: OpenClawConfig; sourceConfigValid: boolean; configPath: string; + env?: NodeJS.ProcessEnv; gatewayDetails?: ReturnType; healthOk?: boolean; gatewayMemoryProbe?: Awaited>; @@ -531,7 +532,7 @@ async function runWriteConfigHealth(ctx: DoctorHealthFlowContext): Promise }); if ( shouldSkipLegacyUpdateDoctorMetadataWrite({ - env: process.env, + env: ctx.env ?? process.env, before: ctx.cfgForPersistence, after: ctx.cfg, })