Skip to content

Commit 953c430

Browse files
fix(buzz-agent): honor OPENAI_BASE_URL as fallback for base URL
The OpenAI provider's base URL resolution only checked OPENAI_COMPAT_BASE_URL, ignoring the more commonly expected OPENAI_BASE_URL env var. This meant users setting a custom base URL via the desktop persona env vars (which uses OPENAI_BASE_URL) would have it silently ignored, with the agent always falling back to api.openai.com. Now checks OPENAI_BASE_URL first, falls back to OPENAI_COMPAT_BASE_URL for backward compatibility, then defaults to https://api.openai.com/v1. Fixes block#3630 Signed-off-by: Chukwuebuka-2003 <[email protected]>
1 parent ab55fee commit 953c430

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎crates/buzz-agent/src/config.rs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,9 @@ impl Config {
791791
env("OPENAI_COMPAT_MODEL").as_deref(),
792792
)
793793
.ok_or_else(|| "config: OPENAI_COMPAT_MODEL required".to_string())?,
794-
env_or("OPENAI_COMPAT_BASE_URL", "https://api.openai.com/v1"),
794+
env("OPENAI_BASE_URL")
795+
.or_else(|| env("OPENAI_COMPAT_BASE_URL"))
796+
.unwrap_or_else(|| "https://api.openai.com/v1".into()),
795797
parse_openai_api(env("OPENAI_COMPAT_API").as_deref())?,
796798
),
797799
Provider::Databricks | Provider::DatabricksV2 => (

0 commit comments

Comments
 (0)