Skip to content

Add AI tools integration - #2025

Open
rclarey wants to merge 11 commits into
mainfrom
aitools-integration
Open

Add AI tools integration#2025
rclarey wants to merge 11 commits into
mainfrom
aitools-integration

Conversation

@rclarey

@rclarey rclarey commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Changes

Integrate the databricks aitools family of commands into the extension.

  • on install (or first launch of the extension with this feature) it prompts to install AI tools
  • add AI tools row to the configuration pane

Tests

Added tests pass

@rugpanov

rugpanov commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

🤖 Integration tests ❌ 2 of 35 test jobs failed for 4b8a5593 (33 passed).
View run

@rugpanov rugpanov added the databricks-team Authored by a Databricks team member label Jul 17, 2026
@rugpanov

rugpanov commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

🤖 Integration tests ❌ 2 of 35 test jobs failed for fb06b04b (33 passed).
View run

@rugpanov

rugpanov commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

🤖 Integration tests ✅ all 35 test jobs passed for cda54dbe.
View run

@rugpanov

rugpanov commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🤖 Integration tests ✅ all 35 test jobs passed for 2f661600.
View run

@rclarey
rclarey requested review from misha-db and rugpanov and removed request for rugpanov August 4, 2026 11:30
@rclarey
rclarey temporarily deployed to test-trigger-is August 4, 2026 11:39 — with GitHub Actions Inactive
@rclarey
rclarey requested a review from rugpanov August 4, 2026 11:39
@rclarey
rclarey temporarily deployed to test-trigger-is August 4, 2026 11:39 — with GitHub Actions Inactive
// In both cases we expect the workspace to be reloaded and the extension will
// be activated again.
// be activated again. The AI tools setup affordance is added as a
// viewsWelcome entry (see package.json) since it works without a folder.

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.

stale comment? no viewsWelcome in package.json

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, whoops! Will remove

// Detect install state on activation and, if installed, auto-apply any
// available update; otherwise prompt the user (once) to install the tools.
// Non-blocking so it doesn't delay activation.
aiToolsCommands.initializeCommand()();

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.

Can initializeCommand() throw? (try/catch)

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.

Also it's running in remote mode, even though commands are gated to not run

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah it seems it can if window.withProgress throws, but it probably shouldn't. I'll update this to show an error toast instead 👍

loggerManager
),
telemetry.registerCommand(
"databricks.logs.show",

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.

looks like duplicate of existing "databricks.internal.showOutput" command

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.

and has no enablement (will appear in remote mode)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll remove this then 👍

// before the CLI call — passing an empty `--agents` list would make
// the CLI act on every detected agent, which is not what was chosen.
if (agents.length > 0 && cliAgents.length === 0) {
this.telemetry.recordEvent(Events.AITOOLS_INSTALL, {

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.

Here AITOOLS_INSTALL is reported as success (Cursor specific case), but where do we install it?
addCursorPlugin() call before seems to only open a modal

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Installing the cursor plugin via the modal opened by addCursorPlugin is not observable by this extension. In this case (agents.length > 0 && cliAgents.length === 0) only cursor is selected so we don't need to run the CLI, therefore we pass success: true since there is no other success signal we can use


it("hangs on a stdin-reading process without closeStdin", async () => {
const raced = await Promise.race([
cancellableExecFile("cat", []).then(() => "completed"),

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.

minor: "cat" process seems to stay alive/leaking

setIsCursor(value: boolean) {
commands.executeCommand(
"setContext",
"databricks.context.isCursor",

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.

No function reads "databricks.context.isCursor" key. is it needed?

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.

and no "when" clause is checking it in package.json

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This must have been left behind at some point. I'll remove 👍

* for available updates, and caching the resolved install location.
*/
export class AiToolsManager implements Disposable {
private disposables: Disposable[] = [];

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.

nit: nothing is pushed in disposables

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah I know, I was just following the boilerplate. I can remove it 👍

description: version,
collapsibleState: TreeItemCollapsibleState.None,
},
agents !== undefined && {

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.

agents !== undefined is always true as it defaults to [] in model

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good catch. This should be agents.length > 0

@rclarey
rclarey temporarily deployed to test-trigger-is August 4, 2026 13:47 — with GitHub Actions Inactive
@rclarey
rclarey temporarily deployed to test-trigger-is August 4, 2026 13:47 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/vscode

Inputs:

  • PR number: 2025
  • Commit SHA: a3af8ce9334abcfdef7dc8721b277876e6e3f491

Checks will be approved automatically on success.

Comment on lines +92 to +102
const items: ConfigurationTreeItem[] = [
{
label: "AI tools",
id: TREE_ICON_ID,
description: description ?? "",
tooltip: `AI tools installed (${installLocation})`,
contextValue: getContextValue(state),
iconPath: icon,
collapsibleState: TreeItemCollapsibleState.Collapsed,
},
];

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.

In case installLocation !== undefined (maybe cached) but detectError is true. it will show collapsed node and when user clicks it will expand to empty node (as getChildren returns [] in case of detectError)

is this intentional?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah probably it's better to just show the error state in all cases and ignore any cached state

"url": "https://github.com/databricks/databricks-vscode.git"
},
"activationEvents": [
"onStartupFinished",

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.

Why do we need this? it makes extension activate for all cases, even when user opens some unrelated (to databricks) project. We should try to avoid it as it makes VSCode UX slow

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.

Also it will force activating all dependent extensions (python, yaml, debugger, etc..)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

databricks-team Authored by a Databricks team member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants