@@ -15,6 +15,7 @@ import {
1515 type SecretDefaults ,
1616} from "./runtime-shared.js" ;
1717import { isRecord } from "./shared.js" ;
18+ import { listWebProviderSecretConfigPaths } from "./web-provider-secret-configs.js" ;
1819
1920function parsePluginConfigArrayIndex ( segment : string ) : number | undefined {
2021 return parseConfigPathArrayIndex ( segment ) ;
@@ -124,9 +125,10 @@ export function collectPluginConfigAssignments(params: {
124125 pluginConfig,
125126 secretPaths : secretInputs . paths ,
126127 active : enableState . enabled ,
127- runtimeOwnedPathPrefixes : secretInputs . contracts ?. webSearchProviders ?. length
128- ? [ "webSearch." ]
129- : [ ] ,
128+ runtimeOwnedPaths : listWebProviderSecretConfigPaths ( {
129+ contracts : secretInputs . contracts ,
130+ contract : "webSearchProviders" ,
131+ } ) ,
130132 inactiveReason : enableState . reason ?? "plugin is disabled." ,
131133 defaults : params . defaults ,
132134 context : params . context ,
@@ -139,17 +141,14 @@ function collectConfiguredPluginSecretAssignments(params: {
139141 pluginConfig : Record < string , unknown > ;
140142 secretPaths : ReadonlyArray < { path : string ; expected ?: "string" } > ;
141143 active : boolean ;
142- runtimeOwnedPathPrefixes ?: readonly string [ ] ;
144+ runtimeOwnedPaths ?: readonly string [ ] ;
143145 inactiveReason : string ;
144146 defaults : SecretDefaults | undefined ;
145147 context : ResolverContext ;
146148} ) : void {
147149 const seenPaths = new Set < string > ( ) ;
148150 for ( const secretPath of params . secretPaths ) {
149- if (
150- params . active &&
151- params . runtimeOwnedPathPrefixes ?. some ( ( prefix ) => secretPath . path . startsWith ( prefix ) )
152- ) {
151+ if ( params . active && params . runtimeOwnedPaths ?. includes ( secretPath . path ) ) {
153152 // Web provider selection owns these credentials. Resolving them here would make an
154153 // inactive or non-selected provider block the whole runtime snapshot.
155154 continue ;
0 commit comments