diff --git a/main.ts b/main.ts index 6919eec..782747b 100644 --- a/main.ts +++ b/main.ts @@ -578,6 +578,12 @@ export async function main(): Promise { const resolvedModel = payload.proxyModel ? undefined : resolveModel({ slug: payload.model }); const agent = resolveAgent({ model: resolvedModel }); + // surface the effective model in comment/review footers. payload.model is + // just the stored slug (often undefined for router/oss runs that derive + // the target from proxyModel). matching priority with resolveModelForLog + // so the "Using `…`" badge reflects what actually ran. + toolState.model = payload.proxyModel ?? resolvedModel ?? payload.model; + validateAgentApiKey({ agent, model: payload.proxyModel ?? resolvedModel ?? payload.model, diff --git a/utils/buildPullfrogFooter.ts b/utils/buildPullfrogFooter.ts index ee526fa..7ab7e53 100644 --- a/utils/buildPullfrogFooter.ts +++ b/utils/buildPullfrogFooter.ts @@ -1,4 +1,4 @@ -import { resolveDisplayAlias } from "../models.ts"; +import { modelAliases, resolveDisplayAlias } from "../models.ts"; export const PULLFROG_DIVIDER = ""; @@ -28,7 +28,13 @@ export interface BuildPullfrogFooterParams { function formatModelLabel(slug: string): string { // walk the fallback chain so a deprecated stored slug shows the model the // run actually executed against (e.g. "GPT", not "GPT Codex"). - const alias = resolveDisplayAlias(slug); + const alias = + resolveDisplayAlias(slug) ?? + // reverse-lookup: when the caller passes an effective model (proxy or + // resolved target like "openrouter/anthropic/claude-opus-4.7") instead of + // a stored alias slug, find the alias whose resolve target matches so we + // still render a friendly display name. + modelAliases.find((a) => a.resolve === slug || a.openRouterResolve === slug); if (!alias) return `\`${slug}\``; return alias.isFree ? `\`${alias.displayName}\` (free)` : `\`${alias.displayName}\``; }