Repository navigation
fix: handle uteke v0.1.0 empty results format in recall parser - #275
Merged
Merged
Conversation
Uteke v0.1.0+ changed empty results format:
- Before (v0.0.13): bare [] when no results
- After (v0.1.0): {"message":"...","results":[],"threshold":0.3,...}
Extracted parse_recall_json() to handle both:
1. Bare JSON array: [{"memory":{"content":"..."},...}]
2. Wrapped object: {"results":[{"memory":{"content":"..."},...}]}
3. Empty wrapped: {"message":"No memories...","results":[]}
6 new unit tests covering all formats + edge cases.
All 523 tests pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug Fix: uteke v0.1.0 empty results compatibility
Problem
Uteke v0.1.0 changed the empty results JSON format:
[](bare array){"message":"No memories above similarity threshold","results":[],"threshold":0.3,"total":0}Cora's parser only handled bare
[]. On empty results from v0.1.0, it would silently swallow and return 0 memories (not a crash, but misleading — looked like recall was broken).Fix
Extracted
parse_recall_json()function that handles all formats:[{"memory":{"content":"..."},"score":0.x}]{"results":[{"memory":{"content":"..."},...}]}{"message":"...","results":[],"threshold":0.3}Tests Added (6 new)
Verification Matrix
--json[]--json{"results":[]}All 523 tests pass. Clippy clean.