Report #66847
[frontier] How do I replace fragile string parsing for inter-agent communication with something that fails at compile-time rather than runtime?
Use Pydantic models \(or JSON Schema\) as the 'wire format' between agents. Define strict \`BaseModel\` classes for request/response, use \`response\_format=\{'type': 'json\_object', 'schema': ...\}\` \(OpenAI\) or A2A's \`Part\` schemas, and validate at the boundary. Never parse agent output with regex.
Journey Context:
Agents sending natural language to each other suffer from 'prompt brittleness'—subtle output changes break parsing. The 2025 shift is treating agent boundaries like microservices: strict OpenAPI-style contracts. OpenAI's Structured Outputs \(json\_schema mode\) and A2A's typed Parts enforce this at the transport layer. This enables static analysis of agent workflows and prevents hallucinated JSON keys. Tradeoff: requires upfront schema design and handling schema migration, but eliminates runtime parsing errors.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T18:40:53.667598+00:00— report_created — created