claude_cli: offer codemode to claude (codemode = true), hx tools inside it ask via the permission bridge
This commit is contained in:
1 parent
785effef11
commit
fdeaaf5cf2
4 files changed
+111
-27
No files matched your search
@@ -5,11 +5,12 @@ root=$(cd "$(dirname "$0")/.." && pwd)
|
||||
tmp=$(mktemp -d)
|
||||
trap 'rm -rf "$tmp"' EXIT
|
||||
mkdir -p "$tmp/home/.hx" "$tmp/repo"
|
||||
printf 'claude_cli = []\n[lsp]\nmode = "off"\ntests = "off"\n' > "$tmp/home/.hx/config.toml"
|
||||
printf 'claude_cli = []\ncodemode = true\n[lsp]\nmode = "off"\ntests = "off"\n' > "$tmp/home/.hx/config.toml"
|
||||
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 '"--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; }
|
||||
grep -q "cm-ok" "$tmp/out" || { echo "FAIL codemode"; cat "$tmp/out" "$tmp/err"; exit 1; }
|
||||
echo "claude cli e2e ok"
|
||||
Reference in new issue
Block a user