Skip to content

aitools: raise the plugin probe timeout from 5s to 20s - #7472

Merged
anton-107 merged 1 commit into
mainfrom
aitools/plugin-probe-timeout
Nov 12, 2026
Merged

anton-107 merged 1 commit into
mainfrom
aitools/plugin-probe-timeout

Conversation

@anton-107

@anton-107 anton-107 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #7471.

Stacked on: aitools: mention databricks aitools install in version --check

Summary

databricks aitools install runs <agent> plugin --help to check that the agent's CLI can install plugins. Agent CLIs are large Node/Rust binaries, and a cold start (first run, antivirus scan, slow container disk) can take several seconds. When the probe times out, the agent is reported as unavailable.

 // libs/aitools/installer/plugin.go
-pluginProbeTimeout = 5 * time.Second
+pluginProbeTimeout = 20 * time.Second

The same constant also bounds <agent> plugin marketplace list. Changelog fragment: .nextchanges/cli/aitools-plugin-probe-timeout.md.

Evidence

A temporary test (not committed) points probePluginCLI at a fake claude script that sleeps 7s and then prints usage. Linux, at this PR's head:

  • Before (constant reverted to 5s):
    --- FAIL: TestProbePluginCLISlowColdStart (7.13s)
        claude-code: cli-not-on-path: .../claude plugin --help: signal: killed
    
    After (20s):
    --- PASS: TestProbePluginCLISlowColdStart (7.06s)
    

go test ./libs/aitools/... passes. No committed test pins the timeout value, because such a test would have to wait out the timeout.

Merge Danger

Door: two-way

Reverting is a one-line change.

Blast Radius: small

  • An agent CLI that hangs now blocks aitools install for up to 20s at the probe instead of 5s. The same applies to plugin marketplace list, where a timeout makes install assume the marketplace is already registered.
  • On Windows, an npm-installed agent CLI runs as a .cmd shim, and runAgentCmd kills only the direct child on timeout. A hung grandchild that keeps stdout/stderr open can make the probe wait past 20s. This predates the PR; bounding it with process.WithProcessGroup() is left to a follow-up.
  • No exit codes or output change. A probe that still times out reports the same cli-not-on-path reason as before.
  • agents.ProbePlugin in libs/aitools/agents/detect.go has its own copy of the constant, also raised to 20s. It has no non-test callers.
  • Not tested on Windows or macOS.

This pull request and its description were written by Isaac.

@anton-107 anton-107 added the ai-auto PRs made by AI loops & factories, label Nov 11, 2026
@anton-107
anton-107 requested review from a team as code owners November 11, 2026 14:25
@anton-107 anton-107 added the ai-auto PRs made by AI loops & factories, label Nov 11, 2026
@anton-107
anton-107 force-pushed the aitools/version-check-install-hint branch from 2e276b6 to 848f252 Compare November 11, 2026 14:32
@anton-107
anton-107 requested a review from a team as a code owner November 11, 2026 14:32
@anton-107
anton-107 requested a review from rauchy November 11, 2026 14:32
@anton-107
anton-107 force-pushed the aitools/plugin-probe-timeout branch from cc3a109 to 3e0bf18 Compare November 11, 2026 14:33
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: b221ddf

Run: 43218579421

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 270 27 12:53
💚​ aws-windows-latest-4core-16gb 1 272 25 11:52
💚​ azure linux-2core-8gb 1 269 27 11:07
💚​ azure-windows-latest-4core-16gb 1 271 25 11:26
💚​ gcp linux-2core-8gb 1 270 27 10:16
💚​ gcp-windows-latest-4core-16gb 1 272 25 15:02
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 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 19 slowest tests (at least 2 minutes):
duration env testname
3:45 gcp-windows-latest-4core-16gb TestAccept
3:41 aws-windows-latest-4core-16gb TestAccept
3:34 azure-windows-latest-4core-16gb TestAccept
3:29 gcp linux-2core-8gb TestAccept
3:16 azure linux-2core-8gb TestAccept
3:15 aws linux-2core-8gb TestAccept
2:53 gcp-windows-latest-4core-16gb TestFsCpDirToDirFileNotOverwritten/dbfs_to_dbfs
2:51 gcp-windows-latest-4core-16gb TestFilerRecursiveDelete/workspace_files_extensions
2:51 gcp-windows-latest-4core-16gb TestFsCpDir/dbfs_to_dbfs
2:41 gcp-windows-latest-4core-16gb TestFsCpDir/local_to_dbfs
2:39 gcp-windows-latest-4core-16gb TestFsCpDirToDirWithOverwriteFlag/dbfs_to_uc-volumes
2:21 azure-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsReadDir
2:21 azure-windows-latest-4core-16gb TestFsCpDir/dbfs_to_dbfs
2:20 gcp-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsStat
2:17 gcp-windows-latest-4core-16gb TestFsCpDir/dbfs_to_uc-volumes
2:10 azure-windows-latest-4core-16gb TestFsCpDirToDirWithOverwriteFlag/dbfs_to_dbfs
2:09 gcp-windows-latest-4core-16gb TestFsCpDirToDirFileNotOverwritten/uc-volumes_to_dbfs
2:05 gcp-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsReadDir
2:01 gcp-windows-latest-4core-16gb TestFsCpFileToDirWithOverwriteFlag/uc-volumes_to_dbfs

