Validate tool inputs — when the model invents arguments — step 7 of 9
The validator now runs first — but on failure the dispatcher
raises ValueError instead of returning a string. That bubbles
up through the agent loop and crashes it. The model never sees
the error and can't self-correct.
Fix the dispatcher to RETURN a string on validation failure
(formatted as "VALIDATION_ERROR: <reason>") so the agent loop
can package it as a tool_result block and feed it back to the
model.
Expected output:
VALIDATION_ERROR: missing required field: q
The validator now runs first — but on failure the dispatcher
raises ValueError instead of returning a string. That bubbles
up through the agent loop and crashes it. The model never sees
the error and can't self-correct.
Fix the dispatcher to RETURN a string on validation failure
(formatted as "VALIDATION_ERROR: <reason>") so the agent loop
can package it as a tool_result block and feed it back to the
model.
Expected output:
VALIDATION_ERROR: missing required field: q
this step needs the editor
on desktop today; in the app (coming soon). save your spot and we'll bring you back here when you're ready.