From 93f294265f331f9549075b23e495aa5ac86d98d8 Mon Sep 17 00:00:00 2001 From: Spacehunterz <201493392+Spacehunterz@users.noreply.github.com> Date: Mon, 26 Jan 2026 14:19:15 -0600 Subject: [PATCH] fix(launcher): auto-create Ollama profile and auth on first run The embedded agent requires an auth-profiles.json with the Ollama API key. Now the launcher automatically creates: - ~/.clawdbot-ollama/clawdbot.json (gateway config) - ~/.clawdbot-ollama/agents/main/agent/auth-profiles.json (Ollama API key) This makes the desktop launcher work out of the box without manual setup. Co-Authored-By: Claude Opus 4.5 --- scripts/launch-clawdbot-ollama.sh | 54 +++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/scripts/launch-clawdbot-ollama.sh b/scripts/launch-clawdbot-ollama.sh index fc01f3470..2c2721c6c 100755 --- a/scripts/launch-clawdbot-ollama.sh +++ b/scripts/launch-clawdbot-ollama.sh @@ -25,6 +25,59 @@ check_ollama_security() { fi } +# ============================================================================= +# PROFILE SETUP +# ============================================================================= + +setup_ollama_profile() { + PROFILE_DIR="$HOME/.clawdbot-ollama" + AGENT_DIR="$PROFILE_DIR/agents/main/agent" + + # Create profile config if missing + if [ ! -f "$PROFILE_DIR/clawdbot.json" ]; then + mkdir -p "$PROFILE_DIR" + cat > "$PROFILE_DIR/clawdbot.json" << 'CONF' +{ + "gateway": { + "mode": "local", + "port": 19001, + "bind": "loopback", + "auth": { + "mode": "token", + "token": "ollama-dev-token" + } + }, + "agents": { + "defaults": { + "model": { + "primary": "ollama/qwen3-coder-32k:latest" + } + } + } +} +CONF + echo "Created Ollama profile config" + fi + + # Create auth profile for Ollama provider + if [ ! -f "$AGENT_DIR/auth-profiles.json" ]; then + mkdir -p "$AGENT_DIR" + cat > "$AGENT_DIR/auth-profiles.json" << 'AUTH' +{ + "profiles": { + "ollama-default": { + "type": "api_key", + "key": "ollama", + "provider": "ollama", + "addedAt": "2026-01-26T00:00:00.000Z" + } + } +} +AUTH + echo "Created Ollama auth profile" + fi +} + # ============================================================================= # OLLAMA # ============================================================================= @@ -52,6 +105,7 @@ echo "Profile: ollama (port 19001)" echo "" check_ollama_security +setup_ollama_profile start_ollama echo ""