diff --git a/src/lib/steps/integrate.ts b/src/lib/steps/integrate.ts index 5387e49..ed485ab 100644 --- a/src/lib/steps/integrate.ts +++ b/src/lib/steps/integrate.ts @@ -61,12 +61,13 @@ export async function runIntegration(args: RunIntegrationArgs): Promise { prompt: goal, options: { cwd: root, - // Cost-tuned for a starter integration (Seam pays for this): Sonnet 5 is - // near-Opus on coding at ~half the token price, medium effort trims the - // thinking spend, and maxBudgetUsd is a hard per-run dollar ceiling. - model: 'claude-sonnet-5', + // Model depends on the chosen mode (see modelForMode): the customer-portal + // path is a small, high-value surface, so it runs on Opus 4.8; the broader + // full-API path runs on cheap Haiku 4.5. medium effort trims the thinking + // spend, and maxBudgetUsd is a hard per-run dollar ceiling. + model: modelForMode(mode), effort: 'medium', - maxBudgetUsd: 5, + maxBudgetUsd: 10, env: buildAgentEnv(inference), allowedTools: ALLOWED_TOOLS, // Auto-apply file edits so the agent runs uninterrupted; the developer @@ -128,6 +129,16 @@ export async function runIntegration(args: RunIntegrationArgs): Promise { } } +// The embedded agent's model depends on the mode the developer chose. The +// customer-portal integration is small but high-value (embedded portal, deep +// links), so it runs on Opus 4.8; the broader full-API path runs on cheap Haiku +// 4.5. Defaults to Haiku when the mode is unknown. +function modelForMode( + mode: 'full_api' | 'customer_portal' | undefined, +): string { + return mode === 'customer_portal' ? 'claude-opus-4-8' : 'claude-haiku-4-5' +} + function buildSystemAppend( sdk: Sdk, workspaceName: string,