Skip to content

aitools install: cancel the agent picker on Esc - #7721

Merged
simonfaltum merged 4 commits into
mainfrom
aitools-install-esc
Nov 19, 2026
Merged

simonfaltum merged 4 commits into
mainfrom
aitools-install-esc

Conversation

@simonfaltum

Copy link
Copy Markdown
Member

Changes

Esc now cancels the aitools install agent picker, the same way Ctrl+C does: the run ends with Error: user aborted and exit code 1. Before, Esc did nothing, so only Ctrl+C left the picker.

  • Esc cancels the agent picker. Ctrl+C behaves as before.
  • While the picker is searching, the first Esc leaves the search, as before. Only a later Esc cancels.
  • The help line reads space to toggle, enter to install, esc to cancel. Its "enter to install" was already right, since install runs the plan straight after the picker.

Why

Esc is the key people reach for to back out of a terminal prompt, and the picker gave no hint that only Ctrl+C would work.

Decisions to review

  • Esc cancels when a search filter is applied but the picker is no longer searching. huh would clear the filter on Esc in that state. Esc stays a cancel so that it behaves the same whenever the picker is not searching.
  • The help line says esc to cancel during search too, where Esc leaves the search first. The help text is not switched during search.

Tests

  • TestAgentPickerEscCancelsLikeCtrlC covers Esc and Ctrl+C reaching the same cancel result, and the help line.
  • TestAgentPickerEscLeavesSearchBeforeCancelling covers the first Esc leaving the search.
  • TestPickerError covers mapping a cancel to huh.ErrUserAborted.
  • Checked in a terminal: Esc and Ctrl+C both print Error: user aborted and exit 1.
  • go test ./cmd/aitools/..., go test ./acceptance -run TestAccept/cmd/aitools, and GOOS=windows go vet ./cmd/aitools/... pass.

This pull request and its description were written by Isaac.

simonfaltum and others added 2 commits November 17, 2026 11:42
Esc did nothing in the agent picker, so only Ctrl+C left it. Esc now
cancels the picker as Ctrl+C does, and the run ends with the same
"user aborted" error. While the picker searches, the first Esc only
leaves the search.

The help line now says how to cancel. Enter installs the selected
agents, since install runs the plan straight after the picker.

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
@github-actions github-actions Bot added the aitools AI tools (databricks aitools) related changes label Nov 17, 2026
@simonfaltum
simonfaltum marked this pull request as ready for review November 18, 2026 16:21
@simonfaltum
simonfaltum requested review from a team and lennartkats-db as code owners November 18, 2026 16:21

@review-oss-bot review-oss-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good to me — no issues found.

@anton-107 anton-107 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.

Requesting changes for one blocker, posted inline: the picker now renders to stdout instead of stderr.

Non-blocking: Esc leaves the picker on screen, while Ctrl+C clears it. huh's Form.View returns "" only after the form sets quitting itself, and the wrapper quits without setting it. After Esc the final View() is 249 bytes; after Ctrl+C it is 0. If pickerModel.View returned "" when p.cancelled is set, both keys would leave the same screen.

Comment thread cmd/aitools/install.go Resolved
Co-authored-by: Isaac <no-reply@databricks.com>
@simonfaltum

Copy link
Copy Markdown
Member Author

The Esc note is in b137472 too: pickerModel.View returns "" once Esc cancelled the picker, so Esc and Ctrl+C leave the same screen. TestAgentPickerEscCancelsLikeCtrlC checks it.

@anton-107 anton-107 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.

Approving. The stdout blocker is fixed. In a real terminal, databricks aitools install --scope=global > install.log shows the picker, and install.log stays at 0 bytes after both Esc and Ctrl+C. The program options now match huh's NewForm defaults, and go test ./cmd/aitools passes.

Non-blocking, and a correction to my round-1 note: Ctrl+C doesn't clear the picker either. I measured View(), not the screen. huh cancels with tea.Interrupt, which bubbletea treats as a kill, so it skips the final empty frame (bubbletea v1.3.10 tea.go:722-743). The picker stayed on screen after Ctrl+C in 4 of 4 runs, the same as on main. Esc now clears it in 3 of 3. That makes the new View comment ("both keys leave the same screen") inaccurate. Either reword it, or make Ctrl+C quit with tea.Quit as well (form.CancelCmd = tea.Quit plus a form.State == huh.StateAborted check) if you want the two keys to match.

