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 <noreply@anthropic.com>
This commit is contained in:
hugocasa
2026-10-28 00:53:34 +01:00
committed by GitHub
co-authored by Claude Opus 5.5
parent ca8f0a16c1
commit 210a235be6
+5 -1
View File
@@ -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()