claude_cli: permission prompts via --permission-prompt-tool, bridged to the hx TUI

This commit is contained in:
hermes committed 2026-10-16 20:23:35 +00:00
1 parent b06c06ad80
commit 0032a5a952
8 files changed
+248 -46

No files matched your search

+3 -3
View File
@@ -1,5 +1,5 @@
#!/bin/sh
# claude_cli = [] routes Claude through the `claude` binary (fake here): streamed text arrives, argv is right.
# (print mode has no prompt, so the permission bridge allows) claude_cli = [] routes Claude through the `claude` binary (fake here): streamed text arrives, argv is right.
set -eu
root=$(cd "$(dirname "$0")/.." && pwd)
tmp=$(mktemp -d)
@@ -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 "hello from claude" "$tmp/out" || { echo "FAIL text"; cat "$tmp/out" "$tmp/err"; exit 1; }
grep -q '"--mcp-config"' "$tmp/argv" && grep -q '"stream-json"' "$tmp/argv" || { echo "FAIL argv"; cat "$tmp/argv"; exit 1; }
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"