Skip to content

Add agents to aitools list output - #6020

Merged
rclarey merged 6 commits into
mainfrom
aitools-list-agents
Aug 5, 2026
Merged

Add agents to aitools list output#6020
rclarey merged 6 commits into
mainfrom
aitools-list-agents

Conversation

@rclarey

@rclarey rclarey commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Changes

Update aitools list to report every supported coding agent in --output json mode, with its detection status (whether the CLI binary and config directory were found) and databricks plugin installation status and version.

Why

This is needed to power integration with the VSCode extension in two places:

  • agents list + detection is needed to prompt users for which agents to install tools for
  • agents list + version is needed to show UI of what is installed

Tests

Added automated tests

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: f84991a

Run: 30458919950

Env ❌​FAIL 🟨​KNOWN 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
❌​ aws linux 3 1 3 4 319 1065 6:02
❌​ aws windows 3 1 3 4 321 1063 8:45
❌​ azure linux 3 1 3 4 319 1064 5:22
❌​ azure windows 3 1 3 4 321 1062 11:43
❌​ gcp linux 3 1 5 318 1066 7:00
💚​ gcp windows 1 5 323 1064 6:29
11 interesting tests: 4 SKIP, 3 FAIL, 3 RECOVERED, 1 KNOWN
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
🟨​ TestAccept 🟨​K 🟨​K 🟨​K 🟨​K 🟨​K 💚​R
❌​ TestAccept/bundle/deploy/mlops-stacks ❌​F ❌​F ❌​F ❌​F ❌​F ✅​p
❌​ TestAccept/bundle/deploy/mlops-stacks/DATABRICKS_BUNDLE_ENGINE=direct ❌​F ❌​F ❌​F ❌​F ❌​F ✅​p
❌​ TestAccept/bundle/deploy/mlops-stacks/DATABRICKS_BUNDLE_ENGINE=terraform ❌​F ❌​F ❌​F ❌​F ❌​F ✅​p
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo/root 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/subdir 💚​R 💚​R 💚​R 💚​R
Top 1 slowest tests (at least 2 minutes):
duration env testname
5:22 gcp windows TestAccept

@rclarey
rclarey requested a review from renaudhartert-db July 22, 2026 09:30
@rclarey
rclarey marked this pull request as ready for review July 22, 2026 09:30
@rclarey
rclarey force-pushed the aitools-list-agents branch from b90063a to 737b0e0 Compare July 29, 2026 14:01
@rclarey
rclarey requested review from misha-db, parthban-db and rugpanov and removed request for renaudhartert-db July 29, 2026 14:07
Comment thread cmd/aitools/list.go
Name: a.Name,
DisplayName: a.DisplayName,
Managed: a.Plugin != nil,
Detected: a.IsPreselected(ctx),

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.

detected comes from IsPreselected, which for a plugin agent is true only when its binary is on PATH — so an installed ~/.claude with no claude on PATH reports detected:false, contradicting the PR's "binary or config dir found". Intended, or did you mean a presence check?

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 want to just copy the TUI UX, so I used IsPreselected which is the same method the TUI agent selector uses to decide if an agent is detected or not.

Plugin agents needs the binary on PATH to install properly, so returning detected: false is expected here

Comment thread cmd/aitools/list.go Outdated
// skills are symlinked/copied into the agent's own skills dir instead.
// Detect the install from disk and report the scope's recorded release
// as the version, so JSON consumers see them as installed too.
if a.Plugin == nil && agentHasSkillsInScope(ctx, a, scope) {

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.

This disk check is gated on a.Plugin == nil, but a plugin agent installed with --skills-only also has skills on disk and no plugin record, so it shows installed:{}. Should the fallback fire whenever there's no recorded plugin, not only for skills-only agents?

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.

For the VSCode usecase I think this granularity isn't needed, we're just focussing on the happy path of plugin installs and we don't expose --skills-only.

My feeling is that users who already did an installation with --skills-only know enough about what they're doing, and won't be tripped up on installed: {}

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.

The CLI is not just for VS Code. I don't want to optimize CLI for a single product. I would think of this as a bug for CLI because it does not cover every possible scenario. I also think it's not hard to implement. So, I would like us to have it logic complete.

Comment thread cmd/aitools/list.go Outdated
Comment thread cmd/aitools/list.go
Name: a.Name,
DisplayName: a.DisplayName,
Managed: a.Plugin != nil,
Detected: a.IsPreselected(ctx),

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.

detected is populated from the preselection verdict, not a presence check.

The JSON field is named detected, but it's set from Agent.IsPreselected(ctx) rather than Agent.Detected(ctx). Those are different concepts, and they diverge from "is this agent present on the machine" in both directions (see IsPreselectedDisplayState in libs/aitools/agents/detect.go):

  • Configured but CLI not on PATHStateInstalledCLIMissingdetected: false. E.g. an agent installed via a GUI so its config dir exists but the binary isn't on PATH — reported as not detected, though it's actually present.
  • Binary on PATH but never configuredStateAvailabledetected: true. E.g. the CLI is installed but the config dir doesn't exist yet — reported as detected, though nothing's set up.

IsPreselected is the "should the picker pre-check this row" verdict, which is a reasonable thing to expose — but under the name detected a JSON consumer (the VSCode extension) will read it as presence and get the wrong answer at both boundaries.

Two ways to resolve:

  1. If presence is what consumers want, populate the field from a.Detected(ctx) (the config-dir match that already exists).
  2. If the preselection verdict is intentional, keep the value but rename the field (e.g. preselected / recommended) and expand the doc comment — right now it reads "the CLI's own presence verdict," which describes Detected, not IsPreselected.

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.

TLDR; yes this is intentional.

The naming here is a bit tricky, but I think detected is the best name here for what it means without being overly verbose. We are asking "which agents are available to install plugins/skills for?" and for plugin agents if the binary is missing from PATH then we detected that the agent is not available for installation.

preselected or recommended couples this to the initial install UI and I'm not sure if we'll want to use this elsewhere (maybe we never will), so I biased towards a more neutral name.

If the conflict with a.Detected seems too confusing then I can rename (but IMO a.Detected would be better renamed to a.IsConfigPresent)

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.

I think both variables are not really represent what they imply.

IsConfigPresent is better then Detected.
Also, if it is within our control, let's rename IsPreselected to explain the real meaning of variable (IsConfigPresent).

@parthban-db parthban-db 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 to unblock, but can you please do the change in this comment?

Comment thread cmd/aitools/list.go Outdated
// skills are symlinked/copied into the agent's own skills dir instead.
// Detect the install from disk and report the scope's recorded release
// as the version, so JSON consumers see them as installed too.
if a.Plugin == nil && agentHasSkillsInScope(ctx, a, scope) {

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.

The CLI is not just for VS Code. I don't want to optimize CLI for a single product. I would think of this as a bug for CLI because it does not cover every possible scenario. I also think it's not hard to implement. So, I would like us to have it logic complete.

@rclarey
rclarey enabled auto-merge August 5, 2026 07:22
@rclarey
rclarey added this pull request to the merge queue Aug 5, 2026
Merged via the queue into main with commit 7d8db8e Aug 5, 2026
19 checks passed
@rclarey
rclarey deleted the aitools-list-agents branch August 5, 2026 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants