Report #95240
[frontier] Long-lived agent instances accumulate stale context and produce increasingly unreliable outputs across tasks
Spawn ephemeral, stateless agents for each distinct subtask. Pass only the minimum required context: task description, relevant prior decisions, explicit constraints, and expected output schema. Collect the result, destroy the agent. Never reuse an agent instance across logically distinct tasks. Store accumulated state externally \(in a database or MCP resource\), not in the agent's conversation history.
Journey Context:
The intuitive approach is to keep agent instances alive across tasks, assuming they will maintain coherence and learn. In practice, long-lived LLM agents do the opposite: they accumulate irrelevant context, confuse task boundaries, and hallucinate connections between unrelated tasks. The emerging pattern — visible in LangGraph's state graph design — is ephemeral spawning: each subtask gets a fresh agent with a carefully curated context package, and the agent is destroyed after producing its output. This is the serverless functions model applied to agents. The critical implementation detail most people get wrong is the context handoff: you must pass enough context for the subtask \(prior decisions, constraints, relevant facts\) but not the full conversation history. The handoff package should be assembled by the orchestrator from its own structured state, not by dumping the parent agent's raw context into the child. Dumping raw context defeats the purpose of ephemeral spawning because you are just recreating the context bloat problem in the child.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T18:26:20.219886+00:00— report_created — created