claude_cli: show the command/path of each claude tool call

This commit is contained in:
hermes committed 2026-10-16 20:36:47 +00:00
1 parent 785effef11
commit 15b037ceca
3 files changed
+41 -9

No files matched your search

+1 -1
View File
@@ -10,6 +10,6 @@ chmod +x "$root/tests/fake_claude.py"
cd "$tmp/repo"
export HOME="$tmp/home" HX_CLAUDE_BIN="$root/tests/fake_claude.py" FAKE_CLAUDE_LOG="$tmp/argv"
"$root/target/debug/hx" -p "hi" -s "$tmp/s.jsonl" > "$tmp/out" 2> "$tmp/err" || { echo "FAIL run"; cat "$tmp/err"; exit 1; }
grep -q "approve: allow" "$tmp/out" || { echo "FAIL text"; cat "$tmp/out" "$tmp/err"; exit 1; }
grep -q "claude Bash: echo hi-from-tool" "$tmp/out" && grep -q "approve: allow" "$tmp/out" || { echo "FAIL text"; cat "$tmp/out" "$tmp/err"; exit 1; }
grep -q '"--permission-prompt-tool"' "$tmp/argv" && grep -q '"--mcp-config"' "$tmp/argv" && grep -q '"stream-json"' "$tmp/argv" || { echo "FAIL argv"; cat "$tmp/argv"; exit 1; }
echo "claude cli e2e ok"
+2 -1
View File
@@ -20,7 +20,8 @@ if "--permission-prompt-tool" in sys.argv: # act like claude: ask hx whether `r
reply = "approve: " + json.loads(lines[1]["result"]["content"][0]["text"])["behavior"]
out({"type": "system", "subtype": "init", "session_id": "S1"})
ev = lambda e: out({"type": "stream_event", "session_id": "S1", "event": e})
ev({"type": "content_block_start", "content_block": {"type": "tool_use", "name": "Read"}})
out({"type": "assistant", "session_id": "S1", "message": {"content": [
{"type": "tool_use", "name": "Bash", "input": {"command": "echo hi-from-tool"}}]}})
ev({"type": "content_block_delta", "delta": {"type": "text_delta", "text": reply + " "}})
ev({"type": "content_block_delta", "delta": {"type": "text_delta", "text": "from claude"}})
out({"type": "result", "session_id": "S1", "is_error": False, "result": "hello from claude",