@@ -246,28 +246,28 @@ function baseConfig(port, overrides = {}) {
246246 bind : "loopback" ,
247247 auth : { mode : "token" , token : proofSecretRef ( "gateway/token" ) } ,
248248 controlUi : { enabled : false } ,
249- ...( overrides . gateway ?? { } ) ,
249+ ...overrides . gateway ,
250250 } ,
251251 plugins : {
252252 enabled : true ,
253253 entries : {
254254 [ PLUGIN_ID ] : { enabled : true } ,
255255 } ,
256- ...( overrides . plugins ?? { } ) ,
256+ ...overrides . plugins ,
257257 } ,
258258 secrets : {
259259 providers : {
260260 [ PROVIDER_ALIAS ] : proofProviderConfig ( ) ,
261261 } ,
262- ...( overrides . secrets ?? { } ) ,
262+ ...overrides . secrets ,
263263 } ,
264264 agents : {
265265 defaults : {
266266 model : "openai/gpt-5.4-nano" ,
267267 } ,
268- ...( overrides . agents ?? { } ) ,
268+ ...overrides . agents ,
269269 } ,
270- ...( overrides . root ?? { } ) ,
270+ ...overrides . root ,
271271 } ;
272272}
273273
@@ -972,6 +972,7 @@ async function p8ManagedServiceEnvProof() {
972972 } ) ;
973973 let installAttempted = false ;
974974 let proofError ;
975+ let cleanupError ;
975976 const managerEnv = serviceManagerEnv ( envCtx . env ) ;
976977 try {
977978 const callsBeforeInstall = readJson ( envCtx . env . PROOF_SECRET_STORE_PATH ) . calls ;
@@ -1010,21 +1011,25 @@ async function p8ManagedServiceEnvProof() {
10101011 }
10111012 } catch ( error ) {
10121013 proofError = error ;
1013- throw error ;
10141014 } finally {
10151015 if ( installAttempted ) {
10161016 try {
10171017 await uninstallManagedGateway ( managerEnv ) ;
1018- } catch ( cleanupError ) {
1019- if ( ! proofError ) {
1020- throw cleanupError ;
1018+ } catch ( error ) {
1019+ cleanupError = error ;
1020+ if ( proofError ) {
1021+ const message = error instanceof Error ? error . message : String ( error ) ;
1022+ console . error ( `[cleanup] ${ scrub ( message ) } ` ) ;
10211023 }
1022- const message =
1023- cleanupError instanceof Error ? cleanupError . message : String ( cleanupError ) ;
1024- console . error ( `[cleanup] ${ scrub ( message ) } ` ) ;
10251024 }
10261025 }
10271026 }
1027+ if ( proofError ) {
1028+ throw proofError ;
1029+ }
1030+ if ( cleanupError ) {
1031+ throw cleanupError ;
1032+ }
10281033 } ) ;
10291034 return "real managed service install preserved auth-profile exec provider passEnv" ;
10301035}
@@ -1115,7 +1120,7 @@ async function p9ProviderVariants() {
11151120 const port = await allocatePort ( ) ;
11161121 const ctx = scenario . before ?. ( ) ?? { } ;
11171122 writeJson ( envCtx . env . OPENCLAW_CONFIG_PATH , scenario . config ( port , ctx ) ) ;
1118- const childEnv = { ...envCtx . env , ...( scenario . env ?? { } ) } ;
1123+ const childEnv = { ...envCtx . env , ...scenario . env } ;
11191124 const scenarioCtx = { ...envCtx , env : childEnv } ;
11201125 const gateway = await startGateway ( scenarioCtx , port , scenario . token ) ;
11211126 try {
0 commit comments