From 6e2e827c7bfdaeff4e90147ac9e4fb48051a75db Mon Sep 17 00:00:00 2001 From: Anshul Gupta Date: Mon, 16 Nov 2026 16:50:16 +0000 Subject: [PATCH 1/3] aitools: test that the install hint stays quiet after a project-scoped install #7585 made the hint ask DatabricksTooling, which already walks Claude's project skills dirs, so the false "skills are not installed" warning an agent hit right after `aitools install --scope project` is fixed. The hint tests cover project-scoped plugins and HOME skills but not this layout, so add regression tests for a project install (relative symlink from .claude/skills into .databricks/aitools/skills) seen from the project root and from a subdirectory of the repository. Co-authored-by: Isaac --- libs/aitools/agents/hint_test.go | 40 ++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/libs/aitools/agents/hint_test.go b/libs/aitools/agents/hint_test.go index b2b70d72ff4..813069a77ae 100644 --- a/libs/aitools/agents/hint_test.go +++ b/libs/aitools/agents/hint_test.go @@ -601,3 +601,43 @@ func TestMaybeHint_InstalledLogsNothing(t *testing.T) { MaybeHint(ctx, regularCmd(), noPluginRecorded) assert.Empty(t, telemetry.BufferedEvents(ctx)) } + +// writeProjectSkill lays out a project-scoped install the way +// `aitools install --scope project` does: the canonical copy under the project, +// symlinked from Claude's project skills dir. +func writeProjectSkill(t *testing.T, project, name string) { + canonical := filepath.Join(project, ".databricks", "aitools", "skills", name) + require.NoError(t, os.MkdirAll(canonical, 0o755)) + link := filepath.Join(project, ".claude", "skills", name) + require.NoError(t, os.MkdirAll(filepath.Dir(link), 0o755)) + rel, err := filepath.Rel(filepath.Dir(link), canonical) + require.NoError(t, err) + require.NoError(t, os.Symlink(rel, link)) +} + +func TestMaybeHint_ProjectSkillsInstalledSilent(t *testing.T) { + setClaudeAgent(t) + home := t.TempDir() + ctx, stderr := claudeCtx(t, home) + project := t.TempDir() + writeProjectSkill(t, project, "databricks-ai-runtime") + t.Chdir(project) + + MaybeHint(ctx, regularCmd()) + assert.Empty(t, stderr.String()) +} + +func TestMaybeHint_ProjectSkillsInParentOfRepoSubdirSilent(t *testing.T) { + setClaudeAgent(t) + home := t.TempDir() + ctx, stderr := claudeCtx(t, home) + repo := t.TempDir() + require.NoError(t, os.Mkdir(filepath.Join(repo, ".git"), 0o755)) + writeProjectSkill(t, repo, "databricks-ai-runtime") + sub := filepath.Join(repo, "train") + require.NoError(t, os.Mkdir(sub, 0o755)) + t.Chdir(sub) + + MaybeHint(ctx, regularCmd()) + assert.Empty(t, stderr.String()) +} From a5c1eb24960f33ec2076cfc6e8ce6608e812fec3 Mon Sep 17 00:00:00 2001 From: Anshul Gupta Date: Tue, 17 Nov 2026 08:58:38 +0000 Subject: [PATCH 2/3] aitools: table-drive the project-install hint tests Co-authored-by: Isaac --- libs/aitools/agents/hint_test.go | 51 +++++++++++++++----------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/libs/aitools/agents/hint_test.go b/libs/aitools/agents/hint_test.go index 813069a77ae..3d07ee098bf 100644 --- a/libs/aitools/agents/hint_test.go +++ b/libs/aitools/agents/hint_test.go @@ -602,9 +602,7 @@ func TestMaybeHint_InstalledLogsNothing(t *testing.T) { assert.Empty(t, telemetry.BufferedEvents(ctx)) } -// writeProjectSkill lays out a project-scoped install the way -// `aitools install --scope project` does: the canonical copy under the project, -// symlinked from Claude's project skills dir. +// writeProjectSkill creates a project-scoped Claude skill symlink. func writeProjectSkill(t *testing.T, project, name string) { canonical := filepath.Join(project, ".databricks", "aitools", "skills", name) require.NoError(t, os.MkdirAll(canonical, 0o755)) @@ -616,28 +614,27 @@ func writeProjectSkill(t *testing.T, project, name string) { } func TestMaybeHint_ProjectSkillsInstalledSilent(t *testing.T) { - setClaudeAgent(t) - home := t.TempDir() - ctx, stderr := claudeCtx(t, home) - project := t.TempDir() - writeProjectSkill(t, project, "databricks-ai-runtime") - t.Chdir(project) - - MaybeHint(ctx, regularCmd()) - assert.Empty(t, stderr.String()) -} - -func TestMaybeHint_ProjectSkillsInParentOfRepoSubdirSilent(t *testing.T) { - setClaudeAgent(t) - home := t.TempDir() - ctx, stderr := claudeCtx(t, home) - repo := t.TempDir() - require.NoError(t, os.Mkdir(filepath.Join(repo, ".git"), 0o755)) - writeProjectSkill(t, repo, "databricks-ai-runtime") - sub := filepath.Join(repo, "train") - require.NoError(t, os.Mkdir(sub, 0o755)) - t.Chdir(sub) - - MaybeHint(ctx, regularCmd()) - assert.Empty(t, stderr.String()) + for _, tc := range []struct { + name string + // subdir is where the command runs, relative to the project root. + subdir string + }{ + {name: "project root"}, + {name: "repo subdirectory", subdir: "train"}, + } { + t.Run(tc.name, func(t *testing.T) { + setClaudeAgent(t) + home := t.TempDir() + ctx, stderr := claudeCtx(t, home) + project := t.TempDir() + require.NoError(t, os.Mkdir(filepath.Join(project, ".git"), 0o755)) + writeProjectSkill(t, project, "databricks-ai-runtime") + cwd := filepath.Join(project, tc.subdir) + require.NoError(t, os.MkdirAll(cwd, 0o755)) + t.Chdir(cwd) + + MaybeHint(ctx, regularCmd()) + assert.Empty(t, stderr.String()) + }) + } } From 880de6d6ff709d8e42e25d742821cd6b127fba6c Mon Sep 17 00:00:00 2001 From: Anshul Gupta Date: Tue, 17 Nov 2026 09:02:21 +0000 Subject: [PATCH 3/3] aitools: pass pluginRecorded to MaybeHint in the project-install tests MaybeHint gained a pluginRecorded argument in #7586. Co-authored-by: Isaac --- libs/aitools/agents/hint_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/aitools/agents/hint_test.go b/libs/aitools/agents/hint_test.go index 3d07ee098bf..9d0971e17df 100644 --- a/libs/aitools/agents/hint_test.go +++ b/libs/aitools/agents/hint_test.go @@ -633,7 +633,7 @@ func TestMaybeHint_ProjectSkillsInstalledSilent(t *testing.T) { require.NoError(t, os.MkdirAll(cwd, 0o755)) t.Chdir(cwd) - MaybeHint(ctx, regularCmd()) + MaybeHint(ctx, regularCmd(), noPluginRecorded) assert.Empty(t, stderr.String()) }) }