Co-authored-by: Isaac <no-reply@databricks.com>
@simonfaltum

Copy link
Copy Markdown
Member Author

Thanks for measuring it on screen. I reworded the comment in 6958a6d: Esc leaves no picker on screen, and Ctrl+C interrupts the program, which keeps the last frame, as huh's Run does. I kept Ctrl+C on huh's interrupt path, so it still behaves as it does on main.

@simonfaltum
simonfaltum added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit 83ed6fa Nov 19, 2026
24 checks passed
@simonfaltum
simonfaltum deleted the aitools-install-esc branch November 19, 2026 10:08
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

❌ Integration test report

Commit: 83ed6fa

Run: 44502916181

Env 💥​PANIC ❌​FAIL 🟨​KNOWN 🤯​MISS 🔄​flaky 💚​RECOVERED ✅​pass 🙈​skip Time
❌​ aws linux-2core-8gb 3 1 2 24 1616 1389 302:43
💥​ aws-windows-latest-4core-16gb 1 3 104 26 1430 1415 320:03
❌​ azure linux-2core-8gb 2 1 26 1597 1397 255:50
💥​ azure-windows-latest-4core-16gb 1 2 3 88 18 1432 1423 320:03
💥​ gcp linux-2core-8gb 1 2 53 26 1553 1393 320:00
💥​ gcp-windows-latest-4core-16gb 1 153 26 1371 1421 320:04
300 interesting tests: 271 MISS, 18 RECOVERED, 4 KNOWN, 4 PANIC, 3 FAIL
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
🟨​ TestAccept 🟨​K 🤯​M 🟨​K 🤯​M 🤯​M 🤯​M
🤯​ TestAccept/bundle/apps/job_permissions ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/apps/job_permissions/DMS= ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/apps/job_permissions/DMS=true ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/artifacts/artifact_path_with_volume/volume_doesnot_exist ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/artifacts/artifact_path_with_volume/volume_doesnot_exist/DMS= ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/artifacts/artifact_path_with_volume/volume_doesnot_exist/DMS=true ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/artifacts/artifact_path_with_volume/volume_not_deployed ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/artifacts/artifact_path_with_volume/volume_not_deployed/DMS= ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/artifacts/artifact_path_with_volume/volume_not_deployed/DMS=true ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/debug/fetch-repository-info ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/debug/fetch-repository-info/DMS= ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/debug/fetch-repository-info/DMS=true ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/empty-bundle ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/empty-bundle/DATABRICKS_BUNDLE_ENABLE_EXPERIMENTAL_YAML_SYNC=/DMS= ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/empty-bundle/DATABRICKS_BUNDLE_ENABLE_EXPERIMENTAL_YAML_SYNC=/DMS=true ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/empty-bundle/DATABRICKS_BUNDLE_ENABLE_EXPERIMENTAL_YAML_SYNC=true/DMS= ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/empty-bundle/DATABRICKS_BUNDLE_ENABLE_EXPERIMENTAL_YAML_SYNC=true/DMS=true ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/files/no-snapshot-sync ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/files/no-snapshot-sync/DMS= ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/files/no-snapshot-sync/DMS=true ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/immutable/basic ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/immutable/basic/DMS= ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/immutable/breakglass ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/immutable/breakglass/DMS= ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/immutable/can-manage ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/immutable/can-manage/DMS= ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/immutable/destroy-redeploy ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/immutable/destroy-redeploy/DMS= ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/immutable/dev-mode ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/immutable/dev-mode/DMS= ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/immutable/legacy-state ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/immutable/legacy-state/DMS= ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/immutable/missing-snapshot ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/immutable/missing-snapshot/DMS= ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/immutable/no-artifacts ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/immutable/no-artifacts/DMS=/READPLAN= ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/immutable/no-artifacts/DMS=/READPLAN=1 ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/immutable/permissions-change ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/immutable/permissions-change/DMS= ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/immutable/select ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/immutable/select/DMS= ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/mlops-stacks ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/mlops-stacks/DMS= ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p
🤯​ TestAccept/bundle/deploy/mlops-stacks/DMS=true ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/spark-jar-task ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/spark-jar-task/DMS= ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deploy/spark-jar-task/DMS=true ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🟨​ TestAccept/bundle/deployment/bind/alert 💚​R 💚​R 💚​R 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/deployment/bind/alert/DMS= 💚​R 💚​R 💚​R 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/deployment/bind/alert/DMS=true 💚​R 💚​R 💚​R 🟨​K 💚​R 💚​R
🤯​ TestAccept/bundle/deployment/bind/catalog ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p
🤯​ TestAccept/bundle/deployment/bind/catalog/DMS= ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p
🤯​ TestAccept/bundle/deployment/bind/catalog/DMS=true ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p
🤯​ TestAccept/bundle/deployment/bind/cluster ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p
🤯​ TestAccept/bundle/deployment/bind/cluster/DMS= ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p
🤯​ TestAccept/bundle/deployment/bind/cluster/DMS=true ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p
🤯​ TestAccept/bundle/deployment/bind/dashboard ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p
🤯​ TestAccept/bundle/deployment/bind/dashboard/DMS=/READPLAN= ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p
🤯​ TestAccept/bundle/deployment/bind/dashboard/DMS=/READPLAN=1 ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p
🤯​ TestAccept/bundle/deployment/bind/dashboard/DMS=true/READPLAN= ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p
🤯​ TestAccept/bundle/deployment/bind/dashboard/DMS=true/READPLAN=1 ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p
🤯​ TestAccept/bundle/deployment/bind/dashboard/recreation ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p
🤯​ TestAccept/bundle/deployment/bind/dashboard/recreation/DMS=/READPLAN= ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p
🤯​ TestAccept/bundle/deployment/bind/dashboard/recreation/DMS=/READPLAN=1 ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p
🤯​ TestAccept/bundle/deployment/bind/dashboard/recreation/DMS=true/READPLAN= ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p
🤯​ TestAccept/bundle/deployment/bind/dashboard/recreation/DMS=true/READPLAN=1 ✅​p 🤯​M ✅​p ✅​p ✅​p ✅​p
🤯​ TestAccept/bundle/deployment/bind/experiment ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/experiment/DMS= ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/experiment/DMS=true ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/feature_spec ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/feature_spec/DMS= ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/feature_spec/DMS=true ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/job/generate-and-bind ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/job/generate-and-bind/DMS= ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/job/generate-and-bind/DMS=true ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/job/immutable ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/job/immutable/DMS= ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/job/job-abort-bind ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/job/job-abort-bind/DMS= ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/job/job-abort-bind/DMS=true ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/job/job-spark-python-task ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/job/job-spark-python-task/DMS= ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/job/job-spark-python-task/DMS=true ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/model-serving-endpoint ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
💥​ TestAccept/bundle/deployment/bind/model-serving-endpoint/DMS= ✅​p 💥​P ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/model-serving-endpoint/DMS=true ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/pipelines/recreate ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/pipelines/recreate/DMS= ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/pipelines/recreate/DMS=true ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/registered-model ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/registered-model/DMS= ✅​p 🤯​M ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/registered-model/DMS=true ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/schema ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/schema/DMS= ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/schema/DMS=true ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/secret-scope ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/secret-scope/DMS= ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/secret-scope/DMS=true ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/vector_search_endpoint ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/vector_search_endpoint/DMS= ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/vector_search_endpoint/DMS=true ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/volume ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/volume/DMS= ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/bind/volume/DMS=true ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/unbind/grants ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/unbind/grants/DMS= ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/unbind/grants/DMS=true ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/unbind/permissions ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/unbind/permissions/DMS= ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/deployment/unbind/permissions/DMS=true ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/destroy/jobs-and-pipeline ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/destroy/jobs-and-pipeline/DMS= ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/destroy/jobs-and-pipeline/DMS=true ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/destroy/root-path-name-target ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/destroy/root-path-name-target/DMS= ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/destroy/root-path-name-target/DMS=true ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/destroy/root-path-not-scoped ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
💥​ TestAccept/bundle/destroy/root-path-not-scoped/DMS= ✅​p ✅​p ✅​p ✅​p ✅​p 💥​P
🤯​ TestAccept/bundle/destroy/root-path-not-scoped/DMS=true ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/destroy/sibling-target ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
🤯​ TestAccept/bundle/destroy/sibling-target/DMS=true ✅​p ✅​p ✅​p ✅​p ✅​p 🤯​M
💚​ TestAccept/bundle/generate/alert 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/generate/alert/DMS= 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/generate/alert/DMS=true 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/alerts/basic 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/alerts/basic/DMS= 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/alerts/basic/DMS=true 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/alerts/with_file 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/alerts/with_file/DMS= 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/alerts/with_file/DMS=true 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
❌​ TestAccept/bundle/resources/apps/inline_config ❌​F ❌​F ❌​F ❌​F ❌​F ✅​p
❌​ TestAccept/bundle/resources/apps/inline_config/DMS= ❌​F ❌​F ❌​F ❌​F ❌​F ✅​p
❌​ TestAccept/bundle/resources/apps/inline_config/DMS=true ❌​F ❌​F ✅​p ✅​p ✅​p ✅​p
💚​ TestAccept/bundle/resources/apps/lifecycle-started 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/apps/lifecycle-started-omitted 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/apps/lifecycle-started-omitted/DMS= 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/apps/lifecycle-started-omitted/DMS=true 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/apps/lifecycle-started-toggle 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/apps/lifecycle-started-toggle/DMS= 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/apps/lifecycle-started-toggle/DMS=true 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/apps/lifecycle-started/DMS= 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/apps/lifecycle-started/DMS=true 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🤯​ TestAccept/bundle/resources/postgres_projects/update_keeps_children ✅​p ✅​p ✅​p 🤯​M ✅​p ✅​p
🤯​ TestAccept/bundle/resources/postgres_projects/update_keeps_children/DMS= ✅​p ✅​p ✅​p 🤯​M ✅​p ✅​p
🤯​ TestAccept/bundle/resources/postgres_projects/update_keeps_children/DMS=true ✅​p ✅​p ✅​p 🤯​M ✅​p ✅​p
🤯​ TestAccept/bundle/resources/postgres_projects/without_project_id ✅​p ✅​p ✅​p 🤯​M ✅​p ✅​p
🤯​ TestAccept/bundle/resources/postgres_projects/without_project_id/DMS= ✅​p ✅​p ✅​p 🤯​M ✅​p ✅​p
🤯​ TestAccept/bundle/resources/postgres_projects/without_project_id/DMS=true ✅​p ✅​p ✅​p 🤯​M ✅​p ✅​p
🤯​ TestAccept/bundle/resources/postgres_roles/basic ✅​p ✅​p ✅​p 🤯​M ✅​p ✅​p
🤯​ TestAccept/bundle/resources/postgres_roles/basic/DMS= ✅​p ✅​p ✅​p 🤯​M ✅​p ✅​p
🤯​ TestAccept/bundle/resources/postgres_roles/basic/DMS=true ✅​p ✅​p ✅​p 🤯​M ✅​p ✅​p
🤯​ TestAccept/bundle/resources/postgres_roles/recreate ✅​p ✅​p ✅​p 🤯​M ✅​p ✅​p
🤯​ TestAccept/bundle/resources/postgres_roles/recreate-postgres-role ✅​p ✅​p ✅​p 🤯​M ✅​p ✅​p
🤯​ TestAccept/bundle/resources/postgres_roles/recreate-postgres-role/DMS= ✅​p ✅​p ✅​p 🤯​M ✅​p ✅​p
Top 50 slowest tests (at least 2 minutes):
duration env testname
18:18 azure linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
14:57 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
13:05 aws linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=true
12:56 gcp linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
12:07 aws linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=
12:03 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
12:01 gcp linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=
11:58 aws-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
10:38 gcp linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
10:37 aws-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
10:01 gcp-windows-latest-4core-16gb TestAccept/bundle/invariant/delete_idempotent/DMS=/INPUT_CONFIG=cluster_apply_policy_default_values.yml.tmpl/READPLAN=
9:18 azure linux-2core-8gb TestAccept/bundle/config-remote-sync/multiple_resources/DMS=true
9:17 aws linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
9:06 azure-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
8:58 azure-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=true
8:56 gcp linux-2core-8gb TestAccept/bundle/templates/default-python/combinations/classic/DLT=no/DMS=/NBOOK=no/PY=yes/READPLAN=
8:53 gcp-windows-latest-4core-16gb TestAccept/bundle/invariant/delete_idempotent/DMS=/INPUT_CONFIG=job_apply_policy_default_values_task_cluster.yml.tmpl/READPLAN=1
8:53 gcp linux-2core-8gb TestAccept/bundle/templates/default-python/combinations/classic/DLT=yes/DMS=/NBOOK=yes/PY=no/READPLAN=1
8:52 azure-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
8:35 gcp linux-2core-8gb TestAccept/bundle/templates/default-python/combinations/classic/DLT=no/DMS=/NBOOK=yes/PY=yes/READPLAN=1
8:32 gcp-windows-latest-4core-16gb TestAccept/bundle/invariant/delete_idempotent/DMS=/INPUT_CONFIG=cluster_libraries.yml.tmpl/READPLAN=1
8:23 gcp-windows-latest-4core-16gb TestAccept/bundle/invariant/delete_idempotent/DMS=/INPUT_CONFIG=cluster_libraries.yml.tmpl/READPLAN=
8:22 azure linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
8:16 gcp linux-2core-8gb TestAccept/bundle/templates/default-python/combinations/classic/DLT=yes/DMS=/NBOOK=no/PY=no/READPLAN=1
8:16 aws linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
8:08 aws-windows-latest-4core-16gb TestAccept/bundle/invariant/no_drift/DMS=/INPUT_CONFIG=cluster.yml.tmpl/READPLAN=1
8:05 azure-windows-latest-4core-16gb TestAccept/bundle/templates/default-python/combinations/classic/DLT=no/DMS=/NBOOK=yes/PY=yes/READPLAN=1
8:03 aws linux-2core-8gb TestAccept/bundle/config-remote-sync/multiple_resources/DMS=
8:01 aws linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DMS=true
7:56 azure-windows-latest-4core-16gb TestAccept/bundle/templates/default-python/combinations/classic/DLT=no/DMS=/NBOOK=no/PY=yes/READPLAN=
7:55 aws-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DMS=
7:50 aws-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=
7:47 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=true
7:43 gcp-windows-latest-4core-16gb TestAccept/bundle/invariant/delete_idempotent/DMS=/INPUT_CONFIG=feature_spec.yml.tmpl/READPLAN=
7:41 aws-windows-latest-4core-16gb TestAccept/bundle/invariant/delete_idempotent/DMS=/INPUT_CONFIG=cluster_libraries.yml.tmpl/READPLAN=1
7:29 aws linux-2core-8gb TestAccept/bundle/config-remote-sync/multiple_resources/DMS=true
7:27 azure-windows-latest-4core-16gb TestAccept/bundle/resources/schemas/rename_then_change/DMS=
7:25 gcp linux-2core-8gb TestAccept/bundle/templates/default-python/combinations/classic/DLT=no/DMS=/NBOOK=yes/PY=no/READPLAN=
7:18 gcp-windows-latest-4core-16gb TestAccept/bundle/invariant/delete_idempotent/DMS=/INPUT_CONFIG=cluster.yml.tmpl/READPLAN=1
7:15 gcp-windows-latest-4core-16gb TestAccept/bundle/invariant/delete_idempotent/DMS=/INPUT_CONFIG=job_pydabs_1000_tasks.yml.tmpl/READPLAN=1
7:12 aws-windows-latest-4core-16gb TestAccept/bundle/invariant/no_drift/DMS=/INPUT_CONFIG=cluster_libraries.yml.tmpl/READPLAN=1
7:11 azure-windows-latest-4core-16gb TestAccept/bundle/invariant/destroy_idempotent/DMS=/INPUT_CONFIG=cluster_libraries.yml.tmpl/READPLAN=
7:09 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/deploy/local_ssd_count/DMS=
7:05 gcp linux-2core-8gb TestAccept/bundle/config-remote-sync/multiple_resources/DMS=true
7:02 azure-windows-latest-4core-16gb TestAccept/bundle/templates/default-python/integration_classic/DMS=/UV_PYTHON=3.9
7:01 aws-windows-latest-4core-16gb TestAccept/bundle/invariant/delete_idempotent/DMS=/INPUT_CONFIG=vector_search_index.yml.tmpl/READPLAN=1
7:00 gcp-windows-latest-4core-16gb TestAccept/bundle/invariant/delete_idempotent/DMS=/INPUT_CONFIG=app.yml.tmpl/READPLAN=1
6:57 gcp linux-2core-8gb TestAccept/bundle/invariant/destroy_idempotent/DMS=/INPUT_CONFIG=cluster.yml.tmpl/READPLAN=1
6:57 gcp linux-2core-8gb TestAccept/bundle/config-remote-sync/multiple_resources/DMS=
6:55 azure-windows-latest-4core-16gb TestAccept/bundle/deploy/spark-jar-task/DMS=true
(145 table rows omitted to keep the report under 60000 bytes)

