diff --git a/.nextchanges/cli/aitools-plugin-probe-timeout.md b/.nextchanges/cli/aitools-plugin-probe-timeout.md new file mode 100644 index 00000000000..2a0460a6d18 --- /dev/null +++ b/.nextchanges/cli/aitools-plugin-probe-timeout.md @@ -0,0 +1 @@ +* `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](https://github.com/databricks/cli/pull/7472)) diff --git a/libs/aitools/agents/detect.go b/libs/aitools/agents/detect.go index 4b7edbf4dd1..53ae8d085f8 100644 --- a/libs/aitools/agents/detect.go +++ b/libs/aitools/agents/detect.go @@ -16,8 +16,9 @@ import ( var lookPath = exec.LookPath // pluginProbeTimeout bounds the ` plugin --help` capability probe so a -// hung agent CLI cannot stall install. -const pluginProbeTimeout = 5 * time.Second +// hung agent CLI cannot stall install. It matches the probe timeout in +// libs/aitools/installer, which leaves headroom for a slow agent CLI cold start. +const pluginProbeTimeout = 20 * time.Second // DisplayState describes how an agent should be presented in the install // picker. It combines the two cheap presence signals (binary on PATH and diff --git a/libs/aitools/installer/plugin.go b/libs/aitools/installer/plugin.go index 12081a171c0..107b0b5b6e5 100644 --- a/libs/aitools/installer/plugin.go +++ b/libs/aitools/installer/plugin.go @@ -20,7 +20,13 @@ var lookPath = exec.LookPath const ( // pluginProbeTimeout bounds the ` 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. + // It also bounds ` 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 // pluginCmdTimeout bounds an install/update/uninstall command, which may // clone the marketplace repo, so it gets more headroom than the probe. pluginCmdTimeout = 60 * time.Second