feat: add --schema, --max-turns and rpc --ask
- hx -p --schema <file> validates the final answer against a JSON schema, with one retry that includes the validation errors - max_turns config key and --max-turns cap the main agent's model calls - hx --mode rpc --ask sends permission requests to the client instead of auto-allowing bash/write/edit calls Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
13d914c8c0
commit
dfec176f43
11 files changed
+599
-14
No files matched your search
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
root=$(cd "$(dirname "$0")/.." && pwd)
|
||||
tmp=$(mktemp -d)
|
||||
trap 'kill $srv 2>/dev/null; rm -rf "$tmp"' EXIT
|
||||
port=$((20000 + ($$ + 13) % 20000))
|
||||
python3 "$root/tests/fake_anthropic.py" $port & srv=$!
|
||||
mkdir -p "$tmp/home/.hx" "$tmp/repo"
|
||||
echo '{"claude":{"access":"fake-token","refresh":"r","expires":99999999999999}}' > "$tmp/home/.hx/auth.json"
|
||||
sleep 0.5
|
||||
cd "$tmp/repo"
|
||||
export HOME="$tmp/home" HX_BASE_URL="http://127.0.0.1:$port"
|
||||
python3 "$root/tests/rpc_ask_client.py" "$root/target/debug/hx" > "$tmp/out" || { echo "FAIL: rpc ask"; cat "$tmp/out"; exit 1; }
|
||||
[ "$(cat hello.txt)" = "hi from hx" ] || { echo "FAIL: allowed write did not run"; exit 1; }
|
||||
echo "rpc ask e2e ok"
|
||||
Reference in new issue
Block a user