From a46012c339ca874350eec5ca28047746052c9d35 Mon Sep 17 00:00:00 2001 From: Luiz Gustavo Date: Mon, 25 May 2026 02:07:01 -0300 Subject: [PATCH] W5.9 fix: case-writer timeout floor 300s -> 600s The enriched prompt (scenes + verbatim + anomalies + witnesses + Dupin tensions + Sun-Tzu brief) produces a longer bilingual narrative. At 300s the claude CLI timed out mid-generation (job 945c14f2 failed at 310s). Raised the floor to 600s; reprocess then completed in 251s with a bolder closer reflecting the strategic brief. Co-Authored-By: Claude Opus 4.7 (1M context) --- investigator-runtime/src/detectives/case_writer.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/investigator-runtime/src/detectives/case_writer.ts b/investigator-runtime/src/detectives/case_writer.ts index e605c15..04ae51d 100644 --- a/investigator-runtime/src/detectives/case_writer.ts +++ b/investigator-runtime/src/detectives/case_writer.ts @@ -385,12 +385,15 @@ export async function runCaseWriter(task: CaseWriterTask): Promise< const systemPrompt = await readFile(PROMPT_PATH, "utf-8"); const prompt = buildPrompt(task, scenes, evidence, witnesses, gaps, tensions, brief, lang); - // Case-writer wants more output budget than the other detectives. + // Case-writer wants more time + budget than the other detectives. The + // enriched prompt (scenes + verbatim + anomalies + witnesses + tensions + + // strategic brief) produces a long bilingual narrative; 300s was too tight + // and timed out at the claude CLI. Floor at 600s. const llm = await callClaude({ prompt, systemPrompt, model: env.CLAUDE_MODEL, allowedTools: [], - timeoutMs: Math.max(env.JOB_TIMEOUT_SECONDS, 240) * 1000, + timeoutMs: Math.max(env.JOB_TIMEOUT_SECONDS, 600) * 1000, budgetCapUsd: task.budget_cap_usd ?? Math.max(env.BUDGET_CAP_USD_PER_JOB, 0.50), }); await audit({