fix(gemini,qwen): replace test prompt with version check in verify step
gemini -p / qwen -p crashes with "setRawMode EIO" when stdin is not a TTY (running from sudo bash script.sh). Verification now uses --version instead — fast, reliable, no TTY needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -327,23 +327,11 @@ export GOOGLE_GEMINI_BASE_URL="$BASE_URL"
|
||||
# ---- Verify ----
|
||||
|
||||
info "Verifying..."
|
||||
echo ""
|
||||
|
||||
# Portable timeout (macOS may not have it)
|
||||
run_with_timeout() {
|
||||
if command -v timeout &>/dev/null; then
|
||||
timeout 30 "$@"
|
||||
elif command -v gtimeout &>/dev/null; then
|
||||
gtimeout 30 "$@"
|
||||
else
|
||||
"$@"
|
||||
fi
|
||||
}
|
||||
|
||||
RESULT=$(run_with_timeout gemini -p "Reply with just OK" 2>&1 || true)
|
||||
if echo "$RESULT" | grep -qi "OK"; then
|
||||
if gemini --version &>/dev/null; then
|
||||
VER=$(gemini --version 2>/dev/null || echo "unknown")
|
||||
echo ""
|
||||
echo -e "${GREEN}${BOLD} Gemini CLI installed and patched!${RESET}"
|
||||
echo -e "${GREEN}${BOLD} Gemini CLI v$VER installed and patched!${RESET}"
|
||||
echo ""
|
||||
echo " Usage:"
|
||||
echo " gemini # interactive mode"
|
||||
@@ -356,8 +344,6 @@ if echo "$RESULT" | grep -qi "OK"; then
|
||||
echo " Env vars auto-loaded by wrapper. Works in any shell."
|
||||
echo ""
|
||||
else
|
||||
warn "Patches applied but test prompt failed."
|
||||
echo " Response: $RESULT"
|
||||
echo ""
|
||||
echo " Try manually: gemini -p 'Hello'"
|
||||
err "gemini wrapper not working"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user