Files
autocoder/start_ui.sh
mantarayDigital b2c19b0c4c feat: Add authentication error handling to UI flow
Extend auth error detection to the web UI flow:

server/main.py:
- Fix setup_status() endpoint to check ~/.claude directory instead of
  non-existent .credentials.json file
- Add explanatory comments about Claude CLI credential storage changes

server/services/process_manager.py:
- Add AUTH_ERROR_PATTERNS for detecting auth errors in agent output
- Add is_auth_error() helper function
- Add AUTH_ERROR_HELP message template
- Update _stream_output() to detect auth errors in real-time
- Buffer last 20 lines to catch auth errors on process exit
- Broadcast clear help message to WebSocket clients when auth fails

start_ui.sh:
- Add Claude CLI installation check with helpful guidance
- Add ~/.claude directory check with login reminder
- Non-blocking warnings that don't prevent UI from starting

This ensures users get clear, actionable feedback when authentication
fails, whether using the CLI or the web UI.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 07:37:04 +02:00

60 lines
1.6 KiB
Bash

#!/bin/bash
cd "$(dirname "$0")"
# AutoCoder UI Launcher for Unix/Linux/macOS
# This script launches the web UI for the autonomous coding agent.
echo ""
echo "===================================="
echo " AutoCoder UI"
echo "===================================="
echo ""
# Check if Claude CLI is installed
if ! command -v claude &> /dev/null; then
echo "[!] Claude CLI not found"
echo ""
echo " The agent requires Claude CLI to work."
echo " Install it from: https://claude.ai/download"
echo ""
echo " After installing, run: claude login"
echo ""
else
echo "[OK] Claude CLI found"
# Note: Claude CLI no longer stores credentials in ~/.claude/.credentials.json
# We can't reliably check auth status without making an API call
if [ -d "$HOME/.claude" ]; then
echo " (If you're not logged in, run: claude login)"
else
echo "[!] Claude CLI not configured - run 'claude login' first"
fi
fi
echo ""
# Check if Python is available
if ! command -v python3 &> /dev/null; then
if ! command -v python &> /dev/null; then
echo "ERROR: Python not found"
echo "Please install Python from https://python.org"
exit 1
fi
PYTHON_CMD="python"
else
PYTHON_CMD="python3"
fi
# Check if venv exists, create if not
if [ ! -d "venv" ]; then
echo "Creating virtual environment..."
$PYTHON_CMD -m venv venv
fi
# Activate the virtual environment
source venv/bin/activate
# Install dependencies
echo "Installing dependencies..."
pip install -r requirements.txt --quiet
# Run the Python launcher
python start_ui.py "$@"