Retry a tool call whose validation error input isn't JSON

Draft
AD
16d ago
+44-2
  • A tool whose body builds a pydantic dataclass with a failing __post_init__ ended the whole run with PydanticSerializationError: Unable to serialize unknown type: ArgsKwargs, while a plain field error is retried as intended.
  • Why: that ValidationError carries the constructor call as an ArgsKwargs in its input, and _dump_error_details dumps error details to JSON, which has no form for it.
  • Fix: _dump_error_details passes fallback=str, so such an input is 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_retried fails on main and passes here.
  • Can merge alone. Merge order: any time.

What to look at:

  • Whether text is the right form for any non-JSON input the model sees in retry feedback.

šŸ¤– Generated with Claude Code