Report #7661
[architecture] Agent forgets its role or instructions after a long tool execution returns
Re-inject the agent's system prompt and identity at the start of every new turn or tool response, rather than relying on it remaining in the distant context window.
Journey Context:
An agent calls a tool that returns a massive payload. By the time the LLM processes the result, the original system prompt defining its persona is pushed out of the attention window. It then defaults to generic behavior or assumes the persona of the previous agent. Explicitly prepending the system prompt or using a strong 'Current Role: X' reminder grounds it. Tradeoff: Consumes tokens every turn, but prevents role drift.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T03:20:56.909178+00:00— report_created — created