Repository navigation
[ML-70351] [l] Resolve one profile across CLI and local agent - #694
Open
elainewang-db wants to merge 19 commits into
Open
elainewang-db wants to merge 19 commits into
elainewang-db wants to merge 19 commits into
Conversation
elainewang-db
force-pushed
the
ml-70351-profile-resolution
branch
21 times, most recently
from
October 13, 2026 00:31
19b4d91 to
13efa11
Compare
elainewang-db
force-pushed
the
ml-70351-profile-resolution
branch
2 times, most recently
from
October 13, 2026 17:02
ae65708 to
4e5e859
Compare
shivam5
reviewed
Oct 13, 2026
shivam5
left a comment
Contributor
There was a problem hiding this comment.
agentbricks profile login --profile - this might sound weird
We could do what databricks cli does:
agentbricks auth describe/login/logout/profiles/switch
Can we quickly ask others for opinion on the rename in the channel?
elainewang-db
force-pushed
the
ml-70351-profile-resolution
branch
4 times, most recently
from
October 13, 2026 20:48
1b635b8 to
6d359c2
Compare
This was referenced Oct 15, 2026
elainewang-db
force-pushed
the
ml-70351-profile-resolution
branch
from
October 15, 2026 17:33
d4ad79e to
664bac7
Compare
…ce per command Co-authored-by: Isaac <no-reply@databricks.com>
…lution # Conflicts: # integrations/agentbricks/src/databricks_agentbricks/cli/app.py # integrations/agentbricks/src/databricks_agentbricks/services/dev_service.py # integrations/agentbricks/tests/functional/cli_smoke_test.py # integrations/agentbricks/tests/unit_tests/dev_test.py
…lution # Conflicts: # integrations/agentbricks/src/databricks_agentbricks/cli/dev.py # integrations/agentbricks/src/databricks_agentbricks/cli/init.py # integrations/agentbricks/src/databricks_agentbricks/cli/tracing.py # integrations/agentbricks/src/databricks_agentbricks/services/dev_service.py # integrations/agentbricks/tests/unit_tests/dev_test.py
…change Co-authored-by: Isaac <no-reply@databricks.com>
…i/auth.py Co-authored-by: Isaac <no-reply@databricks.com>
…lution # Conflicts: # integrations/agentbricks/cli.md # integrations/agentbricks/src/databricks_agentbricks/cli/deploy.py # integrations/agentbricks/src/databricks_agentbricks/cli/init.py # integrations/agentbricks/src/databricks_agentbricks/clients/apps_client.py # integrations/agentbricks/src/databricks_agentbricks/clients/databricks_cli.py
Co-authored-by: Isaac <no-reply@databricks.com>
…lution # Conflicts: # integrations/agentbricks/src/databricks_agentbricks/cli/deploy.py # integrations/agentbricks/src/databricks_agentbricks/clients/apps_client.py # integrations/agentbricks/src/databricks_agentbricks/presentation/deploy.py # integrations/agentbricks/src/databricks_agentbricks/services/dev_service.py
shivam5
reviewed
Oct 26, 2026
shivam5
reviewed
Oct 26, 2026
shivam5
reviewed
Oct 26, 2026
…lution # Conflicts: # integrations/agentbricks/tests/unit_tests/models_cli_test.py
…as unreachable, and rewrite interpolated profiles on switch Co-authored-by: Isaac <no-reply@databricks.com>
…lution # Conflicts: # integrations/agentbricks/src/databricks_agentbricks/cli/app.py # integrations/agentbricks/src/databricks_agentbricks/cli/deploy.py
Resolve conflicts with databricks#785, databricks#809, databricks#812 and databricks#818: - cli/dev.py: announce the agent's profile, then databricks#812's "starting" line; the success panel still waits for the agent (on_ready). - clients/databricks_cli.py, presentation/dev.py: keep both sides (run_databricks_login and _run_until_ready; announce_agent_profile and announce_starting). - cli/endpoint.py: keep the workspace notice under databricks#785's renamed build_endpoint_service, and give `endpoint loadtest <app>` the same notice. - cli/app.py, cli.md: take databricks#818's --profile help. - cli/auth.py, presentation/help.py, cli.md: keep this branch's `auth login`/`auth switch`; drop databricks#818's edits to the removed `login`/`logout`. - tests/functional: accept databricks#809's deletion. - tests/unit_tests/cli_test.py: keep both assertions. Co-authored-by: Isaac <no-reply@databricks.com>
This branch has not been deployed
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.
Agent Bricks commands and the local agent could use different Databricks profiles, and unauthenticated workspace commands could hang on browser consent. This PR resolves one profile per project command, passes it to the local agent, and checks authentication before
devordeploystarts work. Addresses ML-70351.Behavior
-p, then the project's.env(the--sourceproject's when given), thenDATABRICKS_CONFIG_PROFILE, then SDK default authentication. Exported SDK credential variables keep their SDK precedence..envwith python-dotenv, the same parser the agent uses, so both see the same profile.initpins a profile in.envunless environment authentication is in use.auth switchchanges the project's profile,auth describereports it, andauth loginsigns in. With no profile,auth loginhands off todatabricks auth login's picker. The oldloginandlogoutcommands point to these.devanddeployfail fast with anauth loginhint when the profile is unknown, signed out, or set toexternal-browser. They never open a browser.Code layout
projects/profiles.py: profile resolution and~/.databrickscfglookups.projects/env_file.py: reads.envwith dotenv and rewrites the profile line atomically.services/workspace_auth.py: auth checks with a time limit, and error classification.clients/databricks_cli.py: runsdatabricks auth login.cli/auth.py: theauthcommands.cli/app.py: chooses the profile per command, and the removed-command pointers.presentation/profile.py: workspace notices and profile warnings.Reading order
projects/profiles.py, thenprojects/env_file.py,services/workspace_auth.py,cli/app.py(CliContext.select_profile) andcli/auth.py, thencli/init.py,cli/dev.pyandcli/deploy.py. Docs last.Testing
.envparsing and rewriting, auth-check classification, and theauthcommands. Unit suite: 2331 passed. Functional smoke tests: 53 passed.3786c31:tests/functional/dev_runtime_test.pypassed 6/6. Fresh LangGraph and OpenAI projects booted and answered an invocation across the built-in server (with and without chat UI) and custom server, using a fake model-serving endpoint.initpinned an explicit or SDK-default profile; environment credentials left.envabsent;auth describereported the selected workspace; trailing-poverrode it;auth switchpersisted the new profile; anddevrejected anexternal-browserprofile before agent startup with a login hint.mlande2-dogfoodbefore the latest changes:devserved HTTP 200.initsign-in worked.initwith token-only environment auth wrote no.env.Reusing cached external-browser credentials (by @jamesbxwu) moves to a follow-up PR after this merges.
This pull request and its description were written by Isaac.