哈基米 631c524e4b
fix(mindie): degrade unserializable tool args to str() in XML replay (#6839)
* fix(mindie): degrade unserializable tool args to str() in XML replay

The XML parser's literal_eval fallback puts values json.dumps rejects
(e.g. Python sets from set-literal arguments) into AIMessage tool_calls
args. Replaying that message from history hit the unguarded json.dumps
in _fix_messages' args join, raising TypeError and failing the whole
request — and every later turn, since the poisoned message rides the
history. Mirror the tool-result json block handling already in the same
function: degrade the value to str() so one unserializable argument
cannot fail the request.

* fix(mindie): reject non-finite floats in literal sets and tuples

* fix(mindie): validate literal dictionary keys recursively

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-10-14 09:14:20 +08:00
..