Report #17287
[agent\_craft] Agent loses track of conversation state across multiple turns, repeating already-completed steps
Use a 'stateful system prompt' template with three sections: 1\) Static persona/rules \(top\), 2\) Dynamic \`\` block \(middle, updated each turn with completed\_tasks list, current\_file, remaining\_steps\), 3\) Output format rules \(bottom\). Enforce that the agent must acknowledge state changes by referencing the current\_state block in its response.
Journey Context:
Stateless prompts treat each turn independently, causing the agent to 'forget' it already created the file in turn 1 when executing turn 3. Explicit state blocks act as working memory, similar to registers in a CPU. Tradeoff: Token overhead for state serialization \(can be 10-20% of context\) vs coherence. Critical implementation: The state must be in the MIDDLE of the prompt \(not end\) to avoid 'lost in the middle' truncation, or repeated at both start and end.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T04:54:45.933258+00:00— report_created — created