Repository navigation
Conversation
## Changes `databricks aitools update` and `databricks aitools uninstall` now treat a coding agent caller as non-interactive, as `aitools install` already does. An agent is detected through the SDK's agent environment variables (for example `CLAUDECODE` or `CODEX_CI`). ```diff update / uninstall, skills in both global and project scopes, no --scope - if !cmdio.IsPromptSupported(ctx) -> --scope error, else scope picker + if !promptsSupported(ctx) -> note on a terminal, then --scope error + else scope picker uninstall, something to remove - if cmdio.IsPromptSupported(ctx) -> "Proceed?" confirm + if promptsSupported(ctx) -> "Proceed?" confirm + else -> note on a terminal, then proceed ``` - `installPromptsSupported` is renamed to `promptsSupported`, since it now covers install, update, uninstall and `mcp add` / `mcp remove`. Its behavior is unchanged: prompts are supported only on a terminal and only when no coding agent is detected. - When a prompt is skipped on a terminal because an agent was detected, the command prints `No prompts shown because a coding agent (<agent>) was detected.` A person working in a shell that inherited an agent env var then knows why the expected prompt is missing. Without a terminal nothing is printed. Install's existing note now starts with the same sentence. - The command funnel's `interactive` field for update and uninstall now comes from `promptsSupported`, so it reports `false` for agent callers. That matches what install already reports. ## Why Agents often run commands in a pseudo-terminal (Cursor, or Copilot in the VS Code terminal). In a pseudo-terminal stdin looks like a TTY, but nobody is there to answer a TUI prompt. Install already handles this case. Update and uninstall still showed the scope picker and the "Proceed?" confirm, so an agent run could hang. With this change an agent gets the same behavior as a run without a terminal: when skills are in both scopes it fails fast and asks for `--scope`, and uninstall goes ahead without confirming. ## Tests - New unit tests in `cmd/aitools/scope_test.go` set up an agent caller on a prompt-capable terminal with skills in both scopes. They check that the update and uninstall scope pickers are never shown, that the `--scope` error comes back with the invalid-flags category, and that the note is printed. - New `TestUninstallAgentCallerIsNotAskedToConfirm` in `cmd/aitools/funnel_test.go`: an agent caller on a terminal uninstalls without seeing "Proceed?", the note is printed, and the funnel records the run as non-interactive. - The existing interactive scope tests now clear agent env vars, so their result no longer depends on the shell they run in. - Changelog fragment added under `.nextchanges/cli/`. Co-authored-by: Isaac <no-reply@databricks.com>
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.
Changes
databricks aitools updateanddatabricks aitools uninstallnow treat a coding agent caller as non-interactive, asaitools installalready does. An agent is detected through the SDK's agent environment variables (for exampleCLAUDECODEorCODEX_CI).installPromptsSupportedis renamed topromptsSupported, since it now covers install, update, uninstall andmcp add/mcp remove. Its behavior is unchanged: prompts are supported only on a terminal and only when no coding agent is detected.No prompts shown because a coding agent (<agent>) was detected.A person working in a shell that inherited an agent env var then knows why the expected prompt is missing. Without a terminal nothing is printed. Install's existing note now starts with the same sentence.interactivefield for update and uninstall now comes frompromptsSupported, so it reportsfalsefor agent callers. That matches what install already reports.Why
Agents often run commands in a pseudo-terminal (Cursor, or Copilot in the VS Code terminal). In a pseudo-terminal stdin looks like a TTY, but nobody is there to answer a TUI prompt. Install already handles this case. Update and uninstall still showed the scope picker and the "Proceed?" confirm, so an agent run could hang. With this change an agent gets the same behavior as a run without a terminal: when skills are in both scopes it fails fast and asks for
--scope, and uninstall goes ahead without confirming.Tests
cmd/aitools/scope_test.goset up an agent caller on a prompt-capable terminal with skills in both scopes. They check that the update and uninstall scope pickers are never shown, that the--scopeerror comes back with the invalid-flags category, and that the note is printed.TestUninstallAgentCallerIsNotAskedToConfirmincmd/aitools/funnel_test.go: an agent caller on a terminal uninstalls without seeing "Proceed?", the note is printed, and the funnel records the run as non-interactive..nextchanges/cli/.