configure: treat an empty settings file like a missing one
edit_json created a settings file from its default only when it was missing. jq reads no JSON from an empty file and writes nothing back, so configure ai-servers said a server was added while the sandbox still blocked it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -96,6 +96,14 @@ setup_ai() {
|
||||
[ "$(cat "$SANDBOX_CONF")" = "not json" ]
|
||||
}
|
||||
|
||||
@test "sandbox_allow adds a server to an empty file" {
|
||||
setup_ai
|
||||
mkdir -p "$(dirname "$SANDBOX_CONF")"
|
||||
: > "$SANDBOX_CONF"
|
||||
sandbox_allow llm.local:11434
|
||||
[ "$(jq -c '.network.allowedDomains' "$SANDBOX_CONF")" = '["llm.local:11434"]' ]
|
||||
}
|
||||
|
||||
@test "claude_allow starts from the default domains when Claude has no list, and keeps their order" {
|
||||
setup_ai
|
||||
mkdir -p "$HOME/.claude"
|
||||
|
||||
Reference in New Issue
Block a user