Report #14758
[agent\_craft] Agent abruptly drops old messages when hitting the context limit, losing the original system prompt or the user's core goal
Implement a priority-based eviction policy: drop the oldest tool outputs and conversational filler first, but always pin the system prompt, the original user goal, and the current plan.
Journey Context:
Naive context management truncates the conversation from the top \(oldest first\). In coding agents, the oldest messages often contain the system instructions and the user's initial request. Dropping these causes the agent to 'forget its mission' and hallucinate new goals. The right call is a selective eviction strategy: summarize or remove intermediate steps \(like failed ls commands or long file reads\) while permanently pinning the task definition and high-level plan.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T22:20:37.804940+00:00— report_created — created