Files
splinter/tests
lotherk 6b560e63a0 agent: validate tool-call arguments before they enter the conversation
A model step with arguments like "{command:cd ..." is not JSON. Splinter
accepted it, ran "sh -c {command:cd ..." (exit 127), then sent the bad
assistant tool_call back on the next request: every endpoint answered 500
"Failed to parse tool call arguments as JSON" and junction cooled all four.

Arguments that start with '{' must parse now. If they do not, the reply is
freed without adding the assistant message or running a tool; the request is
retried up to three times and then fails with "model sent malformed tool
arguments". A bare string (mock/script shape) is still allowed.

test_agent drives a transport with exactly that malformed call: three requests,
zero tool calls, no "command:bad" in the conversation.

make check: all tests passed.
2026-11-18 15:45:42 +00:00
..
2026-11-17 23:21:56 +00:00