Repository navigation
fix(agentic_rag): normalize structure answers - #19025
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe structure QA helper now handles missing, empty, and non-string answers explicitly. A new async unit test verifies numeric answer conversion and filtering of invalid relevant entities. ChangesStructure answer normalization
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change prevents valid non-string structure answers from aborting exploration while preserving existing empty-answer handling. No actionable merge-blocking risk remains after normal checks and review. Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #19025 +/- ##
==========================================
+ Coverage 30.43% 39.09% +8.65%
==========================================
Files 54 54
Lines 14911 14911
Branches 117 117
==========================================
+ Hits 4538 5829 +1291
+ Misses 10361 9056 -1305
- Partials 12 26 +14 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Problem
_ask_structureparses model output as arbitrary JSON but calls.strip()directly onverdict["answer"]after the protected parsing block. If the model returns a valid non-string JSON answer such as42, the resultingAttributeErrorescapes and aborts the knowledge-graph/compiled-structure exploration turn instead of returning the answer and relevant entities.This is a focused follow-up to the agentic search refactor in #19000.
Test plan
uv run --no-project --python 3.13 --with pytest --with pytest-asyncio --with json-repair pytest --confcutdir=test/unit_test/rag/advanced_rag test/unit_test/rag/advanced_rag/test_structure_qa.py -quvx ruff check test/unit_test/rag/advanced_rag/test_structure_qa.pyuvx ruff check --select E9,F63,F7,F82 rag/advanced_rag/harness/structure_qa.pyuvx ruff format --check rag/advanced_rag/harness/structure_qa.py test/unit_test/rag/advanced_rag/test_structure_qa.py