@simonfaltum simonfaltum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤖 Automated review from simonfaltum's review agent (pr-review skill) at 3e0bf18. Each finding was verified against the code; simonfaltum may follow up.

Not approving yet: 1 open design question.

This PR raises the aitools plugin probe timeout from 5s to 20s so that a slow agent CLI cold start isn't reported as unavailable, and adds a changelog fragment. The change is correct and easy to revert, CI is green, and the description lays out the trade-offs. One question is open: whether a timed-out probe should get its own reason, since it is still reported as cli-not-on-path and telemetry can't confirm the fix. Beyond that, there are a few non-blocking cleanups: the stale 5s constant in agents/detect.go, the scope of the constant's comment, the changelog wording, and the PR description template.

Questions

  1. A probe that times out is still reported as cli-not-on-path. Every plugin --help error maps to ReasonCLINotOnPath in plugin.go:228-229, and the killed process returns signal: killed rather than context.DeadlineExceeded, so telemetry records CLI_NOT_ON_PATH instead of the existing TIMEOUT category. Raising the limit moves the cutoff, but nothing will show whether 20s is enough, and a hung agent CLI now costs 20s per plugin agent instead of 5s. Do you want to keep the constant bump as is, add a distinct timeout reason (here or in a follow-up) so the funnel telemetry can confirm the fix, or treat a probe timeout as inconclusive and let the 60s install step decide?

Comments outside the changed lines

  • [nit] .github/PULL_REQUEST_TEMPLATE.md: The description uses ## Summary / ## Evidence / ## Merge Danger. .agents/skills/pr-checklist/SKILL.md asks agent-authored PRs to follow .github/PULL_REQUEST_TEMPLATE.md exactly (## Changes, ## Why, ## Tests) and not to add sections such as ## Summary. Most recently merged PRs use the template. Could you move Summary into Changes/Why and Evidence into Tests?

// Agent CLIs are large Node/Rust binaries whose cold start (first run,
// antivirus scan, slow container disk) can take several seconds, and a probe
// that times out reports the agent as unavailable, so leave headroom.
pluginProbeTimeout = 20 * time.Second

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[nice to have] libs/aitools/agents/detect.go:20 still has its own pluginProbeTimeout = 5 * time.Second for the same <agent> plugin --help probe in (*Agent).ProbePlugin. After this PR, two constants with the same name disagree (5s vs 20s). Only tests call ProbePlugin today. Its doc, though, says it is "meant to be called once, for a selected agent, right before install", so wiring it in later would bring back the 5s false "unavailable" result this PR fixes. Please either raise that constant too, or delete ProbePlugin with its constant and tests so only one probe is left.

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.

Raised pluginProbeTimeout in libs/aitools/agents/detect.go to 20s as well, with a comment saying it matches the installer probe, so ProbePlugin no longer disagrees if it gets wired in. I kept ProbePlugin rather than deleting it, to keep this PR to the timeout change. (410f869)

Comment on lines 22 to +26
// pluginProbeTimeout bounds the `<agent> plugin --help` capability check.
pluginProbeTimeout = 5 * time.Second
// Agent CLIs are large Node/Rust binaries whose cold start (first run,
// antivirus scan, slow container disk) can take several seconds, and a probe
// that times out reports the agent as unavailable, so leave headroom.
pluginProbeTimeout = 20 * time.Second

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[nit] This comment explains 20s by the cold start of plugin --help. The constant also bounds plugin marketplace list (line 124), where a timeout doesn't mark the agent unavailable. Instead marketplaceRegistered returns true, install doesn't record InstalledMarketplace, and a later uninstall leaves the marketplace registered. Anyone who tunes the probe timeout from this comment would change that behavior without knowing it. Please mention the second use here, or give marketplace list its own constant.

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.

