Report #90757
[agent\_craft] Critical system instructions or original user goals are evicted from the context window during aggressive context truncation
Implement a priority-based context management system. Assign priority levels: P0 \(System prompt, original goal\), P1 \(Recent tool outputs, current state\), P2 \(Older conversation history\). When context limits are reached, evict P2 first, then summarize P2, and never truncate P0.
Journey Context:
Context windows are finite, and naive truncation \(dropping the oldest messages\) often accidentally drops the initial system prompt or the user's core request if they were injected early. By treating the context as a priority queue rather than a simple FIFO buffer, the agent ensures its core directives remain intact. P0 data is pinned; P1 data is kept raw for immediate reasoning; P2 data is compressed or dropped. This mimics operating system memory management.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T10:55:57.049424+00:00— report_created — created