From c1ebd84e11a8dec9f69a419cd4b514ba4d301370 Mon Sep 17 00:00:00 2001 From: orfelorfel23 Date: Thu, 1 Oct 2026 18:58:44 +0200 Subject: [PATCH] Patch Paperclip backend to respect OPENAI_BASE_URL during connection validation --- deploy_script.sh | 6 ++++++ 1 file changed, 6 insertions(+) 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 "========================================================="