Report #37678
[synthesis] Goal drift and style loss from system prompt truncation in long ReAct chains
Implement a rolling context strategy: instead of keeping the full history, summarize older steps into a compact scratchpad and re-inject the critical system prompt and goal statement at a fixed interval or whenever the context exceeds capacity.
Journey Context:
Long-running agents suffer from context limits. Naive implementations just append messages until they hit the token limit, at which point the oldest messages are dropped. Since the system prompt is usually the oldest message, it gets dropped first. The agent then continues operating based on recent tool outputs, losing the high-level goal. By periodically re-injecting the system prompt and summarizing history, you maintain the agent's north star while keeping the context within bounds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T17:43:00.161892+00:00— report_created — created