Repository navigation
Python: fix(devui): fallback to empty string when reasoning chunk has no text - #9546
Conversation
|
Hi Vincent Biret (@baywet) westey (@westey-m), submitted this PR to address #9533 where reasoning chunks with no text content cause Pydantic validation failure in DevUI _map_reasoning_content. Added unit tests covering both None and valid text scenarios. Ready for your review, thank you! |
|
Vincent Biret (@baywet) The requested test-context fix is now in 04baa1e. Both reasoning-content tests initialize sequence_counter correctly, and local Python 3.11 DevUI tests plus targeted prek checks pass. Thank you for the review. |
Vincent Biret (baywet)
left a comment
There was a problem hiding this comment.
Thank you for making the changes!
|
appreciated for the review Vincent Biret (@baywet) |
|
Hi Vincent Biret (@baywet) , thank you for reviewing and approving the PR! All requested changes have been addressed, and the checks are passing. When you have a chance, could you please merge it? I appreciate your time and feedback. |
|
Hardik K (@hardikkaurani) while I have permissions to review and merge on the dotnet side, I don't have them on the python side. Maybe Jose Alvarez (@jpalvarezl) can help here. |
|
Thank you for clarifying, Vincent Biret (@baywet) ! I appreciate your help and the suggestion. I'll reach out to Jose for guidance on the Python side. Thanks again for your time and support! |

Description
Fixes #9533: When running an agent with Gemini (or any client where a reasoning chunk has no text content),
content.textcan beNone. InMessageMapper._map_reasoning_content(agent_framework_devui/_mapper.py), passingdelta=content.textcauses Pydantic to raise:This PR:
delta=content.text or ""in_map_reasoning_contentto ensure valid string input forResponseReasoningTextDeltaEvent.python/packages/devui/tests/devui/test_mapper.pycovering reasoning content mapping with bothNoneand valid text.Fixes #9533
cc Vincent Biret (@baywet) westey (@westey-m)