From 36b3d82d2ef99345761ccc664b0ba4fad098a71d Mon Sep 17 00:00:00 2001 From: Sprite Date: Sun, 8 Feb 2026 03:01:55 +0000 Subject: [PATCH] refactor: add OAuth timeout and remove unused color variables - Add --max-time 30 to OAuth key exchange curl to prevent indefinite hangs - Remove unused DIM variable from cli/install.sh - Remove unused BLUE variable from cli/spawn.sh Co-Authored-By: Claude Sonnet 4.5 --- cli/install.sh | 1 - cli/spawn.sh | 1 - shared/common.sh | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/cli/install.sh b/cli/install.sh index 7db84f87..501ad491 100755 --- a/cli/install.sh +++ b/cli/install.sh @@ -19,7 +19,6 @@ RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' BOLD='\033[1m' -DIM='\033[2m' NC='\033[0m' log_info() { echo -e "${GREEN}[spawn]${NC} $1"; } diff --git a/cli/spawn.sh b/cli/spawn.sh index bc6cf18f..163868df 100755 --- a/cli/spawn.sh +++ b/cli/spawn.sh @@ -32,7 +32,6 @@ SPAWN_CACHE_TTL=3600 # 1 hour in seconds RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' -BLUE='\033[0;34m' BOLD='\033[1m' DIM='\033[2m' NC='\033[0m' diff --git a/shared/common.sh b/shared/common.sh index 6971ef8f..0b0ec282 100644 --- a/shared/common.sh +++ b/shared/common.sh @@ -418,7 +418,7 @@ exchange_oauth_code() { local oauth_code="${1}" local key_response - key_response=$(curl -s -X POST "https://openrouter.ai/api/v1/auth/keys" \ + key_response=$(curl -s --max-time 30 -X POST "https://openrouter.ai/api/v1/auth/keys" \ -H "Content-Type: application/json" \ -d "{\"code\": \"${oauth_code}\"}")