Repository navigation
Conversation
## Changes Automatic installation no longer downgrades skills. If the installed skills come from a newer release than the one auto-install would install, it leaves them as they are. - `libs/aitools/installer`: new `UpdateOptions.NoDowngrade`. When it is set and the target ref is a release tag older than the installed release, `UpdateSkills` returns the usual `RefusedError` from the downgrade check. It does this even when the ref is pinned, whether by `DATABRICKS_SKILLS_REF` or by the compatibility manifest. A branch or commit SHA has no release order to compare against, so a pinned branch or SHA is still installed. - `cmd/aitools/update.go`: the auto-install path, which sets `keepModified`, now also sets `NoDowngrade`. A `databricks aitools update` that you run yourself works as before and still installs the pinned release. - Auto-install already treats a `RefusedError` as `KEPT`. So in this case it prints nothing, reports the `KEPT` outcome and records the version, which means the next command doesn't retry. - Changelog fragment under `.nextchanges/cli/`. ## Why The compatibility manifest pins each released CLI to a skills release, and the update code counts that pin as an explicit ref. An explicit ref skipped the downgrade check. Say a user installed a newer skills release themselves, for example with `DATABRICKS_SKILLS_REF=v0.4.0`. When they upgraded the CLI, auto-install replaced those skills with the older release pinned for that CLI and reported it as "Updated". Auto-install runs without being asked, so it should never undo a newer install the user chose. Rolling back is still possible with an explicit `databricks aitools update`. ## Tests - `TestUpdateNoDowngradeRefusesAnOlderPinnedRelease`: with `NoDowngrade`, a pinned older release is refused and the installed release stays the same. Without it, the same pinned release is installed. - `TestUpdateNoDowngradeInstallsAPinnedBranch`: with `NoDowngrade`, a pinned branch (`main`) is still installed. - Acceptance test `acceptance/cmd/aitools/auto-install/upgrade`: new scenario that installs skills `v0.4.0` explicitly, then upgrades to a CLI version that the compatibility manifest pins to `0.3.0`. It checks that nothing is printed, the outcome is `KEPT`, the installed skills are unchanged and the new version is recorded. Co-authored-by: Isaac <no-reply@databricks.com>
There was a problem hiding this comment.
Automated review at 85d587b. Each finding was verified against the code.
No blocking issues found. 3 non-blocking comment(s) below.
This PR adds UpdateOptions.NoDowngrade and sets it on the auto-install path, so auto-install refuses a pinned release tag older than the installed skills and reports KEPT instead of rolling the skills back. The raw-skills path does what the description says. In a mixed install, though, the plugin step runs before the refusal, so a refused run has already rewritten the plugin record to the pinned version, printed a line, and is still reported as KEPT. There are also two small fixes: a test-script output sent to /dev/null, and a doc comment line that wasn't re-wrapped.
| Scope: scope, | ||
|
|
||
| KeepModified: f.keepModified, | ||
| NoDowngrade: f.keepModified, |
There was a problem hiding this comment.
[nice to have] NoDowngrade only reaches the raw-skills reconcile, but updatePluginsFn(ctx, scope, ref) (line 182) runs first with the same pinned ref and no downgrade check. Take a mixed global install where Claude Code has the plugin and Cursor has raw skills from v0.4.0, with the manifest pinning this CLI to 0.3.0. Auto-install runs the plugin update, UpdateInstalledPlugins saves the record as 0.3.0 and line 195 prints it. Then UpdateSkills returns RefusedError and the run is reported as KEPT. Can the refusal be decided before the plugin step when keepModified is set (compare ref with the installed release up front), so a refused run changes nothing?
| use_home pinned-home | ||
| skills_dir="${USERPROFILE:-$HOME}/.databricks/aitools/skills" | ||
| trace DATABRICKS_SKILLS_REF=v0.4.0 $CLI aitools install --skills-only --scope=global --agents=cursor | ||
| print_telemetry > /dev/null |
There was a problem hiding this comment.
[nit] .agents/rules/testing.md says to send output you don't want in the golden to LOG.<name>, not /dev/null. As written, the telemetry from the setup install is lost even under go test -v. print_telemetry > LOG.install_telemetry still clears it and keeps it out of output.txt.
|
|
||
| // NoDowngrade refuses a release older than the installed one even when | ||
| // the ref is pinned (by DATABRICKS_SKILLS_REF or the compatibility | ||
| // manifest). A pinned branch or commit SHA is still installed. Automatic updates set it: a newer release the user installed |
There was a problem hiding this comment.
[nit] This line of the NoDowngrade doc comment ("A pinned branch or commit SHA is still installed. Automatic updates set it: …") is much longer than the lines around it. Please re-wrap it.
Co-authored-by: Isaac <no-reply@databricks.com>
|
Commit: Regression test reportSelected 1 changed tests (limit=20, 0 not selected) 1 tests: regression=1 unreleased=0 coverage=0 failing=0
TestAccept/cmd/aitools/auto-install/upgrade: branch ✅ | main (1ea5591) ❌ | latest (v1.27.0) ❌main (1ea5591): latest (v1.27.0): |
✅ Integration test reportCommit: b1a67e8
Top 48 slowest tests (at least 2 minutes):
|
simonfaltum
left a comment
There was a problem hiding this comment.
🤖 Automated review from simonfaltum's review agent (pr-review skill) at 046dac1. Each finding was verified against the code; simonfaltum may follow up.
No blocking issues found, approving. 6 non-blocking comment(s) and 2 question(s) below.
This PR makes auto-install keep skills from a newer release instead of installing the older release the CLI is pinned to. It does this through a new UpdateOptions.NoDowngrade, which only auto-install sets. The single-agent raw-skills path works as described, the unit and acceptance tests catch a regression, and CI is green. The open points are in mixed installs: plugin updates are hidden behind KEPT, and a plugin install or a selective install from a newer release blocks the raw skills from updating. There are also a few nits and a question on whether a compatibility pin should still be able to roll back a release that auto-install installed.
Questions
- Auto-install now keeps any installed release that is newer than this CLI's pin, but the install state doesn't record how that release got there. Say a skills release turns out to be broken or incompatible, and the compatibility manifest is edited to pin back to an earlier one (the remote control that
GetSkillsRefandinternal/build/README.mddescribe). Users who already auto-installed the bad release keep it on their next CLI upgrade, andKEPTsettles that version, so only a manualdatabricks aitools updaterolls them back. Is that trade-off intended? Options: record in the state when a release came from an explicitDATABRICKS_SKILLS_REFand refuse only in that case, or keep the current behavior and document that a pin no longer rolls back skills that auto-install installed. (non-blocking) NoDowngradeis always set fromkeepModified, which now drives four auto-install behaviors: keeping modified files, skipping the plugin migration, skipping the legacy cleanup, and refusing downgrades.checkSkillsDowngrade'sexplicitparameter now really means "allow a downgrade". Would renaming them (for examplekeepModified→auto,explicit→allowDowngrade) makeNoDowngrade: f.keepModifiedread less like a copy-paste slip, or do you prefer the current names? (non-blocking)
Agreeing with existing threads
- [nice to have] A refused auto-install still runs the plugin updates, then reports KEPT: #7888 (comment)
- [nit] NoDowngrade doc comment not re-wrapped: #7888 (comment)
- [nit] Setup telemetry sent to /dev/null instead of a LOG file: #7888 (comment)
Refuse an older pinned release before fetching its manifest, with a message that names the kept release and how to install the pinned one. Report the plugins an update changed even when it then keeps the raw skills. Give the acceptance gate helper a skills argument, and document the guard in internal/build/README.md and planTools. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Changes
Automatic installation no longer downgrades skills. If the installed skills come from a newer release than the one auto-install would install, it leaves them as they are.
libs/aitools/installer: newUpdateOptions.NoDowngrade. When it is set and the target ref is a release tag older than the installed release,UpdateSkillsreturns the usualRefusedErrorfrom the downgrade check. It does this even when the ref is pinned, whether byDATABRICKS_SKILLS_REFor by the compatibility manifest. A branch or commit SHA has no release order to compare against, so a pinned branch or SHA is still installed.cmd/aitools/update.go: the auto-install path, which setskeepModified, now also setsNoDowngrade. Adatabricks aitools updatethat you run yourself works as before and still installs the pinned release.RefusedErrorasKEPT. So in this case it prints nothing, reports theKEPToutcome and records the version, which means the next command doesn't retry..nextchanges/cli/.Why
The compatibility manifest pins each released CLI to a skills release, and the update code counts that pin as an explicit ref. An explicit ref skipped the downgrade check. Say a user installed a newer skills release themselves, for example with
DATABRICKS_SKILLS_REF=v0.4.0. When they upgraded the CLI, auto-install replaced those skills with the older release pinned for that CLI and reported it as "Updated". Auto-install runs without being asked, so it should never undo a newer install the user chose. Rolling back is still possible with an explicitdatabricks aitools update.Tests
TestUpdateNoDowngradeRefusesAnOlderPinnedRelease: withNoDowngrade, a pinned older release is refused and the installed release stays the same. Without it, the same pinned release is installed.TestUpdateNoDowngradeInstallsAPinnedBranch: withNoDowngrade, a pinned branch (main) is still installed.acceptance/cmd/aitools/auto-install/upgrade: new scenario that installs skillsv0.4.0explicitly, then upgrades to a CLI version that the compatibility manifest pins to0.3.0. It checks that nothing is printed, the outcome isKEPT, the installed skills are unchanged and the new version is recorded.