From 93cc7b1a443389d3811b0416b729229ab9b494f7 Mon Sep 17 00:00:00 2001 From: Colin McDonnell Date: Fri, 8 May 2026 20:59:09 +0000 Subject: [PATCH] show effective model in agent comment/review footers (#618) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `toolState.model` was set only to `payload.model` (the stored slug, often undefined for router/oss runs that derive the target from `proxyModel`). the footer's "Using `…`" segment is gated on a truthy model, so router runs on repos without an explicit model setting shipped reviews/comments with no model badge — e.g. PR #614's review showed no model despite running `openrouter/anthropic/claude-opus-4.7` via proxy. now mirror the priority used by `resolveModelForLog` and `isGeminiRouted`: `payload.proxyModel ?? resolvedModel ?? payload.model`. also reverse-look up by `resolve`/`openRouterResolve` in `formatModelLabel` so a proxy target like "openrouter/anthropic/claude-opus-4.7" still renders as "Claude Opus". --- main.ts | 6 ++++++ utils/buildPullfrogFooter.ts | 10 ++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) 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}\``; }