fix(desktop): launch Databricks OAuth from passive model discovery - #5607
Open
wpfleger96 wants to merge 2 commits into
Open
fix(desktop): launch Databricks OAuth from passive model discovery#5607wpfleger96 wants to merge 2 commits into
wpfleger96 wants to merge 2 commits into
Conversation
When a buzz-agent runtime has no cached Databricks token, passive model-discovery surfaces were forbidden from launching interactive auth, so discovery failed silently and the dropdown showed only fallback models behind a vague "could not load live models" note. Both discovery surfaces now launch the browser OAuth flow (goose-parity). The only behavioral difference is a per-host cooldown: passive draft discovery fires on every form keystroke, so a failed, cancelled, or timed-out sign-in records a 5-minute cooldown that suppresses re-popping the browser; the explicit model picker always launches and clears the cooldown. A 150s hard timeout keeps an abandoned SSO tab from wedging the dropdown. The frontend maps the terminal sign-in states to typed, actionable guidance instead of raw error text. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
…nsparent-auth * origin/main: feat(tracing): add PostgreSQL tracing spans (#3678) Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
kalvinnchau
approved these changes
Aug 12, 2026
kalvinnchau
left a comment
Contributor
There was a problem hiding this comment.
Reviewed at 57a5d4b42130cf31921256c60f3763f829ff3597 against 397796c5f343db4251198f44505b1afebe88223f.
No blocking findings. I traced passive draft/form discovery, the saved-agent model picker, runtime inference, cache and refresh failure states, static-token precedence, concurrency, cancellation/timeout, cooldown behavior, and the OSS/internal release configuration split. The remaining trailing-slash cooldown-key normalization is nonblocking.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a user's agent runtime is
buzz-agentwith no cached Databricks OAuth token, the desktop app's passive model-discovery surfaces were forbidden from launching interactive auth. Discovery failed silently, so the model dropdown showed only built-in fallback models behind a vague "Could not load live models fordatabricks_v2" note (reported internally by Nick and Jose).What changed
Both discovery surfaces — the passive draft-form discovery and the explicit saved-model picker — now launch the browser OAuth flow, matching goose's behavior. The only behavioral difference between them is cooldown handling:
Safety rails:
AUTH_FLOW_TIMEOUT) bounds the whole interactive flow so an abandoned SSO tab fails discovery cleanly rather than wedging the dropdown. Success clears the cooldown; failure and timeout both record it.AuthCooldownrecovers from a poisoned lock rather than wedging every future sign-in on one panic.The frontend maps the terminal Databricks sign-in states to typed, actionable copy in
formatModelDiscoveryErrorStatus: "sign-in required" is a muted note pointing at the picker andbuzz-agent auth databricks; a failed or timed-out sign-in is a warning pointing at the explicit retry. Other Databricks failures fall through to the existing generic notice.Scope
Changes are confined to Databricks discovery and its frontend status formatter — no
agent_models.rscall sites are touched. The interactive-auth helper takes an injected timeout so the timeout/cooldown policy is unit-testable without a live browser.Deferred
Cooldown keys use the raw trimmed
DATABRICKS_HOST, while the catalog and OAuth cache normalize trailing slashes (crates/buzz-agent/src/catalog.rs:96,crates/buzz-agent/src/llm.rs:2046). Sohttps://workspace/andhttps://workspaceshare credentials but get separate cooldown entries — an equivalent-spelling change to the host field mid-cooldown can re-pop passive OAuth once within the 5-minute window. Self-limiting (one extra browser launch, never auth corruption). Follow-up: atrim_end_matches('/')on the cooldown key plus an equivalent-host test, picked up with the coordinator migration if #5545 ever merges.