@ai-agent-forge/agent-forge 0.85.9 → 0.85.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2147,10 +2147,15 @@ export class AgentSession {
2147
2147
  });
2148
2148
  if (!result)
2149
2149
  return undefined;
2150
+ // auth entries usually carry only the key; for custom
2151
+ // gateways the provider catalog (models.json) is the
2152
+ // authoritative baseUrl, so plugin credential requests
2153
+ // resolve a usable endpoint.
2154
+ const providerBaseUrl = result.auth.baseUrl ?? this._modelRuntime.getProvider(providerId)?.baseUrl;
2150
2155
  return {
2151
2156
  ...(result.auth.apiKey === undefined ? {} : { apiKey: result.auth.apiKey }),
2152
2157
  headers: { ...(result.auth.headers ?? {}) },
2153
- ...(result.auth.baseUrl === undefined ? {} : { baseUrl: result.auth.baseUrl }),
2158
+ ...(providerBaseUrl === undefined ? {} : { baseUrl: providerBaseUrl }),
2154
2159
  ...(result.source === undefined ? {} : { source: result.source }),
2155
2160
  };
2156
2161
  },