Skip to content

fix(whoami): convert retrieval scores to float - #876

Merged
maciejmajek merged 1 commit into
RobotecAI:mainfrom
INo-xious:whoami-score-serialization
Oct 12, 2026
Merged

maciejmajek merged 1 commit into
RobotecAI:mainfrom
INo-xious:whoami-score-serialization

Conversation

@INo-xious

Copy link
Copy Markdown
Contributor

Purpose

Fix WhoAmI documentation retrieval failing when FAISS returns NumPy floating-point scores that the generated ROS response rejects.

Proposed Changes

  • Convert each score with float() at the ROS response boundary, preserving values and document ordering.
  • Add regression coverage using the real callback and generated VectorStoreRetrieval.Response for NumPy float32 scores, Python floats, and empty results. Explicitly enable field validation on generators where it is optional.

Issues

Addresses the score serialization failure in #565.

Testing

  • ROS Jazzy, Python 3.12, with rai_interfaces built from source.
  • python -m pytest tests/rai_whoami/test_vector_store_retrieval_agent.py --timeout=60: before the fix, 1 failed with the reported score assertion and 2 passed; after the fix, all 3 passed.
  • Live ROS service round trips with the real connector and mocked retrieval: all 3 cases passed with field validation enabled.
  • pre-commit run --all-files: all 13 hooks passed, including Ruff and formatting.
  • uv lock --check and git diff --check passed.
  • Humble and the full repository suite were not run.

@INo-xious INo-xious changed the title fix(whoami): serialize retrieval scores as Python floats fix(whoami): convert retrieval scores to float Sep 29, 2026
@codecov

codecov Bot commented Oct 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.61%. Comparing base (6802d40) to head (a57f20b).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #876   +/-   ##
=======================================
  Coverage   74.61%   74.61%           
=======================================
  Files          83       83           
  Lines        3652     3652           
=======================================
  Hits         2725     2725           
  Misses        927      927           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@maciejmajek
maciejmajek merged commit b018729 into RobotecAI:main Oct 12, 2026
11 checks passed
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.

2 participants