fix: read tool_response field in observe.sh (#377)

Claude Code sends tool output as `tool_response` in PostToolUse hook
payloads, but observe.sh only checked for `tool_output` and `output`.
This caused all observations to have empty output fields, making the
observer pipeline blind to tool results.

Adds `tool_response` as the primary field to check, with backward-
compatible fallback to the existing `tool_output` and `output` fields.
This commit is contained in:
ispaydeu
2026-03-10 20:02:53 -04:00
committed by Affaan Mustafa
parent af51fcacb7
commit 708c265b4f

View File

@@ -124,7 +124,7 @@ try:
# Extract fields - Claude Code hook format
tool_name = data.get("tool_name", data.get("tool", "unknown"))
tool_input = data.get("tool_input", data.get("input", {}))
tool_output = data.get("tool_output", data.get("output", ""))
tool_output = data.get("tool_response", data.get("tool_output", data.get("output", "")))
session_id = data.get("session_id", "unknown")
tool_use_id = data.get("tool_use_id", "")
cwd = data.get("cwd", "")