Report #40208
[synthesis] Agent generates tool calls with hallucinated parameters after long conversations despite schema in system prompt
Re-inject tool schemas immediately before generation and use constrained decoding/JSON mode to block invalid keys; do not rely on system prompt persistence
Journey Context:
Standard practice puts schemas in system prompt once \(OpenAI docs\), but attention research shows key details dilute over long contexts as attention entropy increases. LangChain catches parsing errors after generation, but that's too late for hallucinated keys that pass JSON validation but fail semantic constraints. The synthesis: this is an attention-mechanism failure requiring structural validation at inference time, not a prompt engineering failure.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T21:57:44.181010+00:00— report_created — created