-
Notifications
You must be signed in to change notification settings - Fork 107
fix(recall): notify once at SessionStart when embeddings not installed #353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
efenocchi
merged 3 commits into
activeloopai:main
from
sumitvairagar:fix/embeddings-nudge-338
Sep 16, 2026
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
f1dc079
cleanup: remove dead extractKeywords() and STOPWORDS orphaned by ILIK…
sumitvairagar 88dce8f
fix(recall): notify once at SessionStart when embeddings not installe…
sumitvairagar 31c6aac
fix(notifications): fire the embeddings nudge on the default install too
efenocchi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| /** | ||
| * Embeddings nudge — a one-time SessionStart banner telling users that | ||
| * semantic memory search is off because embeddings are not enabled. | ||
| * | ||
| * Embeddings default to off (`embeddings.enabled` is seeded `false` in | ||
| * ~/.deeplake/config.json on first read, see user-config.ts), and the | ||
| * transformers deps ship separately via `hivemind embeddings install`. So on | ||
| * a fresh install `embeddingsStatus()` reports "user-disabled" even though | ||
| * the user never chose anything, and the semantic half of memory search is | ||
| * silently inactive. The status enum cannot tell that default apart from a | ||
| * deliberate `hivemind embeddings disable`, so the rule fires on every | ||
| * non-enabled state and relies on the stable dedupKey to show at most once. | ||
| */ | ||
|
|
||
| import type { Rule } from "../types.js"; | ||
| import type { EmbeddingsStatus } from "../../embeddings/disable.js"; | ||
|
|
||
| export const embeddingsNudgeRule: Rule = { | ||
| id: "embeddings-nudge", | ||
| trigger: "session_start", | ||
| evaluate({ embeddingsStatus }) { | ||
| // Undefined means the entry point did not provide a status (older | ||
| // harness wiring); treat as enabled and stay quiet. | ||
| if (embeddingsStatus === undefined || embeddingsStatus === "enabled") return null; | ||
| return { | ||
| id: "embeddings-nudge", | ||
| severity: "warn", | ||
| title: "Semantic memory search is off — embeddings not enabled", | ||
| body: "Run `hivemind embeddings install` to enable semantic search over your team's memory. Until then, memory search is keyword-only.", | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| // Stable key → shown once, ever. | ||
| dedupKey: { v: 1 }, | ||
| }; | ||
| }, | ||
| }; | ||
|
|
||
| // Extend NotificationContext with the embeddings status field. | ||
| // Declared here to keep the rule self-contained; the hook entry point | ||
| // populates it before calling drainSessionStart. | ||
| declare module "../types.js" { | ||
| interface NotificationContext { | ||
| /** Pre-read embeddings status — populated by the hook entry point so the | ||
| * rule stays IO-free. Undefined when the entry point doesn't provide it | ||
| * (e.g. older test harnesses); treated as "enabled" (no nudge). */ | ||
| embeddingsStatus?: EmbeddingsStatus; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| import { describe, it, expect } from "vitest"; | ||
|
|
||
| import { embeddingsNudgeRule } from "../../src/notifications/rules/embeddings-nudge.js"; | ||
| import type { NotificationContext } from "../../src/notifications/types.js"; | ||
|
|
||
| function ctx(over: Partial<NotificationContext>): NotificationContext { | ||
| return { agent: "claude-code", creds: null, state: { shown: {} }, ...over }; | ||
| } | ||
|
|
||
| const EXPECTED_BODY = | ||
| "Run `hivemind embeddings install` to enable semantic search over your team's memory. Until then, memory search is keyword-only."; | ||
|
|
||
| describe("embeddingsNudgeRule", () => { | ||
| it("fires when transformers are not installed", () => { | ||
| const n = embeddingsNudgeRule.evaluate(ctx({ embeddingsStatus: "no-transformers" })); | ||
| expect(n).not.toBeNull(); | ||
| expect(n!.id).toBe("embeddings-nudge"); | ||
| expect(n!.severity).toBe("warn"); | ||
| expect(n!.title).toBe("Semantic memory search is off — embeddings not enabled"); | ||
| expect(n!.body).toBe(EXPECTED_BODY); | ||
| expect(n!.dedupKey).toEqual({ v: 1 }); | ||
| }); | ||
|
|
||
| it("fires on the default install, where the flag is seeded false and reads as user-disabled", () => { | ||
| const n = embeddingsNudgeRule.evaluate(ctx({ embeddingsStatus: "user-disabled" })); | ||
| expect(n).not.toBeNull(); | ||
| expect(n!.body).toBe(EXPECTED_BODY); | ||
| }); | ||
|
|
||
| it("stays silent when embeddings are enabled", () => { | ||
| expect(embeddingsNudgeRule.evaluate(ctx({ embeddingsStatus: "enabled" }))).toBeNull(); | ||
| }); | ||
|
|
||
| it("stays silent when embeddingsStatus is not provided (treat as enabled)", () => { | ||
| expect(embeddingsNudgeRule.evaluate(ctx({}))).toBeNull(); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.