idelafuente-oc pushed a commit to idelafuente-oc/cli that referenced this pull request Nov 20, 2026
This pull request is part of the stack that adds the hidden `databricks
aitools mcp` command group. It sits on databricks#7595, which adds and removes
agent MCP entries through each agent's own CLI.

`databricks aitools mcp add` and `remove` stopped in a terminal with
"interactive selection is not available yet" when a flag was missing.
This PR replaces that stopgap with pickers. Runs without a terminal keep
their flags and output.

## Changes
- In a terminal, `add` asks for the profile, the services and the agents
that the flags do not give. The profile resolves as it does without a
terminal, so the picker runs only where that stops with several
profiles.
- `add` has its own agent picker rather than `install`'s. Like the other
`mcp` pickers, Esc cancels it, and its help says enter confirms.
- At the catalog and schema prompt, Esc stops listing, as an empty
answer does, and keeps the picks of the pages already shown. Ctrl-C
still aborts the add.
- A picker cancelled with Esc leaves nothing on screen.
- A run that picks its services checks the profile and chooses the
agents before it connects. A missing profile or no agent is refused
without a request. A picked service whose recorded entry points at
another host is refused after the pick, before anything is written.
- The service picker marks services the profile already has as
`(installed)`, unchecked. "Another schema..." lists another catalog and
schema and keeps the checks.
- The profile picker rows have no `[default]` mark.
- The plan says `add`, `re-assert` (only when the write leaves the entry
as it is), `update` or `replace`. An agent whose config cannot be read
is shown with the reason.
- `add` asks `Proceed?` only when a picker made a choice. For each
sign-in-required server it installed, it asks "Sign in now?" unless the
caller is already signed in. Ctrl-C stops the remaining questions and
prints the login command of each server still to sign in.
- In a terminal, `remove` with none of `--names`, `--profile` or `--all`
shows the installed servers and asks `Proceed?` before removing the
picked ones.
- `add --no-login` skips the sign-in question that a terminal asks for
each sign-in-required server it installed. It cannot be combined with
`--login`. Without a terminal, `add` already does not sign in.
- An empty pick in the service picker prints `No servers selected.` and
exits 0 without writing anything. It used to fail with INVALID_FLAGS.
- The pickers share `install`'s picker model, from databricks#7721: `runPicker`
runs a built picker, `newPicker` takes the search func (nil for none),
and the model gains an `onKey` hook and a search check that allows none.

