Stop setup blocking on invisible sbx confirmation prompts
sbx skills import prompts before overwriting each skill already in the shared store. setup called it with stdout and stderr redirected and stdin left attached, so on any second run the prompt was invisible and setup hung indefinitely partway through installing the Claude configuration. sbx rm prompts the same way, which would have blocked --replace and remove once a sandbox was in use. Both now pass --force and read from /dev/null. This is the third instance of the pattern after sbx secret set, which cancelled silently and still exited 0, so a test now asserts at the source level that every prompting subcommand is invoked non-interactively. The test was confirmed to fail when either --force is removed.
This commit is contained in:
Executable
+45
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
TASK="$(dirname "${BASH_SOURCE[0]}")/../tasks/ai/sbx"
|
||||
|
||||
failures=0
|
||||
|
||||
fail() {
|
||||
printf 'FAIL: %s\n' "$1" >&2
|
||||
failures=$((failures + 1))
|
||||
}
|
||||
|
||||
code() {
|
||||
grep -n '^[^#]*sbx ' "$TASK" | grep -v 'ai:sbx'
|
||||
}
|
||||
|
||||
require_force() {
|
||||
local pattern="$1" line
|
||||
local found=false
|
||||
|
||||
while IFS= read -r line; do
|
||||
found=true
|
||||
[[ "$line" == *"--force"* ]] ||
|
||||
fail "missing --force, will block on a prompt: ${line#*:}"
|
||||
done < <(code | grep -F "$pattern" || true)
|
||||
|
||||
[[ "$found" == true ]] ||
|
||||
fail "no invocation of '$pattern' found; has it been renamed?"
|
||||
}
|
||||
|
||||
require_force 'sbx secret set'
|
||||
require_force 'sbx skills import'
|
||||
require_force 'sbx rm '
|
||||
|
||||
while IFS= read -r line; do
|
||||
[[ "$line" == *"</dev/null"* ]] ||
|
||||
fail "missing </dev/null: ${line#*:}"
|
||||
done < <(code | grep -F 'sbx skills import' || true)
|
||||
|
||||
if ((failures)); then
|
||||
printf '%d assertion(s) failed\n' "$failures" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
printf 'All non-interactive invocation assertions passed.\n'
|
||||
Reference in New Issue
Block a user