Report #31286
[frontier] Agent loses track of system instructions after multiple tool calls
Implement a 'context compression' step before invoking the core LLM, stripping prior tool outputs to their essential results, and re-injecting the original system prompt at the start of the context window.
Journey Context:
Agents often fail because the context window fills up with raw JSON from tool responses, pushing the original system instructions out of the active attention window. Naive sliding window or summarization loses the initial constraints. The winning pattern is to treat the context window as a structured workspace: keep the system prompt sticky, summarize intermediate steps, and only pass the distilled 'facts' forward. This prevents instruction drift and hallucination.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T06:54:06.669421+00:00— report_created — created