From b0deb21d3abc319c35ad04e5d43d2aaa06844746 Mon Sep 17 00:00:00 2001 From: pyr0ball Date: Thu, 2 Apr 2026 11:20:00 -0700 Subject: [PATCH] fix: use stdout/stderr fields for Bash tool_response output extraction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CC sends Bash results as {stdout, stderr, interrupted, isImage, noOutputExpected}. Previous code guessed output/content/text — all wrong, so encounter detection never matched. Confirmed via active.json relay debug. --- hooks-handlers/post-tool-use.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hooks-handlers/post-tool-use.py b/hooks-handlers/post-tool-use.py index 284ba69..9b71626 100755 --- a/hooks-handlers/post-tool-use.py +++ b/hooks-handlers/post-tool-use.py @@ -280,12 +280,11 @@ def main(): # ── Bash tool: error detection + auto-resolution + commit tracking ─────── if tool_name == "Bash": output = "" + # CC Bash tool_response keys: stdout, stderr, interrupted, isImage, noOutputExpected if isinstance(tool_response, dict): parts = [ - tool_response.get("output", ""), - tool_response.get("content", ""), + tool_response.get("stdout", ""), tool_response.get("stderr", ""), - tool_response.get("text", ""), ] output = "\n".join(p for p in parts if isinstance(p, str) and p) elif isinstance(tool_response, str):