Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

fix(backends): clear Claude relay base_url when saving auth_mode='oauth'

cyh5d662d024c00
diff --git a/vibe/api.py b/vibe/api.py
index 890f16c10..8ff1da589 100644
--- a/vibe/api.py
+++ b/vibe/api.py
@@ -2925,7 +2925,18 @@ def save_claude_auth(payload: dict) -> dict:
config.agents.claude.api_key = api_key if auth_mode == "api_key" else None
if base_url_present:
config.agents.claude.base_url = base_url_change
- # else: keep whatever is already stored (omitted payload key).
+ elif auth_mode == "oauth":
+ # Switching to OAuth: drop any stored relay base_url even when
+ # the UI omitted the field (the OAuth tab hides it). Without
+ # this, ``build_claude_subprocess_env`` keeps exporting
+ # ``ANTHROPIC_BASE_URL`` on every launch, so OAuth traffic
+ # gets routed through the api-key-only relay and is rejected
+ # with 401 — same root pattern as the Codex relay-pointer fix
+ # in ``apply_codex_auth`` (commit 28efd8b).
+ config.agents.claude.base_url = None
+ # else: keep whatever is already stored (omitted payload key) for
+ # the api_key branch — the user may be doing a key-only update
+ # against a previously-saved relay.
config.save()
# Claude is one-shot per request — no daemon to restart. Return a