fix(buzz-agent): honor OPENAI_BASE_URL as fallback for base URL - #3705
fix(buzz-agent): honor OPENAI_BASE_URL as fallback for base URL#3705Chukwuebuka-2003 wants to merge 1 commit into
Conversation
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 <ebulamicheal@gmail.com> (cherry picked from commit 953c430)
|
Independent review (Bartok9) — 2026-07-30 vs current Thanks for pushing on #3630 — agreeing env fallback is needed. Blocking nit: precedence is inverted vs the PR descriptionDescription says: when Current patch: env("OPENAI_BASE_URL")
.or_else(|| env("OPENAI_COMPAT_BASE_URL")
.unwrap_or_else(|| "https://api.openai.com/v1".into()),That prefers Suggested: env("OPENAI_COMPAT_BASE_URL")
.or_else(|| env("OPENAI_BASE_URL"))
.unwrap_or_else(|| "https://api.openai.com/v1".into()),Testing gapNo unit test pins the two-env matrix (compat set / base only / neither). Worth a small Scope noteIssue title mentions Agent defaults (Desktop). Env fallback still helps if defaults export I can open a tiny residual PR with corrected precedence + tests if you want — won’t stomp if you push a fix here first. |
|
Follow-up residual with corrected precedence + unit tests: #3773 — happy to close it if you flip the |
Summary
When
BUZZ_AGENT_PROVIDERis set to an OpenAI-compatible provider butOPENAI_COMPAT_BASE_URLis not explicitly set, the agent should fall back to the value ofOPENAI_BASE_URLbefore using the defaulthttps://api.openai.com/v1. This matches user expectations when migrating from other tools that useOPENAI_BASE_URLas the standard env var.Fixes #3630
Changes
config.rs, thefrom_env()OpenAI base URL resolution now checksOPENAI_BASE_URLas a fallback whenOPENAI_COMPAT_BASE_URLis unset, before falling through tohttps://api.openai.com/v1.Testing
Existing tests pass — this is a pure backward-compatible fallback addition.