Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/ucode/gateway_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,13 @@ def _handle(self) -> None:
# instead of surfacing to Claude Code as a spurious Anthropic prompt.
try:
self.cache.refresh()
except RuntimeError:
pass # refresh failed; retry with the existing token and relay whatever comes
except RuntimeError as exc:
# Refresh failed: the Databricks OAuth session is dead (not just the
# access token) and can't be re-minted non-interactively. Surface the
# `databricks auth login` hint rather than silently relaying a bare 401,
# which otherwise reads as an Anthropic `/login` prompt and sends the
# user to the wrong re-auth. Still retry + relay with the existing token.
_log_refresh_failure(exc)
headers = _forwarded_request_headers(self, self.cache.token)
with self.client.stream(self.command, url, headers=headers, content=body) as resp:
_diagnostic_log(
Expand Down
Loading