Skip to content

fix(memory): verify embedding models and report recall fallback - #173

Merged
Grivn merged 1 commit into
masterfrom
codex/fix-embedding-status-172
Oct 26, 2026
Merged

Grivn merged 1 commit into
masterfrom
codex/fix-embedding-status-172

Conversation

@Grivn

@Grivn Grivn commented Oct 26, 2026

Copy link
Copy Markdown
Member

What

When Ollama is running but the configured model is missing, embed --status currently reports embedding_available: true and recall silently loses vector similarity. Status now checks the selected model with a small synthetic embedding request; the legacy ollama_available field retains its existing provider-availability meaning. A failed query embedding prints one actionable stderr warning while recall still returns its normal JSON results.

The extra model probe is limited to the explicit status command. Normal recall keeps its existing request count. Status can load the model and may incur a provider request charge; no stored memories are sent. English and Chinese usage docs explain the distinction between model availability and stored coverage.

Why

Fixes #172. Discovery success alone does not establish that the selected model can produce a vector, even when stored embedding coverage is 100%.

Validation

  • Reproduced the false status and silent fallback with failing regressions before the fix.
  • Local HTTP tests cover Ollama and OpenAI-compatible providers, missing/malformed/empty vectors, unavailable discovery, providers without a models route, explicit model overrides, and 100% stored coverage.
  • Recall tests cover compact, brief and verbose projections, retained lexical results, healthy vector similarity, one warning per failure, no echoed provider content, and no extra recall requests.
  • make test (including go vet ./...) and go build -o mnemon . pass.
  • Built-CLI smoke test with a temporary store and local mock: missing model reports false availability at 100% coverage, recall preserves its result with a stderr warning, and healthy embedding restores similarity without warnings. No real provider calls.

Release-note impact: embedding diagnostics now detect unusable selected models; failed query embeddings are visible without breaking recall JSON output.

Checklist

  • Deterministic tests pass (make test)
  • Relevant CLI behavior verified with a focused built-product smoke test; Agency process/Docker boundaries are unaffected
  • New/changed behavior is covered by tests
  • English and Chinese usage documentation updated
  • User-facing release-note impact described

Probe the selected model in embed --status while retaining the legacy provider availability field. Report failed query embeddings on stderr and continue recall without vector similarity, preserving JSON output and existing request counts.

Cover missing and invalid models, provider failures, model overrides, stored coverage, and all recall projections with local HTTP regressions. Verified make test, the product build, and a synthetic CLI fallback/recovery smoke test.
@Grivn
Grivn merged commit fb3f186 into master Oct 26, 2026
2 checks passed
@Grivn
Grivn deleted the codex/fix-embedding-status-172 branch October 30, 2026 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] embedding_available=true when the configured model is missing; recall silently drops similarity to 0

1 participant