Skip to content

[agentbricks] Don't treat a failed app lookup as a missing app - #725

Merged
elainewang-db merged 1 commit into
databricks:mainfrom
elainewang-db:agentbricks-standalone-auth-fixes
Oct 13, 2026
Merged

elainewang-db merged 1 commit into
databricks:mainfrom
elainewang-db:agentbricks-standalone-auth-fixes

Conversation

@elainewang-db

@elainewang-db elainewang-db commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

deploy no longer mistakes a failed app lookup for a missing app.

AppsClient.exists used to treat any non-zero databricks apps get as "the app doesn't exist", so a bad token or a network error could steer deploy into an app create. Now it returns False only on an explicit "does not exist"; any other failure raises Could not check whether deployment '<name>' exists., with the CLI's error plus the next step as the hint: run agentbricks login --profile <profile> if the profile isn't signed in, otherwise check the network and the profile's host.

The two exists() callers are both deploy paths (app ensure, and picking the default name); deployments delete/start/stop/logs don't use it.

E2E testing

Against staging e2-dogfood; no workspace resources created.

Scenario Result
-p bad deploy (invalid PAT, custom-server project) → fails in 1.5s with Could not check whether deployment 'agent-bricks-…' exists. and the CLI's Invalid access token error; no app create attempted ✅
A truly missing app → databricks apps get stderr contains does not exist; AppsClient.exists returns False ✅

The added login/network line in the hint is covered by the unit test, not re-run live.

Unit tests (all extras): 1774 passed, 12 skipped. CI lint (ruff format --check, ruff check, ty check) clean.

This pull request and its description were written by Isaac.

@elainewang-db
elainewang-db force-pushed the agentbricks-standalone-auth-fixes branch from a267f35 to 7aa7bd1 Compare October 13, 2026 17:03
@elainewang-db
elainewang-db requested a review from shivam5 October 13, 2026 17:10

@shivam5 shivam5 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On error, can we also return the action that needs to be done.
i.e., agentbricks login?

Approving to unblock

Co-authored-by: Isaac <no-reply@databricks.com>
@elainewang-db
elainewang-db force-pushed the agentbricks-standalone-auth-fixes branch from 7aa7bd1 to b58d2d5 Compare October 13, 2026 17:53
@elainewang-db elainewang-db changed the title [agentbricks] Fail fast on agent auth and on failed app lookups [agentbricks] Don't treat a failed app lookup as a missing app Oct 13, 2026
@elainewang-db
elainewang-db enabled auto-merge (squash) October 13, 2026 17:58
@elainewang-db
elainewang-db merged commit 0783f64 into databricks:main Oct 13, 2026
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants