Repository navigation
fix: pass metadata through remember_with_contradiction (#682 follow-up) - #686
Merged
Merged
Conversation
remember_with_contradiction() was silently dropping all metadata (entity, category, custom key:value, source) because it hardcoded None when calling remember_precomputed(). This affected both the HTTP handler (POST /remember with detect_contradiction=true) and the CLI (uteke remember --detect-contradiction). Fix: - Add metadata parameter to remember_with_contradiction() in consolidate.rs - Pass metadata from handlers.rs detect_contradiction branch - Pass metadata from CLI remember.rs detect_contradiction branch - Add test_metadata_value_serialization (non-ignore, runs in CI) - Add test_contradiction_remembers_metadata (ignore, needs ONNX embedder)
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-cli · BYOK · MIT |
metadata is moved into remember_with_contradiction() but also borrowed later for JSON output. Use .clone() to avoid borrow-after-move error.
- Allow clippy::too_many_arguments on remember_with_contradiction (8 params is reasonable for this public API) - Simplify test_metadata_value_serialization to avoid literal Some/None unwrap_or patterns that clippy flags
ajianaz
merged commit
Summary
Follow-up to #682 —
remember_with_contradiction()was silently dropping all metadata (entity, category, custom key:value, source) because it hardcodedNonewhen callingremember_precomputed().Problem
After #682 added metadata fields to
POST /remember, only the normal path (without contradiction detection) passed metadata through. Thedetect_contradiction=truebranch calledremember_with_contradiction()which internally did:This affected:
POST /rememberwithdetect_contradiction: true— all metadata fields ignoreduteke remember --detect-contradiction— entity, category, metadata all droppedFix
consolidate.rs: Addmetadataparameter toremember_with_contradiction(), pass it toremember_precomputed()handlers.rs: Pass builtmetadatamap toremember_with_contradiction()(was only passed to the else branch)remember.rs: Passmetadatatoremember_with_contradiction()(was dropped)Tests
test_metadata_value_serialization(consolidate)test_contradiction_remembers_metadata(operations)#[ignore](needs ONNX)4 pre-existing
dreamtest failures (needonnxfeature, unrelated).Closes #682