fix(ai): resolve request-scoped auth before provider calls

closes #6021
This commit is contained in:
Mario Zechner
2026-06-23 23:27:00 +02:00
parent 04fce8099f
commit ef231c4910
5 changed files with 66 additions and 5 deletions
+4 -1
View File
@@ -184,7 +184,10 @@ class ImagesModelsImpl implements MutableImagesModels {
throw new ModelsError("provider", `Unknown provider: ${model.provider}`);
}
const resolution = await this.getAuth(model);
const resolution = await resolveProviderAuth(provider, model, this.credentials, this.authContext, {
apiKey: options?.apiKey,
env: options?.env,
});
const auth = resolution?.auth;
if (!auth) {
return provider.generateImages(model, context, options);