In this article
Persist the actual tool-call evidence and use the documented parse method after reload instead of assuming a transient structured_output object survives storage.
Locate the structured fields in the tool call
An agent completes a repository assessment and supplies typed findings alongside its final message. OpenHands’ structured-output guide attaches a Pydantic model or JSON Schema through a tool’s response_schema. The fields augment what the model must supply when calling that tool. They are not an arbitrary JSON fragment extracted afterward from a natural-language answer.
Keep tool arguments and execution results distinct
The augmented tool keeps its own arguments. For example, a finishing tool still has its message while also accepting the assessment fields. The custom-tools guide distinguishes Action inputs, Observation results and Executor logic. That separation matters when naming the artifact: validated assessment fields supplied by the model are not automatically observations produced by a test runner. A well-formed finding can still be factually unsupported.
Reparse the recorded call after persistence
The guide recommends parse_last_response() for the latest matching call or parse_response(action) for a specific one. The former returns None when the tool has not been called. The transient action.structured_output value is not serialized and returns as None after a persistence round trip. The persistence guide restores event history; the parse methods re-read that call so structured fields can be recovered from the saved evidence.
Define fields within the supported boundary
Reserved names and collisions with existing tool argument names are rejected when the tool resolves. A schema belongs to an individual tool rather than a specification resolving to a tool set. Keep the assessment schema focused and do not reuse the finishing tool’s message field for a different purpose. If several calls can occur, select the intended action explicitly instead of accidentally reading a later assessment as the result of an earlier revision.
Verify structure and meaning separately
Check a saved-and-reloaded sample through the parse method, then compare the findings with the relevant source and executed checks. The response-contract guide distinguishes structural acceptance from useful output; tool observations tie claims to actual results. Report an absent call separately from an empty valid assessment. Successful parsing establishes the declared shape, while review establishes whether those fields describe the repository correctly.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.