@@ -90,6 +90,15 @@ export {
9090} ;
9191export { isCliProvider } from "./model-selection-cli.js" ;
9292
93+ const BUILT_IN_EXACT_REF_PROVIDER_IDS = new Set ( [
94+ "anthropic" ,
95+ "azure-openai" ,
96+ "google" ,
97+ "google-vertex" ,
98+ "mistral" ,
99+ "openai" ,
100+ ] ) ;
101+
93102function normalizePersistedDefaultProvider ( value : unknown ) : string {
94103 return normalizeOptionalString ( value ) ?? DEFAULT_PROVIDER ;
95104}
@@ -341,12 +350,18 @@ export function resolveSubagentConfiguredModelSelection(params: {
341350 * a fully qualified `provider/model` string. If the value is already qualified
342351 * or not a known alias, returns it unchanged.
343352 */
344- function hasExactConfiguredProviderModelRef ( cfg : OpenClawConfig , raw : string ) : boolean {
353+ function hasExactKnownProviderModelRef ( cfg : OpenClawConfig , raw : string ) : boolean {
345354 if ( ! hasExplicitProviderModelRef ( raw ) ) {
346355 return false ;
347356 }
348357 const providerRaw = raw . slice ( 0 , raw . indexOf ( "/" ) ) . trim ( ) ;
349- if ( ! providerRaw || ! cfg . models ?. providers ) {
358+ if ( ! providerRaw ) {
359+ return false ;
360+ }
361+ if ( BUILT_IN_EXACT_REF_PROVIDER_IDS . has ( normalizeProviderId ( providerRaw ) ) ) {
362+ return true ;
363+ }
364+ if ( ! cfg . models ?. providers ) {
350365 return false ;
351366 }
352367 const providerKey = normalizeLowercaseStringOrEmpty ( providerRaw ) ;
@@ -360,7 +375,7 @@ function resolveModelThroughAliases(
360375 aliasIndex : ModelAliasIndex ,
361376 cfg : OpenClawConfig ,
362377) : string {
363- if ( hasExactConfiguredProviderModelRef ( cfg , value ) ) {
378+ if ( hasExactKnownProviderModelRef ( cfg , value ) ) {
364379 return value ;
365380 }
366381 const aliasKey = normalizeLowercaseStringOrEmpty ( value ) ;
0 commit comments