Repository navigation
aitools: auto-install requires explicit or inferred consent #8135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| * The automatic installation of Databricks AI tools now runs only after explicit consent or when an existing CLI-managed global installation is found. Explicit consent is `databricks aitools auto-install enable`, a global `databricks aitools install`, or a "yes" to the skills prompt of `databricks apps init`. If you ran `databricks aitools auto-install enable` with an earlier CLI version and have no global installation that the CLI made, run it again: before, it only undid `disable` and did not record an agreement. With such an installation, the CLI infers the consent automatically. It no longer asks anything after a command, and its notice now also names `databricks aitools uninstall`. ([#8135](https://github.com/databricks/cli/pull/8135)) |
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Cloud = false |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
|
|
||
| === the user never answered: nothing installed, written or reported, the gate is not looked up, and the agent gets the install hint | ||
|
|
||
| >>> CLAUDECODE=1 [CLI] jobs list --log-file LOG.no-consent --log-level debug | ||
| Databricks skills are not installed. To work with Databricks reliably, first run: databricks aitools install | ||
|
|
||
| >>> print_telemetry | ||
| {"command":"jobs_list","exit_code":0,"aitools_hint_event":{"hint_kind":"INSTALL_TEXT"}} | ||
|
|
||
| >>> cursor_skills | ||
| (no skills) | ||
|
|
||
| >>> auto_install_state | ||
| {"id": "treatment-machine"} | ||
|
|
||
| === the user agrees: the next command of the same version installs | ||
|
|
||
| >>> [CLI] aitools auto-install enable | ||
| Automatic installation of Databricks AI tools is enabled. | ||
|
|
||
| >>> CLAUDECODE=1 [CLI] jobs list --log-file LOG.consent --log-level debug | ||
| Installed Databricks AI tools for Claude Code, Cursor. Turn off: databricks aitools auto-install disable. Remove: databricks aitools uninstall | ||
|
|
||
| >>> print_telemetry | ||
| {"command":"jobs_list","exit_code":0,"aitools_install_event":{"agents":["CLAUDE_CODE","CURSOR"],"scope":"GLOBAL","error_category":"TYPE_UNSPECIFIED","agent_results":[{"agent":"CLAUDE_CODE","error_category":"CLI_NOT_ON_PATH"}],"trigger":"AUTO_FIRST_RUN"}} | ||
| {"command":"jobs_list","exit_code":0,"aitools_auto_install_event":{"outcome":"INSTALLED","holdout_arm":"TREATMENT","interactive":false}} | ||
|
|
||
| >>> cursor_skills | ||
| databricks-test | ||
|
|
||
| >>> auto_install_state | ||
| { | ||
| "last_version": "1.30.0", | ||
| "consented": true, | ||
| "id": "treatment-machine" | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Claude Code calls the CLI on a machine whose user never agreed to | ||
| # auto-install. Its config dir exists and its CLI is not on PATH, so an install | ||
| # would give it skill files. | ||
| unset CLAUDE_CODE_SESSION_ID CLAUDE_CODE_CHILD_SESSION | ||
| use_home home | ||
| "$mkdir_bin" -p "${USERPROFILE:-$HOME}/.claude" | ||
| # use_home wrote the state file by hand: a write by the CLI would indent it. | ||
| gate true | ||
|
|
||
| title "the user never answered: nothing installed, written or reported, the gate is not looked up, and the agent gets the install hint" | ||
| trace CLAUDECODE=1 $CLI jobs list --log-file LOG.no-consent --log-level debug | ||
| # The gate lookup would read the compatibility manifest from the cache. | ||
| contains.py "auto-install: skipped: no_consent" "!Using cached manifest" < LOG.no-consent > LOG.no-consent-checked | ||
| trace print_telemetry | ||
| trace cursor_skills | ||
| trace auto_install_state | ||
|
|
||
| title "the user agrees: the next command of the same version installs" | ||
| trace $CLI aitools auto-install enable | ||
| trace CLAUDECODE=1 $CLI jobs list --log-file LOG.consent --log-level debug | ||
| contains.py "Using cached manifest" < LOG.consent > LOG.consent-checked | ||
| trace print_telemetry | ||
| trace cursor_skills | ||
| trace auto_install_state |
31 changes: 18 additions & 13 deletions
31
acceptance/cmd/aitools/auto-install/no-terminal/output.txt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,31 +1,36 @@ | ||
|
|
||
| === no terminal and no coding agent: cannot ask, so nothing is installed or reported, and the version is not settled | ||
| >>> [CLI] aitools auto-install enable | ||
| Automatic installation of Databricks AI tools is enabled. | ||
|
|
||
| === no terminal and no coding agent: installs without asking | ||
|
|
||
| >>> [CLI] jobs list | ||
| Installed Databricks AI tools for Cursor. Turn off: databricks aitools auto-install disable. Remove: databricks aitools uninstall | ||
|
|
||
| >>> print_telemetry | ||
| {"command":"jobs_list","exit_code":0,"aitools_install_event":{"agents":["CURSOR"],"scope":"GLOBAL","error_category":"TYPE_UNSPECIFIED","trigger":"AUTO_FIRST_RUN"}} | ||
| {"command":"jobs_list","exit_code":0,"aitools_auto_install_event":{"outcome":"INSTALLED","holdout_arm":"TREATMENT","interactive":false}} | ||
|
|
||
| >>> cursor_skills | ||
| (no skills) | ||
| databricks-test | ||
|
|
||
| >>> auto_install_state | ||
| {"id": "treatment-machine"} | ||
| { | ||
| "last_version": "1.30.0", | ||
| "consented": true, | ||
| "id": "treatment-machine" | ||
| } | ||
|
|
||
| === the version is still due: a coding agent's call installs without asking | ||
| === a coding agent's call on the next version: the update runs without asking | ||
|
|
||
| >>> AGENT=test-agent [CLI] jobs list | ||
| Installed Databricks AI tools for Cursor. Disable: databricks aitools auto-install disable | ||
| >>> AGENT=test-agent DATABRICKS_AITOOLS_AUTO_INSTALL_CLI_VERSION=1.31.0 [CLI] jobs list | ||
|
|
||
| >>> print_telemetry | ||
| {"command":"jobs_list","exit_code":0,"aitools_install_event":{"agents":["CURSOR"],"scope":"GLOBAL","error_category":"TYPE_UNSPECIFIED","trigger":"AUTO_FIRST_RUN"}} | ||
| {"command":"jobs_list","exit_code":0,"aitools_auto_install_event":{"outcome":"INSTALLED","holdout_arm":"TREATMENT","interactive":false}} | ||
|
|
||
| >>> cursor_skills | ||
| databricks-test | ||
| {"command":"jobs_list","exit_code":0,"aitools_auto_install_event":{"outcome":"UP_TO_DATE","holdout_arm":"TREATMENT","interactive":false}} | ||
|
|
||
| >>> auto_install_state | ||
| { | ||
| "last_version": "1.30.0", | ||
| "installed_without_consent": true, | ||
| "last_version": "1.31.0", | ||
| "consented": true, | ||
| "id": "treatment-machine" | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,14 @@ | ||
| use_home home | ||
| gate true | ||
| unset AGENT | ||
| trace $CLI aitools auto-install enable | ||
|
|
||
| title "no terminal and no coding agent: cannot ask, so nothing is installed or reported, and the version is not settled" | ||
| title "no terminal and no coding agent: installs without asking" | ||
| trace $CLI jobs list | ||
| trace print_telemetry | ||
| trace cursor_skills | ||
| trace auto_install_state | ||
|
|
||
| title "the version is still due: a coding agent's call installs without asking" | ||
| trace AGENT=test-agent $CLI jobs list | ||
| title "a coding agent's call on the next version: the update runs without asking" | ||
| trace AGENT=test-agent DATABRICKS_AITOOLS_AUTO_INSTALL_CLI_VERSION=1.31.0 $CLI jobs list | ||
| trace print_telemetry | ||
| trace cursor_skills | ||
| trace auto_install_state |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nice to have]
use_home hand-placed-homeanduse_home own-skill-homestart with no consent, and the script never runsauto-install enablefor them, so both runs now stop atno_consent. The regenerated golden accepted that: noKEPToutcome,settled_versionis{}, and the own-skill case (lines 66-71) prints no notice and installs nodatabricks-test. The titles still say "kept … not retried" and "installs", and the hand-placed refusal has no acceptance coverage left. Can you addtrace $CLI aitools auto-install enableafter each of thoseuse_homecalls, asagent-hintandskippeddo, and regenerate?