Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions src/lib/steps/integrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,13 @@ export async function runIntegration(args: RunIntegrationArgs): Promise<void> {
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
Expand Down Expand Up @@ -128,6 +129,16 @@ export async function runIntegration(args: RunIntegrationArgs): Promise<void> {
}
}

// 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,
Expand Down
Loading