show model name in footer, drop pullfrog.com link (#484)

* show model name in footer, drop pullfrog.com link

add model slug to buildPullfrogFooter so every Pullfrog comment
displays the active model (e.g. "Using `Big Pickle` (free)" or
"Using `Claude Opus`"). remove the pullfrog.com link from all footers.

Made-with: Cursor

* reject <br/> tags in comment bodies, add prompt guidance

add runtime validation in addFooter that throws if <br/> is followed
by a non-blank line (breaks GitHub heading rendering). the agent sees
the error and retries with clean markdown. also update Summarize mode
prompt to explicitly forbid <br/> tags.

Made-with: Cursor

* fix <br/> guidance: move to event instructions, clarify blank line rule

the formatting rule belongs in DEFAULT_PR_SUMMARY_INSTRUCTIONS (event
instructions), not the Summarize mode prompt. clarify that <br/> must
always be followed by a blank line before headings.

Made-with: Cursor

* generalize block-level HTML rule in summary instructions

add a prominent top-level rule about requiring blank lines between ALL
block-level HTML elements and markdown syntax, not just <br/>.

Made-with: Cursor

* move model to toolState instead of threading through params

model is set once at startup and read everywhere — it belongs on
toolState, not threaded as a separate param through 8 call sites.
postCleanup runs without toolState so it just omits the model label.

Made-with: Cursor

* update models.dev snapshot (openai latest changed)

Made-with: Cursor

* add comment to models snapshot test explaining its purpose

Made-with: Cursor
This commit is contained in:
Colin McDonnell
2026-03-17 19:59:11 +00:00
committed by pullfrog[bot]
parent 30d68e53a7
commit c6a3ee0e9a
11 changed files with 247 additions and 42 deletions
+33 -19
View File
@@ -145015,6 +145015,11 @@ function GetCheckSuiteLogsTool(ctx) {
// utils/buildPullfrogFooter.ts
var PULLFROG_DIVIDER = "<!-- PULLFROG_DIVIDER_DO_NOT_REMOVE_PLZ -->";
var FROG_LOGO = `<a href="https://pullfrog.com"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pullfrog.com/logos/frog-white-full-18px.png"><img src="https://pullfrog.com/logos/frog-green-full-18px.png" width="9px" height="9px" style="vertical-align: middle; " alt="Pullfrog"></picture></a>`;
function formatModelLabel(slug) {
const alias = modelAliases.find((a) => a.slug === slug);
if (!alias) return `\`${slug}\``;
return alias.isFree ? `\`${alias.displayName}\` (free)` : `\`${alias.displayName}\``;
}
function buildPullfrogFooter(params) {
const parts = [];
if (params.customParts) {
@@ -145030,11 +145035,10 @@ function buildPullfrogFooter(params) {
if (params.triggeredBy) {
parts.push("Triggered by [Pullfrog](https://pullfrog.com)");
}
const allParts = [
...parts,
"[pullfrog.com](https://pullfrog.com)",
"[\u{1D54F}](https://x.com/pullfrogai)"
];
if (params.model) {
parts.push(`Using ${formatModelLabel(params.model)}`);
}
const allParts = [...parts, "[\u{1D54F}](https://x.com/pullfrogai)"];
return `
${PULLFROG_DIVIDER}
<sup>${FROG_LOGO}&nbsp;&nbsp;\uFF5C ${allParts.join(" \uFF5C ")}</sup>`;
@@ -145098,22 +145102,25 @@ async function buildCommentFooter(params) {
} catch {
}
}
const footerParams = {
return buildPullfrogFooter({
triggeredBy: true,
workflowRun: runId ? { owner: repoContext.owner, repo: repoContext.name, runId, jobId } : void 0
};
if (params.customParts && params.customParts.length > 0) {
return buildPullfrogFooter({ ...footerParams, customParts: params.customParts });
}
return buildPullfrogFooter(footerParams);
workflowRun: runId ? { owner: repoContext.owner, repo: repoContext.name, runId, jobId } : void 0,
customParts: params.customParts,
model: params.model
});
}
function buildImplementPlanLink(owner, repo, issueNumber, commentId) {
const apiUrl = getApiUrl();
return `[Implement plan \u2794](${apiUrl}/trigger/${owner}/${repo}/${issueNumber}?action=implement&comment_id=${commentId})`;
}
async function addFooter(ctx, body) {
if (/<br\s*\/?>[ \t]*\n(?!\s*\n)/i.test(body)) {
throw new Error(
"body contains <br/> followed by a non-blank line, which breaks GitHub markdown rendering. always add a blank line after <br/> tags."
);
}
const bodyWithoutFooter = stripExistingFooter(fixDoubleEscapedString(body));
const footer = await buildCommentFooter({ octokit: ctx.octokit });
const footer = await buildCommentFooter({ octokit: ctx.octokit, model: ctx.toolState?.model });
return `${bodyWithoutFooter}${footer}`;
}
var Comment = type({
@@ -145221,7 +145228,8 @@ async function reportProgress(ctx, params) {
const bodyWithoutFooter = stripExistingFooter(body);
const footer = await buildCommentFooter({
octokit: ctx.octokit,
customParts
customParts,
model: ctx.toolState.model
});
const bodyWithFooter = `${bodyWithoutFooter}${footer}`;
const result2 = await ctx.octokit.rest.issues.updateComment({
@@ -145247,7 +145255,8 @@ async function reportProgress(ctx, params) {
const bodyWithoutFooter = stripExistingFooter(body);
const footer = await buildCommentFooter({
octokit: ctx.octokit,
customParts
customParts,
model: ctx.toolState.model
});
const bodyWithFooter = `${bodyWithoutFooter}${footer}`;
const result2 = await ctx.octokit.rest.issues.updateComment({
@@ -145289,7 +145298,8 @@ async function reportProgress(ctx, params) {
const bodyWithoutFooter = stripExistingFooter(body);
const footer = await buildCommentFooter({
octokit: ctx.octokit,
customParts
customParts,
model: ctx.toolState.model
});
const bodyWithPlanLink = `${bodyWithoutFooter}${footer}`;
const updateResult = await ctx.octokit.rest.issues.updateComment({
@@ -146722,7 +146732,8 @@ var PullRequest = type({
function buildPrBodyWithFooter(ctx, body) {
const footer = buildPullfrogFooter({
triggeredBy: true,
workflowRun: ctx.runId ? { owner: ctx.repo.owner, repo: ctx.repo.name, runId: ctx.runId, jobId: ctx.jobId } : void 0
workflowRun: ctx.runId ? { owner: ctx.repo.owner, repo: ctx.repo.name, runId: ctx.runId, jobId: ctx.jobId } : void 0,
model: ctx.toolState.model
});
const bodyWithoutFooter = stripExistingFooter(fixDoubleEscapedString(body));
return `${bodyWithoutFooter}${footer}`;
@@ -147031,7 +147042,8 @@ async function createAndSubmitWithFooter(ctx, params, opts) {
}
const footer = buildPullfrogFooter({
workflowRun: ctx.runId ? { owner: ctx.repo.owner, repo: ctx.repo.name, runId: ctx.runId, jobId: ctx.jobId } : void 0,
customParts
customParts,
model: ctx.toolState.model
});
return ctx.octokit.rest.pulls.submitReview({
owner: params.owner,
@@ -149367,7 +149379,8 @@ ${ctx.error}` : ctx.error;
const footer = buildPullfrogFooter({
triggeredBy: true,
workflowRun: runId ? { owner: repoContext.owner, repo: repoContext.name, runId } : void 0,
customParts
customParts,
model: ctx.toolState.model
});
await octokit.rest.issues.updateComment({
owner: repoContext.owner,
@@ -150369,6 +150382,7 @@ async function main() {
const runContext = await resolveRunContextData({ octokit: initialOctokit, token: jobToken });
timer.checkpoint("runContextData");
const payload = resolvePayload(resolvedPromptInput, runContext.repoSettings);
toolState.model = payload.model;
const tokenRef = __using(_stack2, await resolveTokens({ push: payload.push }), true);
if (payload.shell !== "enabled") {
delete process.env.ACTIONS_ID_TOKEN_REQUEST_URL;
+1
View File
@@ -103,6 +103,7 @@ export async function main(): Promise<MainResult> {
// resolve payload to determine shell permission
const payload = resolvePayload(resolvedPromptInput, runContext.repoSettings);
toolState.model = payload.model;
// resolve tokens:
// - gitToken: contents permission based on push setting (assumed exfiltratable)
+15 -8
View File
@@ -55,6 +55,7 @@ export const LEAPING_INTO_ACTION_PREFIX = "Leaping into action";
interface BuildCommentFooterParams {
octokit?: OctokitWithPlugins | undefined;
customParts?: string[] | undefined;
model?: string | undefined;
}
async function buildCommentFooter(params: BuildCommentFooterParams): Promise<string> {
@@ -77,17 +78,14 @@ async function buildCommentFooter(params: BuildCommentFooterParams): Promise<str
}
}
const footerParams = {
return buildPullfrogFooter({
triggeredBy: true,
workflowRun: runId
? { owner: repoContext.owner, repo: repoContext.name, runId, jobId }
: undefined,
};
if (params.customParts && params.customParts.length > 0) {
return buildPullfrogFooter({ ...footerParams, customParts: params.customParts });
}
return buildPullfrogFooter(footerParams);
customParts: params.customParts,
model: params.model,
});
}
function buildImplementPlanLink(
@@ -102,11 +100,17 @@ function buildImplementPlanLink(
export interface AddFooterCtx {
octokit?: OctokitWithPlugins | undefined;
toolState?: { model?: string | undefined } | undefined;
}
export async function addFooter(ctx: AddFooterCtx, body: string): Promise<string> {
if (/<br\s*\/?>[ \t]*\n(?!\s*\n)/i.test(body)) {
throw new Error(
"body contains <br/> followed by a non-blank line, which breaks GitHub markdown rendering. always add a blank line after <br/> tags."
);
}
const bodyWithoutFooter = stripExistingFooter(fixDoubleEscapedString(body));
const footer = await buildCommentFooter({ octokit: ctx.octokit });
const footer = await buildCommentFooter({ octokit: ctx.octokit, model: ctx.toolState?.model });
return `${bodyWithoutFooter}${footer}`;
}
@@ -262,6 +266,7 @@ export async function reportProgress(
const footer = await buildCommentFooter({
octokit: ctx.octokit,
customParts,
model: ctx.toolState.model,
});
const bodyWithFooter = `${bodyWithoutFooter}${footer}`;
@@ -299,6 +304,7 @@ export async function reportProgress(
const footer = await buildCommentFooter({
octokit: ctx.octokit,
customParts,
model: ctx.toolState.model,
});
const bodyWithFooter = `${bodyWithoutFooter}${footer}`;
@@ -359,6 +365,7 @@ export async function reportProgress(
const footer = await buildCommentFooter({
octokit: ctx.octokit,
customParts,
model: ctx.toolState.model,
});
const bodyWithPlanLink = `${bodyWithoutFooter}${footer}`;
+1
View File
@@ -21,6 +21,7 @@ function buildPrBodyWithFooter(ctx: ToolContext, body: string): string {
workflowRun: ctx.runId
? { owner: ctx.repo.owner, repo: ctx.repo.name, runId: ctx.runId, jobId: ctx.jobId }
: undefined,
model: ctx.toolState.model,
});
const bodyWithoutFooter = stripExistingFooter(fixDoubleEscapedString(body));
+1
View File
@@ -264,6 +264,7 @@ async function createAndSubmitWithFooter(
? { owner: ctx.repo.owner, repo: ctx.repo.name, runId: ctx.runId, jobId: ctx.jobId }
: undefined,
customParts,
model: ctx.toolState.model,
});
return ctx.octokit.rest.pulls.submitReview({
+1
View File
@@ -89,6 +89,7 @@ export interface ToolState {
existingSummaryCommentId?: number;
output?: string;
usageEntries: AgentUsage[];
model?: string | undefined;
}
interface InitToolStateParams {
+172 -5
View File
@@ -37509,9 +37509,177 @@ function getApiUrl() {
return raw;
}
// models.ts
function provider(config) {
return config;
}
var providers = {
anthropic: provider({
displayName: "Anthropic",
envVars: ["ANTHROPIC_API_KEY"],
models: {
"claude-opus": {
displayName: "Claude Opus",
resolve: "anthropic/claude-opus-4-6",
recommended: true
},
"claude-sonnet": { displayName: "Claude Sonnet", resolve: "anthropic/claude-sonnet-4-6" },
"claude-haiku": { displayName: "Claude Haiku", resolve: "anthropic/claude-haiku-4-5" }
}
}),
openai: provider({
displayName: "OpenAI",
envVars: ["OPENAI_API_KEY"],
models: {
"gpt-codex": { displayName: "GPT Codex", resolve: "openai/gpt-5.3-codex", recommended: true },
"gpt-codex-mini": { displayName: "GPT Codex Mini", resolve: "openai/codex-mini-latest" },
o3: { displayName: "O3", resolve: "openai/o3" }
}
}),
google: provider({
displayName: "Google",
envVars: ["GOOGLE_GENERATIVE_AI_API_KEY", "GEMINI_API_KEY"],
models: {
"gemini-pro": {
displayName: "Gemini Pro",
resolve: "google/gemini-3.1-pro-preview",
recommended: true
},
"gemini-flash": { displayName: "Gemini Flash", resolve: "google/gemini-3-flash-preview" }
}
}),
xai: provider({
displayName: "xAI",
envVars: ["XAI_API_KEY"],
models: {
grok: { displayName: "Grok", resolve: "xai/grok-4", recommended: true },
"grok-fast": { displayName: "Grok Fast", resolve: "xai/grok-4-fast" },
"grok-code-fast": { displayName: "Grok Code Fast", resolve: "xai/grok-code-fast-1" }
}
}),
deepseek: provider({
displayName: "DeepSeek",
envVars: ["DEEPSEEK_API_KEY"],
models: {
"deepseek-reasoner": {
displayName: "DeepSeek Reasoner",
resolve: "deepseek/deepseek-reasoner",
recommended: true
},
"deepseek-chat": { displayName: "DeepSeek Chat", resolve: "deepseek/deepseek-chat" }
}
}),
moonshotai: provider({
displayName: "Moonshot AI",
envVars: ["MOONSHOT_API_KEY"],
models: {
"kimi-k2": { displayName: "Kimi K2", resolve: "moonshotai/kimi-k2.5", recommended: true }
}
}),
opencode: provider({
displayName: "OpenCode",
envVars: ["OPENCODE_API_KEY"],
models: {
"big-pickle": {
displayName: "Big Pickle",
resolve: "opencode/big-pickle",
recommended: true,
envVars: [],
isFree: true
},
"claude-opus": { displayName: "Claude Opus", resolve: "opencode/claude-opus-4-6" },
"claude-sonnet": { displayName: "Claude Sonnet", resolve: "opencode/claude-sonnet-4-6" },
"claude-haiku": { displayName: "Claude Haiku", resolve: "opencode/claude-haiku-4-5" },
"gpt-codex": { displayName: "GPT Codex", resolve: "opencode/gpt-5.3-codex" },
"gpt-codex-mini": { displayName: "GPT Codex Mini", resolve: "opencode/gpt-5.1-codex-mini" },
"gemini-pro": { displayName: "Gemini Pro", resolve: "opencode/gemini-3.1-pro" },
"gemini-flash": { displayName: "Gemini Flash", resolve: "opencode/gemini-3-flash" },
"kimi-k2": { displayName: "Kimi K2", resolve: "opencode/kimi-k2.5" },
"gpt-5-nano": {
displayName: "GPT Nano",
resolve: "opencode/gpt-5-nano",
envVars: [],
isFree: true
},
"mimo-v2-flash-free": {
displayName: "MiMo V2 Flash",
resolve: "opencode/mimo-v2-flash-free",
envVars: [],
isFree: true
},
"minimax-m2.5-free": {
displayName: "MiniMax M2.5",
resolve: "opencode/minimax-m2.5-free",
envVars: [],
isFree: true
},
"nemotron-3-super-free": {
displayName: "Nemotron 3 Super",
resolve: "opencode/nemotron-3-super-free",
envVars: [],
isFree: true
}
}
}),
openrouter: provider({
displayName: "OpenRouter",
envVars: ["OPENROUTER_API_KEY"],
models: {
"claude-opus": {
displayName: "Claude Opus",
resolve: "openrouter/anthropic/claude-opus-4.6",
recommended: true
},
"claude-sonnet": {
displayName: "Claude Sonnet",
resolve: "openrouter/anthropic/claude-sonnet-4.6"
},
"claude-haiku": {
displayName: "Claude Haiku",
resolve: "openrouter/anthropic/claude-haiku-4.5"
},
"gpt-codex": { displayName: "GPT Codex", resolve: "openrouter/openai/gpt-5.3-codex" },
"gpt-codex-mini": {
displayName: "GPT Codex Mini",
resolve: "openrouter/openai/gpt-5.1-codex-mini"
},
"o4-mini": { displayName: "O4 Mini", resolve: "openrouter/openai/o4-mini" },
"gemini-pro": {
displayName: "Gemini Pro",
resolve: "openrouter/google/gemini-3.1-pro-preview"
},
"gemini-flash": {
displayName: "Gemini Flash",
resolve: "openrouter/google/gemini-3-flash-preview"
},
grok: { displayName: "Grok", resolve: "openrouter/x-ai/grok-4" },
"deepseek-chat": {
displayName: "DeepSeek Chat",
resolve: "openrouter/deepseek/deepseek-chat-v3.1"
},
"kimi-k2": { displayName: "Kimi K2", resolve: "openrouter/moonshotai/kimi-k2.5" }
}
})
};
var modelAliases = Object.entries(providers).flatMap(
([providerKey, config]) => Object.entries(config.models).map(([modelId, def]) => ({
slug: `${providerKey}/${modelId}`,
provider: providerKey,
displayName: def.displayName,
resolve: def.resolve,
recommended: def.recommended ?? false,
isFree: def.isFree ?? false
}))
);
// utils/buildPullfrogFooter.ts
var PULLFROG_DIVIDER = "<!-- PULLFROG_DIVIDER_DO_NOT_REMOVE_PLZ -->";
var FROG_LOGO = `<a href="https://pullfrog.com"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pullfrog.com/logos/frog-white-full-18px.png"><img src="https://pullfrog.com/logos/frog-green-full-18px.png" width="9px" height="9px" style="vertical-align: middle; " alt="Pullfrog"></picture></a>`;
function formatModelLabel(slug) {
const alias = modelAliases.find((a) => a.slug === slug);
if (!alias) return `\`${slug}\``;
return alias.isFree ? `\`${alias.displayName}\` (free)` : `\`${alias.displayName}\``;
}
function buildPullfrogFooter(params) {
const parts = [];
if (params.customParts) {
@@ -37527,11 +37695,10 @@ function buildPullfrogFooter(params) {
if (params.triggeredBy) {
parts.push("Triggered by [Pullfrog](https://pullfrog.com)");
}
const allParts = [
...parts,
"[pullfrog.com](https://pullfrog.com)",
"[\u{1D54F}](https://x.com/pullfrogai)"
];
if (params.model) {
parts.push(`Using ${formatModelLabel(params.model)}`);
}
const allParts = [...parts, "[\u{1D54F}](https://x.com/pullfrogai)"];
return `
${PULLFROG_DIVIDER}
<sup>${FROG_LOGO}&nbsp;&nbsp;\uFF5C ${allParts.join(" \uFF5C ")}</sup>`;
+2 -2
View File
@@ -19,8 +19,8 @@ exports[`latest model per provider snapshot > matches snapshot 1`] = `
"releaseDate": "2026-01",
},
"openai": {
"modelId": "gpt-5.4-pro",
"releaseDate": "2026-03-05",
"modelId": "gpt-5.4-nano",
"releaseDate": "2026-03-17",
},
"opencode": {
"modelId": "nemotron-3-super-free",
+2
View File
@@ -76,6 +76,8 @@ describe("latest model per provider snapshot", async () => {
}
}
// when this fails, a provider shipped a new model. check whether we need
// to add or update an alias in models.ts before updating the snapshot.
it("matches snapshot", () => {
expect(latestByProvider).toMatchSnapshot();
});
+18 -8
View File
@@ -1,3 +1,5 @@
import { modelAliases } from "../models.ts";
export const PULLFROG_DIVIDER = "<!-- PULLFROG_DIVIDER_DO_NOT_REMOVE_PLZ -->";
const FROG_LOGO = `<a href="https://pullfrog.com"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pullfrog.com/logos/frog-white-full-18px.png"><img src="https://pullfrog.com/logos/frog-green-full-18px.png" width="9px" height="9px" style="vertical-align: middle; " alt="Pullfrog"></picture></a>`;
@@ -18,13 +20,21 @@ export interface BuildPullfrogFooterParams {
/** alternative: just pass a pre-built URL directly (for shortlinks etc.) */
workflowRunUrl?: string | undefined;
/** arbitrary custom parts (e.g., action links) */
customParts?: string[];
customParts?: string[] | undefined;
/** model slug from payload (e.g., "anthropic/claude-opus"). shown in footer as "Using `Model Name`" */
model?: string | undefined;
}
function formatModelLabel(slug: string): string {
const alias = modelAliases.find((a) => a.slug === slug);
if (!alias) return `\`${slug}\``;
return alias.isFree ? `\`${alias.displayName}\` (free)` : `\`${alias.displayName}\``;
}
/**
* build a pullfrog footer with configurable parts
* always includes: frog logo at start, pullfrog.com link and X link at end
* order: action links (customParts) > workflow run > attribution > reference links
* always includes: frog logo at start and X link at end
* order: action links (customParts) > workflow run > model > attribution > reference links
*/
export function buildPullfrogFooter(params: BuildPullfrogFooterParams): string {
const parts: string[] = [];
@@ -45,11 +55,11 @@ export function buildPullfrogFooter(params: BuildPullfrogFooterParams): string {
parts.push("Triggered by [Pullfrog](https://pullfrog.com)");
}
const allParts = [
...parts,
"[pullfrog.com](https://pullfrog.com)",
"[𝕏](https://x.com/pullfrogai)",
];
if (params.model) {
parts.push(`Using ${formatModelLabel(params.model)}`);
}
const allParts = [...parts, "[𝕏](https://x.com/pullfrogai)"];
return `
${PULLFROG_DIVIDER}
+1
View File
@@ -36,6 +36,7 @@ export async function reportErrorToComment(ctx: ReportErrorParams): Promise<void
triggeredBy: true,
workflowRun: runId ? { owner: repoContext.owner, repo: repoContext.name, runId } : undefined,
customParts,
model: ctx.toolState.model,
});
await octokit.rest.issues.updateComment({