Skip to content

fix: control plane UI fixes for recall and data view#692

Closed
nicoloboschi wants to merge 4 commits intomainfrom
fix/recall-metadata-null
Closed

fix: control plane UI fixes for recall and data view#692
nicoloboschi wants to merge 4 commits intomainfrom
fix/recall-metadata-null

Conversation

@nicoloboschi
Copy link
Collaborator

Summary

  • NaN score crash: Cross-encoder can return NaN scores which Pydantic serializes as JSON null, crashing the search debug view (score.toFixed(3) on null). Fixed by sanitizing NaN to 0.0 in the reranking pipeline and adding a null-coalesce in the UI.
  • Data view filter UX: Text filter was firing a debounced ILIKE query on every keystroke — unusable for large banks (100k+ memories). Switched to search-on-Enter with a loading spinner in the search icon.
  • Load more losing filters: "Load more" button didn't pass the active search/tag filters, resetting the view.

Test plan

  • Recall a bank with trace enabled, verify scores are numeric (not null) in the debug view
  • Open a large bank's data view, type a filter and press Enter — verify spinner shows and results filter correctly
  • With an active filter, click "Load more" — verify filter is preserved

Metadata stored during retain was never retrieved during recall.
Add metadata to all SQL SELECT queries, the RetrievalResult dataclass,
ScoredResult.to_dict(), and MemoryFact construction in the recall pipeline.
Replace placeholder metadata test with one that actually passes
metadata via retain_batch_async and asserts it is returned on recall.
asyncpg may return JSONB columns as strings. Add a field_validator
to MemoryFact.metadata to handle JSON string deserialization.
- Sanitize NaN cross-encoder scores to 0.0 in reranking pipeline
  (Pydantic serializes NaN as JSON null, breaking UI score display)
- Add null-coalesce for score in search debug view to prevent crash
- Switch data view text filter from debounced onChange to Enter key
  (avoids slow ILIKE queries on every keystroke for large banks)
- Show loading spinner in search icon during filter requests
- Preserve search/tag filters when clicking "Load more"
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.

1 participant