From 81817672af2f24897443406f12783032d89cd4cd Mon Sep 17 00:00:00 2001 From: Scott Jennings Date: Wed, 10 Dec 2025 19:06:24 -0600 Subject: [PATCH] fix: mandate killing background shells before code review Change cleanup logic from "check and maybe kill" to "kill unconditionally". The previous approach allowed agents to read stale output from lingering external agent processes, causing context pollution and reuse of old data. New behavior: - Kill ALL background shells as the FIRST action - Do NOT read output from stale shells (BashOutput forbidden) - Do NOT check what processes are doing - just terminate them - Only proceed to Step 1 after all shells are dead --- .../code-review/instructions.xml | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/modules/bmm/workflows/4-implementation/code-review/instructions.xml b/src/modules/bmm/workflows/4-implementation/code-review/instructions.xml index 6373ae04..28453411 100644 --- a/src/modules/bmm/workflows/4-implementation/code-review/instructions.xml +++ b/src/modules/bmm/workflows/4-implementation/code-review/instructions.xml @@ -5,17 +5,25 @@ Generate all documents in {document_output_language} - + - - - Check for any running background shells/terminals from previous external agent reviews - If any `claude -p` or similar external agent processes are found running, use KillShell to terminate them - This ensures a clean slate for the new code review session - ๐Ÿงน Cleaned up previous external agent review processes (if any) + + ๐Ÿšจ FIRST ACTION REQUIRED: Kill all background shells ๐Ÿšจ + Before ANY other workflow step, you MUST terminate all background processes. + DO NOT use BashOutput to read from stale shells - this causes context pollution. + DO NOT try to "check what they're doing" - just kill them. + + + IMMEDIATELY use KillShell to terminate ALL background shells - no exceptions + Do NOT read output from these shells first - kill them blind + Do NOT rationalize keeping them alive - they contain stale data + If multiple shells exist, kill ALL of them one by one + ๐Ÿ”ช Killed all background shells to prevent stale data contamination + Only proceed to Step 1 AFTER all background shells are terminated.