@@ -71,6 +71,7 @@ type ProviderAuthWarmWorkerRunner = (params: {
7171 cfg : OpenClawConfig ;
7272 runtimeAuthStores ?: ProviderAuthWarmRuntimeAuthStore [ ] ;
7373 runtimeAuthLookups ?: ProviderAuthWarmRuntimeAuthLookup [ ] ;
74+ omitFalseProviderAuth ?: boolean ;
7475 timeoutMs : number ;
7576 isCancelled : ( ) => boolean ;
7677 workerUrl ?: URL ;
@@ -319,6 +320,7 @@ export async function buildCurrentProviderAuthStateSnapshot(
319320 isCancelled ?: ( ) => boolean ;
320321 readOnlyAuthStore ?: boolean ;
321322 runtimeAuthLookups ?: ReadonlyMap < string , RuntimeProviderAuthLookup > ;
323+ omitFalseProviderAuth ?: boolean ;
322324 } = { } ,
323325) : Promise < ProviderAuthWarmSnapshot > {
324326 const isWarmStale = ( ) => options . isCancelled ?.( ) === true ;
@@ -380,11 +382,12 @@ export async function buildCurrentProviderAuthStateSnapshot(
380382 } ) ;
381383 if (
382384 ! value &&
383- shouldOmitFalsePreparedAuthForProcessSyntheticProvider ( {
384- cfg,
385- provider,
386- runtimeAuthLookup,
387- } )
385+ ( options . omitFalseProviderAuth ||
386+ shouldOmitFalsePreparedAuthForProcessSyntheticProvider ( {
387+ cfg,
388+ provider,
389+ runtimeAuthLookup,
390+ } ) )
388391 ) {
389392 continue ;
390393 }
@@ -510,27 +513,30 @@ function collectProviderAuthWarmRuntimeAuthStores(
510513 return entries ;
511514}
512515
513- function collectProviderAuthWarmRuntimeAuthLookups (
514- cfg : OpenClawConfig ,
515- ) : ProviderAuthWarmRuntimeAuthLookup [ ] | null {
516+ function collectProviderAuthWarmRuntimeAuthLookups ( cfg : OpenClawConfig ) : {
517+ entries : ProviderAuthWarmRuntimeAuthLookup [ ] ;
518+ omitFalseProviderAuth : boolean ;
519+ } {
516520 const entries : ProviderAuthWarmRuntimeAuthLookup [ ] = [ ] ;
521+ let omitFalseProviderAuth = false ;
517522 for ( const agentId of listAgentIds ( cfg ) ) {
518523 const lookup = createRuntimeProviderAuthLookup ( {
519524 cfg,
520525 workspaceDir : resolveAgentWorkspaceDir ( cfg , agentId ) ,
521526 } ) ;
522527 if ( lookup . syntheticAuthProviderRefsComplete === false ) {
523- return null ;
528+ omitFalseProviderAuth = true ;
524529 }
525530 entries . push ( { agentId, lookup } ) ;
526531 }
527- return entries ;
532+ return { entries, omitFalseProviderAuth } ;
528533}
529534
530535function runProviderAuthWarmWorker ( params : {
531536 cfg : OpenClawConfig ;
532537 runtimeAuthStores ?: ProviderAuthWarmRuntimeAuthStore [ ] ;
533538 runtimeAuthLookups ?: ProviderAuthWarmRuntimeAuthLookup [ ] ;
539+ omitFalseProviderAuth ?: boolean ;
534540 timeoutMs : number ;
535541 isCancelled : ( ) => boolean ;
536542 workerUrl ?: URL ;
@@ -542,6 +548,7 @@ function runProviderAuthWarmWorker(params: {
542548 ...( params . runtimeAuthLookups ?. length
543549 ? { runtimeAuthLookups : params . runtimeAuthLookups }
544550 : { } ) ,
551+ ...( params . omitFalseProviderAuth ? { omitFalseProviderAuth : true } : { } ) ,
545552 } ,
546553 } ) ;
547554 worker . unref ?.( ) ;
@@ -651,13 +658,13 @@ export async function warmCurrentProviderAuthStateOffMainThread(
651658 }
652659 const runtimeAuthStores = collectProviderAuthWarmRuntimeAuthStores ( cfg ) ;
653660 const runtimeAuthLookups = collectProviderAuthWarmRuntimeAuthLookups ( cfg ) ;
654- if ( runtimeAuthLookups === null ) {
655- return ;
656- }
657661 const snapshot = await ( options . runWorker ?? runProviderAuthWarmWorker ) ( {
658662 cfg,
659663 ...( runtimeAuthStores . length ? { runtimeAuthStores } : { } ) ,
660- ...( runtimeAuthLookups . length ? { runtimeAuthLookups } : { } ) ,
664+ ...( runtimeAuthLookups . entries . length
665+ ? { runtimeAuthLookups : runtimeAuthLookups . entries }
666+ : { } ) ,
667+ ...( runtimeAuthLookups . omitFalseProviderAuth ? { omitFalseProviderAuth : true } : { } ) ,
661668 timeoutMs : options . timeoutMs ?? PROVIDER_AUTH_WARM_WORKER_TIMEOUT_MS ,
662669 isCancelled : isWarmStale ,
663670 workerUrl : options . workerUrl ,
0 commit comments