diff --git a/deploy_script.sh b/deploy_script.sh index 1a9f7c9..dc89f25 100644 --- a/deploy_script.sh +++ b/deploy_script.sh @@ -453,6 +453,12 @@ main() { docker image prune -af 2>/dev/null || true if [[ " ${ACTIVE_SERVICES[*]} " =~ " paperclip " ]]; then + # Patch the validation endpoint in the backend to respect OPENAI_BASE_URL + # This prevents the UI from rejecting OpenRouter/Mistral API keys during Onboarding! + log "Patching LLM validation endpoint in Paperclip container..." + docker exec -u root paperclip_app sed -i 's|"https://api.openai.com/v1/models"|process.env.OPENAI_BASE_URL ? process.env.OPENAI_BASE_URL + "/models" : "https://api.openai.com/v1/models"|g' /app/server/dist/routes/ai-connections.js || true + docker restart paperclip_app + log "Waiting for Paperclip to initialize (10s)..." sleep 10 log "========================================================="