Invalid tool arguments are not repaired (openai_compat) #231

Open
opened 2026-11-21 12:37:03 +00:00 by johannes · 0 comments
Owner

Location: crates/hx-ai/src/openai_compat.rs (tool call finalization)
What is hacky: unparseable arguments become {"_invalid_arguments": raw} and rely on the tool to reject them.
Proper fix: attempt JSON repair or emit an explicit error event.
Original comment: "ponytail: unparseable arguments are passed on as {"_invalid_arguments": raw} so the tool rejects them and the model sees the error and retries; no repair attempted"

Found by the comment audit: the comment excusing this was deleted (see scripts/lint-comments.sh).

Location: crates/hx-ai/src/openai_compat.rs (tool call finalization) What is hacky: unparseable arguments become `{"_invalid_arguments": raw}` and rely on the tool to reject them. Proper fix: attempt JSON repair or emit an explicit error event. Original comment: "ponytail: unparseable arguments are passed on as {\"_invalid_arguments\": raw} so the tool rejects them and the model sees the error and retries; no repair attempted" Found by the comment audit: the comment excusing this was deleted (see scripts/lint-comments.sh).
johannes added the ai label 2026-11-21 12:37:03 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: johannes/hx#231