fix(core): name EMBEDDING_PROVIDER in the mock-embedding warning (UF-058)

When no embedding provider answers, the banner told users to set
HIVE_MIND_EMBEDDING_PROVIDER, which only the hive-mind CLI read; Waggle
reads EMBEDDING_PROVIDER. A test checks the banner text.
This commit is contained in:
shumeiko.it
2026-11-01 00:43:05 +01:00
parent c098f20872
commit 9276723f25
3 changed files with 28 additions and 2 deletions

View File

@@ -86,6 +86,7 @@ Baseline: commit `b20b138` of `git.os-dev.tech/oleg.m/waggle-os`.
| UF-055 | Home greets the user by the assistant's name | Fixed | Sidecar, Web UI | | UF-055 | Home greets the user by the assistant's name | Fixed | Sidecar, Web UI |
| UF-056 | Home calls the last 24 hours "While you slept" | Fixed | Web UI | | UF-056 | Home calls the last 24 hours "While you slept" | Fixed | Web UI |
| UF-057 | At phone width the sidebar rail takes a fifth of the screen | Fixed | Web UI | | UF-057 | At phone width the sidebar rail takes a fifth of the screen | Fixed | Web UI |
| UF-058 | The mock-embedding warning names a variable Waggle does not read | Fixed | Sidecar, embeddings |
## Entries ## Entries
@@ -575,3 +576,12 @@ Entries UF-010 to UF-019 come from the UI audit `anti-slop/audit-001-2026-10-14.
- Cause: the layout has two states, the icon rail and the full sidebar; nothing replaces the rail on a phone, and the Home heading and padding keep their desktop minimums. - Cause: the layout has two states, the icon rail and the full sidebar; nothing replaces the rail on a phone, and the Home heading and padding keep their desktop minimums.
- What we did: below 640px the rail is hidden and a bottom bar carries the five places plus "More", which opens ⌘K for everything else. Every target is at least 56px tall, the bar respects the safe-area inset, and the canvas stops above it. Home uses 16px side padding and a 28px minimum heading on phones. A test covers the bar. - What we did: below 640px the rail is hidden and a bottom bar carries the five places plus "More", which opens ⌘K for everything else. Every target is at least 56px tall, the bar respects the safe-area inset, and the canvas stops above it. Home uses 16px side padding and a 28px minimum heading on phones. A test covers the bar.
- Recommendation: apply the same change in the main project. - Recommendation: apply the same change in the main project.
### UF-058. The mock-embedding warning names a variable Waggle does not read
- Status: Fixed
- Found: 2026-11-01
- Where: at commit `b20b138`, `packages/hive-mind-core/src/mind/embedding-provider.ts:422`, re-exported by `@waggle/core` and used by the sidecar; the sidecar reads the provider from `EMBEDDING_PROVIDER` (`packages/core/src/config.ts:254`)
- Symptom: when no embedding provider is reachable, the sidecar prints a banner that suggests `HIVE_MIND_EMBEDDING_PROVIDER=inprocess`. Setting it changes nothing, and memory search keeps running on mock vectors.
- Cause: the banner was written for the hive-mind CLI, which reads `HIVE_MIND_EMBEDDING_PROVIDER`; Waggle reuses the provider factory but reads `EMBEDDING_PROVIDER`.
- What we did: the banner in `packages/core/src/embeddings/embedding-provider.ts` now suggests `EMBEDDING_PROVIDER=inprocess`. A test checks the banner text.
- Recommendation: name `EMBEDDING_PROVIDER` in the banner when the factory runs inside Waggle, or let the caller pass the variable name.

View File

@@ -344,7 +344,7 @@ export async function createEmbeddingProvider(config?: EmbeddingProviderConfig):
' Then ensure the process can reach http://localhost:11434.', ' Then ensure the process can reach http://localhost:11434.',
'', '',
' Alternative providers:', ' Alternative providers:',
' HIVE_MIND_EMBEDDING_PROVIDER=inprocess (downloads 23MB)', ' EMBEDDING_PROVIDER=inprocess (downloads 23MB)',
' VOYAGE_API_KEY=... (paid, recommended)', ' VOYAGE_API_KEY=... (paid, recommended)',
' OPENAI_API_KEY=... (paid)', ' OPENAI_API_KEY=... (paid)',
'─────────────────────────────────────────────────────────────', '─────────────────────────────────────────────────────────────',

View File

@@ -2,7 +2,7 @@
* createEmbeddingProvider tests: the generic mock fallback, dimension respect, * createEmbeddingProvider tests: the generic mock fallback, dimension respect,
* deterministic-vector behavior, batch shape and the reprobe contract. * deterministic-vector behavior, batch shape and the reprobe contract.
*/ */
import { describe, it, expect } from 'vitest'; import { describe, it, expect, vi } from 'vitest';
import { import {
createEmbeddingProvider, createEmbeddingProvider,
capEmbedText, capEmbedText,
@@ -12,6 +12,22 @@ import {
import type { Embedder } from '../../src/embeddings/embeddings.js'; import type { Embedder } from '../../src/embeddings/embeddings.js';
describe('createEmbeddingProvider', () => { describe('createEmbeddingProvider', () => {
it('names the environment variable Waggle reads in the mock fallback banner', async () => {
const previous = process.env.WAGGLE_SUPPRESS_EMBEDDING_WARNING;
delete process.env.WAGGLE_SUPPRESS_EMBEDDING_WARNING;
const write = vi.spyOn(process.stderr, 'write').mockImplementation(() => true);
try {
await createEmbeddingProvider({ provider: 'mock' });
const banner = write.mock.calls.map(([chunk]) => String(chunk)).join('');
expect(banner).toContain('EMBEDDING_PROVIDER=inprocess');
expect(banner).not.toContain('HIVE_MIND_EMBEDDING_PROVIDER');
} finally {
write.mockRestore();
if (previous === undefined) delete process.env.WAGGLE_SUPPRESS_EMBEDDING_WARNING;
else process.env.WAGGLE_SUPPRESS_EMBEDDING_WARNING = previous;
}
});
it('falls back to mock when provider=mock is requested explicitly', async () => { it('falls back to mock when provider=mock is requested explicitly', async () => {
const provider = await createEmbeddingProvider({ provider: 'mock' }); const provider = await createEmbeddingProvider({ provider: 'mock' });
expect(provider.getActiveProvider()).toBe('mock'); expect(provider.getActiveProvider()).toBe('mock');