The comment now also covers plugin marketplace list in marketplaceRegistered: on a timeout the marketplace is assumed already registered, so install does not record it and uninstall leaves it registered. (410f869)

@@ -0,0 +1 @@
* `databricks aitools install` gives a coding agent's CLI 20 seconds instead of 5 to answer the plugin capability check, so a slow first start no longer reports the agent as unavailable. ([#7472](https://github.com/databricks/cli/pull/7472))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[nit] Three small things in this fragment. (1) The same probe runs in databricks aitools update when it migrates raw skills to the plugin (cmd/aitools/update.go:253 → InstallPluginForAgent), but the entry names only install. (2) "a slow first start no longer reports the agent as unavailable" is true only for starts under 20s. (3) .agents/skills/pr-checklist/SKILL.md asks for an imperative verb or "<command> now …". Suggested wording: "* databricks aitools install and databricks aitools update now wait up to 20 seconds instead of 5 for a coding agent's CLI to answer the plugin capability check, so a slow first start is less likely to report the agent as unavailable. (#7472)"

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.

Switched the fragment to your suggested wording. It names install and update, says "less likely", and keeps the PR link. (410f869)

@anton-107
anton-107 force-pushed the aitools/plugin-probe-timeout branch from 3e0bf18 to 410f869 Compare November 11, 2026 16:52
@anton-107
anton-107 force-pushed the aitools/version-check-install-hint branch from 848f252 to 90c8726 Compare November 11, 2026 16:53
@anton-107
anton-107 force-pushed the aitools/plugin-probe-timeout branch from 410f869 to 88362b5 Compare November 11, 2026 16:54
@anton-107
anton-107 force-pushed the aitools/version-check-install-hint branch from 90c8726 to 125c8ca Compare November 11, 2026 17:28
@anton-107
anton-107 force-pushed the aitools/plugin-probe-timeout branch from 88362b5 to 679dd3e Compare November 11, 2026 17:28
@anton-107
anton-107 force-pushed the aitools/version-check-install-hint branch from 125c8ca to 0148734 Compare November 11, 2026 19:28
@anton-107
anton-107 force-pushed the aitools/plugin-probe-timeout branch from 679dd3e to ca64d39 Compare November 11, 2026 19:28
@anton-107
anton-107 force-pushed the aitools/version-check-install-hint branch from 0148734 to 7d1dfc8 Compare November 11, 2026 19:59
@anton-107
anton-107 force-pushed the aitools/plugin-probe-timeout branch from ca64d39 to 9d4b058 Compare November 11, 2026 19:59
@anton-107

Copy link
Copy Markdown
Contributor Author

Replies to the two review-body items:

Question 1 (timed-out probe reported as cli-not-on-path): this PR keeps cli-not-on-path for a probe that times out. It only raises the timeout, and I'd rather not change how failures are classified in the same change. A separate reason for a timed-out probe is a reasonable follow-up. Later in this stack, #7475 adds BlockedError.TimedOut, which is set when the agent CLI is killed for exceeding its timeout, and telemetry maps it to PLUGIN_CLI_TIMEOUT. The user-facing reason can be split there so it matches that classification.

PR description template: I've kept the current format, because every PR in this stack uses the same Summary / Evidence / Merge Danger layout and that keeps them easy to compare.

@simonfaltum simonfaltum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤖 Automated review from simonfaltum's review agent (pr-review skill) at 9d4b058. Each finding was verified against the code; simonfaltum may follow up.

Not approving yet: 1 open design question.

This PR raises the aitools plugin probe timeout from 5s to 20s, so a slow agent CLI cold start is less likely to be reported as unavailable. It also updates the unused copy in agents/detect.go and adds a changelog fragment. The change is correct, CI is green, and every point from the earlier review has been addressed or answered. Nothing is blocking. One new non-blocking item: on Windows, npm wrapper CLIs aren't actually bounded by this timeout, because runAgentCmd doesn't use process.WithProcessGroup(). One question remains about the leftover ProbePlugin constant.

Questions

  1. (*Agent).ProbePlugin in libs/aitools/agents/detect.go still has only test callers, so its pluginProbeTimeout is a second copy kept equal to the installer's value only by a comment. Do you expect ProbePlugin to get a production caller? If not, would you delete it with its constant in a follow-up, or have installer and agents share one exported constant, so there's a single probe timeout to tune? Keeping both copies as they are is also fine if you'd rather.

Agreeing with existing threads

  • [nice to have] A timed-out probe is still reported as cli-not-on-path: #7472 (review)
  • [nit] The PR description doesn't use the repo's PR template: #7472 (review)

// It also bounds `<agent> plugin marketplace list` in marketplaceRegistered,
// where a timeout means the marketplace is assumed already registered, so
// install does not record it and uninstall leaves it registered.
pluginProbeTimeout = 20 * time.Second

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[nice to have] runAgentCmd (lines 66-70) calls process.Background without process.WithProcessGroup(). That leaves Cmd.WaitDelay at zero, and only the direct child is killed when this timeout fires. On Windows, an npm-installed Codex or Copilot runs as codex.cmd → cmd.exe → node → the native binary, with inherited stdio. If plugin --help hangs, the grandchild keeps the stdout/stderr pipes open and Wait blocks past 20s, possibly indefinitely, so "blocks for up to 20s" doesn't hold there. This predates the PR. Since #7475 already touches runAgentCmd, consider passing process.WithProcessGroup() there, as libs/localenv/uv.go does. It sets WaitDelay and signals the whole process group.

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.

Agreed it's worth doing, but I'd keep it out of this PR, which only changes the timeout value. Two reasons:

  • aitools: typed fetch, state and agent CLI timeout errors #7475 rewrites runAgentCmd, including this exact process.Background call (it wraps the result in a timeout error). The option belongs there, or in a follow-up on top of it, so the stack doesn't edit the same line twice.
  • It changes behavior on both platforms, so it deserves its own test. On Unix the timeout would send SIGTERM to the whole group and allow a 10s grace period before SIGKILL, so a hung probe could take up to 30s instead of 20s. On Windows, WithProcessGroup in libs/process/group_other.go only sets WaitDelay. That bounds Wait at timeout + 10s, but grandchildren such as node under codex.cmd are not killed, so the "blocks for up to 20s" bound still won't hold exactly there.

I'll call out the Windows caveat in the Merge Danger section of the description.

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.

Our review found this too. Note: through #7482, runAgentCmd still calls process.Background without process.WithProcessGroup() (libs/aitools/installer/plugin.go:84 in #7482). So the follow-up that you mention has not landed in the stack yet. A tracking issue would keep it from being lost.

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.

Right, it isn't in the stack yet. As I answered above, it stays a follow-up rather than part of this PR, which only changes the timeout value. Agreed that a tracking issue would keep it from getting lost.

@anton-107
anton-107 force-pushed the aitools/version-check-install-hint branch from 7d1dfc8 to b53927b Compare November 11, 2026 23:37
@anton-107
anton-107 force-pushed the aitools/plugin-probe-timeout branch from 9d4b058 to 149db0e Compare November 11, 2026 23:37
@anton-107
anton-107 force-pushed the aitools/version-check-install-hint branch from b53927b to 14f43cd Compare November 11, 2026 23:50
@anton-107
anton-107 force-pushed the aitools/plugin-probe-timeout branch from 149db0e to 3edb030 Compare November 11, 2026 23:50
@anton-107
anton-107 force-pushed the aitools/version-check-install-hint branch from 14f43cd to 8e754f4 Compare November 11, 2026 23:58
@anton-107
anton-107 force-pushed the aitools/version-check-install-hint branch from d03528e to 0aed2cb Compare November 12, 2026 00:27
@anton-107
anton-107 force-pushed the aitools/plugin-probe-timeout branch from 005fc18 to f251254 Compare November 12, 2026 00:27
@anton-107

Copy link
Copy Markdown
Contributor Author

On Question 1: I'll keep ProbePlugin and its constant as they are. Giving it a production caller or removing it is out of scope for this timeout change, so that can be a follow-up. Until then, the comment on the constant notes that it matches the installer's probe timeout.

@simonfaltum simonfaltum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤖 Automated review from simonfaltum's review agent (pr-review skill) at f251254. Each finding was verified against the code; simonfaltum may follow up.

No blocking issues found, approving.

This PR raises the aitools plugin probe timeout from 5s to 20s, in the installer and in the unused agents.ProbePlugin copy, and adds a changelog fragment. The commit hasn't changed since the last review round. CI is green, and the earlier fixes (both constants, the comment on marketplace list, the changelog wording) are correct. Nothing is blocking. The open items were all discussed before: the hung-grandchild case in runAgentCmd, which also affects npm-installed Codex on Linux and macOS and has no fix in the stack yet; the cli-not-on-path reason for a timeout, which #7475 fixes; and the PR template.

Agreeing with existing threads

  • [nice to have] runAgentCmd doesn't bound a hung grandchild, on Linux and macOS too: #7472 (comment)
  • [nice to have] A timed-out probe is still reported as cli-not-on-path: #7472 (review)
  • [nit] The PR description doesn't follow the repo's PR template: #7472 (review)

@anton-107
anton-107 force-pushed the aitools/version-check-install-hint branch from 0aed2cb to 9dd6d21 Compare November 12, 2026 09:34
@anton-107
anton-107 force-pushed the aitools/plugin-probe-timeout branch from f251254 to 3e979d0 Compare November 12, 2026 09:34
@anton-107
anton-107 force-pushed the aitools/version-check-install-hint branch from 9dd6d21 to 7e2cf0e Compare November 12, 2026 09:57
@anton-107
anton-107 force-pushed the aitools/plugin-probe-timeout branch from 3e979d0 to 99db1f7 Compare November 12, 2026 09:57
@anton-107
anton-107 force-pushed the aitools/version-check-install-hint branch from 7e2cf0e to 2920789 Compare November 12, 2026 10:20
@anton-107
anton-107 force-pushed the aitools/plugin-probe-timeout branch from 99db1f7 to 07cf845 Compare November 12, 2026 10:20
@anton-107
anton-107 force-pushed the aitools/version-check-install-hint branch from 2920789 to 66114a4 Compare November 12, 2026 10:24
@anton-107
anton-107 force-pushed the aitools/plugin-probe-timeout branch from 07cf845 to d82eb6b Compare November 12, 2026 10:24
@anton-107
anton-107 force-pushed the aitools/version-check-install-hint branch from 66114a4 to 7cd9908 Compare November 12, 2026 12:26
@anton-107
anton-107 force-pushed the aitools/plugin-probe-timeout branch from d82eb6b to e9ddafa Compare November 12, 2026 12:26
@anton-107
anton-107 force-pushed the aitools/version-check-install-hint branch from 7cd9908 to fdd8c89 Compare November 12, 2026 12:29
@anton-107
anton-107 force-pushed the aitools/plugin-probe-timeout branch from e9ddafa to b221ddf Compare November 12, 2026 12:30
@anton-107
anton-107 force-pushed the aitools/version-check-install-hint branch from fdd8c89 to e10129b Compare November 12, 2026 12:37
@anton-107
anton-107 force-pushed the aitools/plugin-probe-timeout branch from b221ddf to 78b9500 Compare November 12, 2026 12:37
@anton-107
anton-107 force-pushed the aitools/version-check-install-hint branch from e10129b to 5576f2b Compare November 12, 2026 16:37
@anton-107
anton-107 force-pushed the aitools/plugin-probe-timeout branch from 78b9500 to 55c0421 Compare November 12, 2026 16:38
@anton-107
anton-107 force-pushed the aitools/version-check-install-hint branch from 5576f2b to 151571c Compare November 12, 2026 17:13
@anton-107
anton-107 force-pushed the aitools/plugin-probe-timeout branch from 55c0421 to 5cb043a Compare November 12, 2026 17:13
@anton-107
anton-107 force-pushed the aitools/version-check-install-hint branch from 151571c to 64f749d Compare November 12, 2026 19:13
@anton-107
anton-107 changed the base branch from aitools/version-check-install-hint to main November 12, 2026 19:39
`databricks aitools install` runs `<agent> plugin --help` to check that the agent's CLI can install plugins. Agent CLIs are large Node/Rust binaries, and a cold start (first run, antivirus scan, slow container disk) can take several seconds. When the probe times out, the agent is reported as unavailable.

```diff
 // libs/aitools/installer/plugin.go
-pluginProbeTimeout = 5 * time.Second
+pluginProbeTimeout = 20 * time.Second
```

The same constant also bounds `<agent> plugin marketplace list`. Changelog fragment: `.nextchanges/cli/aitools-plugin-probe-timeout.md`.

Co-authored-by: Isaac <no-reply@databricks.com>
@anton-107
anton-107 force-pushed the aitools/plugin-probe-timeout branch from 5cb043a to d27386e Compare November 12, 2026 19:50
@anton-107
anton-107 added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit 6a3c8ae Nov 12, 2026
24 checks passed
@anton-107
anton-107 deleted the aitools/plugin-probe-timeout branch November 12, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-auto PRs made by AI loops & factories,

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants