Retry a tool call whose validation error input isn't JSON
Draft
AD
16d ago+44+44+01234567890123456789-2-2-0123456789
- A tool whose body builds a pydantic dataclass with a failing
__post_init__ended the whole run withPydanticSerializationError: Unable to serialize unknown type: ArgsKwargs, while a plain field error is retried as intended. - Why: that
ValidationErrorcarries the constructor call as anArgsKwargsin itsinput, and_dump_error_detailsdumps error details to JSON, which has no form for it. - Fix:
_dump_error_detailspassesfallback=str, so such aninputis shown as text ("ArgsKwargs((), {'a': 0})") and the call is retried like any other validation error. - Tests:
test_a_validation_error_whose_input_is_not_json_is_retriedfails onmainand passes here. - Can merge alone. Merge order: any time.
What to look at:
- Whether text is the right form for any non-JSON
inputthe model sees in retry feedback.
š¤ Generated with Claude Code