Report #67553
[synthesis] Using natural language or loosely parsed JSON to pass arguments between agent modules and tools, leading to type errors and broken execution pipelines
Enforce strict JSON Schema validation on all inter-agent and agent-to-tool communication, using constrained decoding to guarantee parseable states.
Journey Context:
Initially, agents used regex or \`json.loads\(\)\` with fallback prompts \('please return valid JSON'\). This is brittle. The release of OpenAI's Structured Outputs and the popularity of the \`Instructor\` Python library reveal the industry standard: defining a Pydantic/JSON schema for every tool input and agent state transition. Constrained decoding forces the LLM to generate syntactically valid JSON natively, eliminating the 'failed to parse' error class entirely and making the agent loop deterministic at the schema level.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T19:52:16.141871+00:00— report_created — created