From 210a235be602dd3d1bf00eeb9b6ce4ef75d165cb Mon Sep 17 00:00:00 2001 From: hugocasa Date: Wed, 28 Oct 2026 00:53:34 +0100 Subject: [PATCH] fix: resolve $var: in an AI resource's base_url (#12053) The AI proxy resolved every credential field of a resource except base_url, so a base_url set with "Insert a Variable" reached URL validation as the literal $var: path and failed with "relative URL without a base". Co-authored-by: Claude Opus 5.5 --- backend/windmill-api/src/ai.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/windmill-api/src/ai.rs b/backend/windmill-api/src/ai.rs index 213a41b4eb..6ea5436274 100644 --- a/backend/windmill-api/src/ai.rs +++ b/backend/windmill-api/src/ai.rs @@ -315,7 +315,11 @@ async fn resolve_provider_credentials( let user_db = authed.map(|_| UserDB::new(db.clone())); match resource { - AIResource::Standard(resource) => { + AIResource::Standard(mut resource) => { + if let Some(base_url) = resource.base_url { + resource.base_url = + Some(resolve_var(base_url, db, w_id, user_db.as_ref(), authed).await?); + } // Skip get_base_url for Bedrock - it uses SDK directly, not HTTP let base_url = if matches!(provider, AIProvider::AWSBedrock) { String::new()