From 2dee177c9b52cacc608106a0bbc23da8ae767c6d Mon Sep 17 00:00:00 2001 From: Andrew Lauppe Date: Tue, 20 Jan 2026 01:28:13 -0500 Subject: [PATCH] fix(models): attach provider to inline model definitions When resolving models from custom provider configurations, ensure the provider name is attached to each inline model entry. This fixes model resolution for custom providers where the model definition exists in the config but lacks an explicit provider field. Without this fix, inline models from custom providers (like amazon-bedrock) would fail to resolve because the provider context was lost during the flatMap operation. --- src/agents/pi-embedded-runner/model.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/agents/pi-embedded-runner/model.ts b/src/agents/pi-embedded-runner/model.ts index 5e2ffa540bf..2d146f80b69 100644 --- a/src/agents/pi-embedded-runner/model.ts +++ b/src/agents/pi-embedded-runner/model.ts @@ -39,7 +39,7 @@ export function resolveModel( if (!model) { const providers = cfg?.models?.providers ?? {}; const inlineModels = - providers[provider]?.models ?? + providers[provider]?.models?.map((entry) => ({ ...entry, provider })) ?? Object.values(providers) .flatMap((entry) => entry?.models ?? []) .map((entry) => ({ ...entry, provider }));