@@ -374,11 +374,10 @@ WRAP
374374 fi
375375 if [ "$auth_mode" = "subscription" ]; then
376376 claude --version
377- direct_token="violet-lantern-42"
378377 direct_probe_log="$(mktemp)"
379378 set +e
380379 claude \
381- -p "This is a local CLI smoke test. Reply with only this harmless phrase: $direct_token " \
380+ -p "This is a local CLI smoke test. What is two plus two? Reply with only the result. " \
382381 --output-format text \
383382 --model sonnet \
384383 --permission-mode bypassPermissions \
@@ -388,22 +387,25 @@ WRAP
388387 --no-session-persistence >"$direct_probe_log" 2>&1
389388 direct_probe_status=$?
390389 set -e
391- direct_output="$(<"$direct_probe_log")"
392- if [ "$direct_probe_status" -ne 0 ]; then
393- echo "ERROR: direct Claude subscription probe exited with status $direct_probe_status." >&2
390+ print_redacted_direct_probe_log() {
394391 sed -E \
395392 -e 's/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/<redacted-email>/g' \
396393 -e 's/(sk-ant-|sk-)[A-Za-z0-9_-]+/<redacted-secret>/g' \
397394 "$direct_probe_log" >&2
395+ }
396+ if [ "$direct_probe_status" -ne 0 ]; then
397+ echo "ERROR: direct Claude subscription probe exited with status $direct_probe_status." >&2
398+ print_redacted_direct_probe_log
398399 rm -f "$direct_probe_log"
399400 exit "$direct_probe_status"
400401 fi
401- rm -f "$direct_probe_log"
402- if [[ "$direct_output" != *"$direct_token"* ]]; then
403- echo "ERROR: direct Claude subscription probe did not return expected token." >&2
404- echo "$direct_output" >&2
402+ if ! grep -Eiq '(^|[^[:alnum:]])(4|four)([^[:alnum:]]|$)' "$direct_probe_log"; then
403+ echo "ERROR: direct Claude subscription probe did not return the expected arithmetic result." >&2
404+ print_redacted_direct_probe_log
405+ rm -f "$direct_probe_log"
405406 exit 1
406407 fi
408+ rm -f "$direct_probe_log"
407409 echo "[claude-subscription] direct claude -p probe ok"
408410 else
409411 claude auth status || true
0 commit comments