From 3885a96c9dffa20d91734c6f95f6611bd83a6fa9 Mon Sep 17 00:00:00 2001 From: Lukas May Date: Sat, 7 Mar 2026 00:51:25 +0100 Subject: [PATCH] fix: strengthen signal.json prompt to prevent premature writes Agents sometimes write signal.json before finishing output files, causing work to be silently discarded. Replace weak "As your final action" with explicit CRITICAL warning explaining the completion trigger mechanism. --- apps/server/agent/prompts/shared.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/server/agent/prompts/shared.ts b/apps/server/agent/prompts/shared.ts index af90bdf..8c092ed 100644 --- a/apps/server/agent/prompts/shared.ts +++ b/apps/server/agent/prompts/shared.ts @@ -6,7 +6,7 @@ export const SIGNAL_FORMAT = ` -As your final action, write \`.cw/output/signal.json\`: +CRITICAL: Write \`.cw/output/signal.json\` as your ABSOLUTE LAST action. The system monitors this file as a completion trigger — writing it before your output files causes your work to be silently discarded. - Done: \`{ "status": "done" }\` - Need clarification: \`{ "status": "questions", "questions": [{ "id": "q1", "question": "..." }] }\` - Unrecoverable error: \`{ "status": "error", "error": "..." }\` — include the actual error output, stack trace, or repro steps, not just a summary