diff --git a/apps/api/src/routes/servers.ts b/apps/api/src/routes/servers.ts index 080ead7..355e6ca 100644 --- a/apps/api/src/routes/servers.ts +++ b/apps/api/src/routes/servers.ts @@ -53,11 +53,14 @@ export async function serverRoutes(app: FastifyInstance): Promise { try { const { spec, source } = await generateSpec(parsed.data.prompt, { apiKey: config.ANTHROPIC_API_KEY, - // Sonnet 4.6 drafts the spec well inside Cloudflare's ~100s proxy cap; - // Opus routinely exceeded it, which reached the browser as a CORS error. - model: 'claude-sonnet-4-6', - timeoutMs: 45_000, - maxRetries: 1, + // Preview generates the spec synchronously inside an HTTP request that + // sits behind Cloudflare's edge timeout. Haiku 4.5 (~200 tok/s — a full + // 8k-token spec in ~40s) is the only model fast enough; Sonnet and Opus + // overran the proxy cap, which reached the browser as a CORS error. The + // hard 60s timeout guarantees a clean 504 before the proxy gives up. + model: 'claude-haiku-4-5-20251001', + timeoutMs: 60_000, + maxRetries: 0, }); const previewId = await cacheSpec(spec); return reply.send({ diff --git a/apps/web/app/(dashboard)/servers/new/page.tsx b/apps/web/app/(dashboard)/servers/new/page.tsx index df32567..bac0745 100644 --- a/apps/web/app/(dashboard)/servers/new/page.tsx +++ b/apps/web/app/(dashboard)/servers/new/page.tsx @@ -457,7 +457,7 @@ function NewServerPageInner() {

Analyzing your prompt…

- Claude Sonnet 4.6 is drafting the tool spec. Usually 20–40 seconds. + Claude is drafting the tool spec. Usually 15–40 seconds.

{elapsedSec}s elapsed