activeloopai / activeloopai/hivemind

Embeddings silently disabled for upgrading users (HIVEMIND_EMBEDDINGS unset → enabled=false)

Đang mở
#184 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
1.6k
Fork
107
Merge trung bình
17 giờ 30 phút
Pull request đã merge (30 ngày)
6

Mô tả

## Symptom

Users upgrading past `bfc8e07` (and fresh installs that don't set `HIVEMIND_EMBEDDINGS=true`) get embeddings **persistently disabled** on first SDK call. `~/.deeplake/config.json` ends up with `{embeddings: {enabled: false}}` forever — until the user explicitly runs `hivemind embeddings install` (which writes `enabled: true`).

## Root cause

`src/user-config.ts:67` documents the migration rule as:

```
HIVEMIND_EMBEDDINGS=false OR unset → enabled: false
HIVEMIND_EMBEDDINGS=true (or any other truthy) → enabled: true
```

And `migrationValueFromEnv()` at line 96 implements that literally:

```ts
if (raw === undefined) return false;
```

So on first call to `getEmbeddingsEnabled()` (no config yet, env var unset), it returns `false` and persists that to disk. The decision becomes sticky.

## Impact

- Users who had working embeddings before upgrading silently lose semantic memory search
- No banner fires because the embeddings-broken signal is the one we removed in #182
- Discovery requires the user to notice grep/recall feels degraded and find the CLI command

## Suggested fix

Per CodeRabbit on #182:

```diff
function migrationValueFromEnv() {
const raw = process.env.HIVEMIND_EMBEDDINGS;
- if (raw === undefined) return false;
+ if (raw === undefined) return undefined;
if (raw === "false") return false;
return true;
}
```

And update `getEmbeddingsEnabled()` to treat `undefined` from migration as "default true" (no opt-out signal present).

## Why not in PR #182

#182's scope is the user-visible banner removal. Changing the migration default touches Emanuele's intentional design rule (`bfc8e07`) — needs his judgment call on opt-in vs opt-out.

## Related

- PR #182 (banner removal) — surfaces this regression because there's now no audible "embeddings off" signal
- `bfc8e07` (feat(embeddings): hello handshake + stuck-daemon recycle + visible signal) — where the rule was introduced
- @emanuele-fenocchi-activeloop's call on the design

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.