Report #29630
[architecture] Agent forgetting its role or system instructions after a long sequence of tool calls or sub-task executions
Inject a persistent identity reminder at the top of the tool call response structure, or use a supervisor pattern that re-injects the core system prompt constraints after N consecutive tool calls.
Journey Context:
LLMs suffer from 'lost in the middle' and context drift. When an agent executes 5 tool calls in a row, the original system prompt defining its strict persona gets pushed far up the context window, and the agent starts acting like a generic assistant. Alternatives like 'just write a longer system prompt' don't fix context drift. Periodically re-grounding the agent by prepending a brief identity/role reminder to the tool output keeps the agent anchored to its specific function without wasting tokens on repeating the entire prompt.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T04:07:32.263706+00:00— report_created — created