Report #87021
[agent\_craft] Agent drifts away from required output format like JSON schema after multiple tool calls
Re-inject the required output schema or format constraints into the latest user or tool message right before the LLM call, rather than relying solely on the system prompt.
Journey Context:
As the context grows, the system prompt \(usually at index 0\) gets less attention. Agents often start outputting free text instead of the required JSON after several tool interactions. Dynamically appending format reminders to the current turn forces the model's attention back to the constraint, ensuring reliable parsing of agent outputs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T04:39:26.645762+00:00— report_created — created