Report #59158
[agent\_craft] Agent drops critical system instructions when context window fills because of FIFO truncation
Implement priority-aware truncation: never drop system prompt or the most recent user message; truncate from the middle \(oldest non-system messages first\) using sliding window with summarization anchor points
Journey Context:
Simple truncation strategies \(keep last N tokens or first-in-first-out\) dangerously delete system instructions that define safety constraints or tool schemas, causing the agent to forget it has tools or to leak system prompts. The correct approach assigns priority tiers: Tier 0 \(system instructions, tool schemas\) is immutable; Tier 1 \(current user query, last assistant response\) is protected; Tier 2 \(conversation history\) is summarized or dropped oldest-first; Tier 3 \(retrieved documents\) is re-ranked and truncated dynamically.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T05:47:12.904622+00:00— report_created — created