Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
4 changes: 2 additions & 2 deletions harnesses/cursor/extension/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion harnesses/cursor/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "hivemind-cursor-extension",
"displayName": "Hivemind for Cursor",
"description": "Shared memory, health checks, dashboard, and codebase graph inside Cursor",
"version": "0.1.4",
"version": "0.1.5",
"publisher": "deeplake",
"engines": {
"vscode": "^1.85.0"
Expand Down
30 changes: 25 additions & 5 deletions src/shell/grep-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -633,10 +633,30 @@ export async function grepBothTables(
queryEmbedding?: number[] | null,
): Promise<string[]> {
const meta = { truncated: false };
const rows = await searchDeeplakeTables(api, memoryTable, sessionsTable, {
...buildGrepSearchOptions(params, targetPath),
queryEmbedding,
}, meta);
const baseOptions = buildGrepSearchOptions(params, targetPath);
let usedEmbedding = queryEmbedding ?? null;
let rows: ContentRow[];
try {
rows = await searchDeeplakeTables(api, memoryTable, sessionsTable, {
...baseOptions,
queryEmbedding,
}, meta);
} catch (e) {
// Semantic search can fail at the DB level (e.g. inconsistent
// summary_embedding dimensions in the memory table -> "Can't stack
// arrays with different dimensions"). Rather than give up on recall,
// retry once with lexical search so memory still resolves. Auto-recovers
// when the embedding column is re-indexed.
if (queryEmbedding && queryEmbedding.length > 0) {
usedEmbedding = null;
rows = await searchDeeplakeTables(api, memoryTable, sessionsTable, {
...baseOptions,
queryEmbedding: null,
}, meta);
} else {
throw e;
}
}
// Defensive path dedup — memory and sessions tables use disjoint path
// prefixes in every schema we ship (/summaries/… vs /sessions/…), so the
// overlap is theoretical, but we dedupe to match grep-interceptor.ts and
Expand All @@ -651,7 +671,7 @@ export async function grepBothTables(
// pattern (the whole point of semantic). Return every non-empty normalized
// line from the top-K rows, prefixed with the path so Claude can follow up
// with Read. The downstream output-cap keeps the response bounded.
if (queryEmbedding && queryEmbedding.length > 0) {
if (usedEmbedding && usedEmbedding.length > 0) {
const emitAllLines = process.env.HIVEMIND_SEMANTIC_EMIT_ALL !== "false";
if (emitAllLines) {
const lines: string[] = [];
Expand Down
Loading