From a120160f424390890aa62b174ed6428be68f38d8 Mon Sep 17 00:00:00 2001 From: Colin McDonnell Date: Wed, 15 Apr 2026 23:39:17 +0000 Subject: [PATCH] clean up startup run configuration logs remove duplicate model and agent log emitters, then print model, agent, push, shell, and timeout on separate startup lines so run settings stay concise and easy to scan. Made-with: Cursor --- main.ts | 40 ++++++++++++++++++++++++++++++++++++++-- utils/agent.ts | 4 ---- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/main.ts b/main.ts index c31fffd..e68d75a 100644 --- a/main.ts +++ b/main.ts @@ -69,6 +69,38 @@ function resolveOutputSchema(): Record | undefined { return parsed as Record; } +function resolveTimeoutForLog(timeout: string | undefined): string { + if (!timeout) return "1h (default)"; + if (timeout === TIMEOUT_DISABLED) return "none (disabled)"; + return timeout; +} + +function resolveModelForLog(ctx: { + payload: ResolvedPayload; + resolvedModel: string | undefined; +}): string { + const envModel = process.env.PULLFROG_MODEL?.trim(); + if (envModel) return `${envModel} (override via PULLFROG_MODEL)`; + if (ctx.payload.proxyModel) return `${ctx.payload.proxyModel} (proxy)`; + if (ctx.resolvedModel && ctx.payload.model && ctx.payload.model !== ctx.resolvedModel) { + return `${ctx.resolvedModel} (resolved from ${ctx.payload.model})`; + } + if (ctx.resolvedModel) return ctx.resolvedModel; + if (ctx.payload.model) return `${ctx.payload.model} (unresolved)`; + return "auto"; +} + +function resolveAgentForLog(ctx: { agentName: string; resolvedModel: string | undefined }): string { + const envAgent = process.env.PULLFROG_AGENT?.trim(); + if (envAgent && envAgent === ctx.agentName) { + return `${ctx.agentName} (override via PULLFROG_AGENT)`; + } + if (ctx.agentName === "claude" && ctx.resolvedModel) { + return `${ctx.agentName} (auto-selected for ${ctx.resolvedModel})`; + } + return ctx.agentName; +} + import type { ResolvedPayload } from "./utils/payload.ts"; interface OidcCredentials { @@ -312,10 +344,14 @@ export async function main(): Promise { startInstallation(toolContext); - if (payload.model) log.info(`» model: ${payload.model}`); - if (payload.timeout) log.info(`» timeout: ${payload.timeout}`); + const modelForLog = resolveModelForLog({ payload, resolvedModel }); + const agentForLog = resolveAgentForLog({ agentName: agent.name, resolvedModel }); + const timeoutForLog = resolveTimeoutForLog(payload.timeout); + log.info(`» model: ${modelForLog}`); + log.info(`» agent: ${agentForLog}`); log.info(`» push: ${payload.push}`); log.info(`» shell: ${payload.shell}`); + log.info(`» timeout: ${timeoutForLog}`); const instructions = resolveInstructions({ payload, diff --git a/utils/agent.ts b/utils/agent.ts index e0cc402..4826bbf 100644 --- a/utils/agent.ts +++ b/utils/agent.ts @@ -23,14 +23,12 @@ function hasClaudeCodeAuth(): boolean { export function resolveModel(ctx: { slug?: string | undefined }): string | undefined { const envModel = process.env.PULLFROG_MODEL?.trim(); if (envModel) { - log.info(`» model: ${envModel} (override via PULLFROG_MODEL)`); return envModel; } if (ctx.slug) { const resolved = resolveCliModel(ctx.slug); if (resolved) { - log.info(`» model: ${resolved} (resolved from ${ctx.slug})`); return resolved; } log.warning(`» unknown model slug "${ctx.slug}" — agent will auto-select`); @@ -44,7 +42,6 @@ export function resolveAgent(ctx: { model?: string | undefined }): Agent { const envAgent = process.env.PULLFROG_AGENT?.trim(); if (envAgent) { if (envAgent in agents) { - log.info(`» agent: ${envAgent} (override via PULLFROG_AGENT)`); return agents[envAgent as keyof typeof agents]; } log.warning(`» unknown PULLFROG_AGENT="${envAgent}" — falling through to auto-select`); @@ -55,7 +52,6 @@ export function resolveAgent(ctx: { model?: string | undefined }): Agent { try { const provider = getModelProvider(ctx.model); if (provider === "anthropic" && hasClaudeCodeAuth()) { - log.info(`» agent: claude (auto-selected for ${ctx.model})`); return agents.claude; } } catch {