## Why
Choosing servers needs their descriptions and sign-in requirements,
which the workspace knows and the flags do not show.

## Decisions to review
- Agents are chosen before the services, so a missing agent or a broken
profile is reported before any request. Cost: the agent question comes
first.
- Esc at the catalog and schema prompt stops listing instead of aborting
the add, so the picks already shown are kept. Cost: an Esc meant to
abort keeps those picks; Ctrl-C aborts.
- `add` has its own agent picker, so the two copies can drift apart.
- A picked service is checked against its recorded entry only after the
pick, so one stale entry of another service does not stop the picker.
- Installed services are checkable rows, not disabled rows, because the
picker library has no disabled options. Checking one re-asserts its
entry, as `add --names` does.
- `--name` without `--names` is refused rather than offered a
single-select picker.

## Tests
- `mcp_pickers_test.go` covers the service and profile pickers, the
agent picker's failed check and Esc, the location prompt's Esc, and the
remove picker's refusal. `mcp_add_test.go` runs an interactive `add`
through the prompt seams: refusals make no request, a changed host is
refused after the pick, and a fully specified run asks only the sign-in
question. `TestMcpAddPickerEmptyPickAddsNothing` covers the empty pick,
and `TestValidateMCPAddFlags` the `--login` and `--no-login` conflict.
- `mcp_remove_test.go` runs the remove picker end to end, including a
declined confirmation.
- `./task test-exp-aitools` passes. `go test -race ./cmd/aitools/
./libs/aitools/... ./libs/cmdio/` and `GOOS=windows` vet pass.
- Not tested: a real terminal and a live workspace. The prompts are
covered through their seams.

## How to review
Small edits outside the feature, about 15 lines in `libs/cmdio/`
(`io.go`, `prompt.go`, `select.go`), `cmd/aitools/mcp.go`,
`uninstall.go`, and the moved `multiSelectHelp` constant in
`install.go`. Read closely: `cmd/aitools/mcp_pickers.go`, the `add` flow
in `cmd/aitools/mcp_add.go` (agent choice at its interactive branch,
before the service pick), and `cmd/aitools/mcp_remove.go`.

This pull request and its description were written by Isaac.

Co-authored-by: Isaac <no-reply@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aitools AI tools (databricks aitools) related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants