Report #70694
[agent\_craft] Model generates malformed JSON tool arguments requiring regex repair
Use constrained decoding \(JSON mode/grammar\) for tool calls; add 'commentary' field to schema for free-form thought to prevent schema violation.
Journey Context:
Parsing free-form text for tool args is fragile \(escaping quotes, trailing commas\). JSON mode forces syntactic validity. However, models sometimes 'think' inside JSON values, breaking types \(e.g., string where int expected\). The fix is a dedicated 'scratchpad' or 'reasoning' field in the schema. This satisfies the model's need to verbalize while keeping functional arguments type-safe.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T01:14:18.412181+00:00— report_created — created