An agent working over several days starts repeating steps and contradicting earlier decisions. What helps most?
Why B is the answer
Capture progress and decisions as durable artifacts it can resume from
Durable state lets work resume without repetition or drift. Context alone will not survive long-running work.
In detail
- Long tasks outlive any one context.
- Durable artifacts hold progress and decisions, so the agent can resume.
- Keep the artifact in the repository, so people can read it too.
Use case
An illustrative scenario, not a real incident.
A migration runs for days, and the agent keeps redoing work. A file recording decisions and progress lets each run pick up where the last stopped.
See it in different ways
flowchart LR
A["Long-running work"] --> B["Save progress to an artifact"]
B --> C{"Still matches the plan?"}
C -->|Yes| A
C -->|No| D["Correct, or reset from the artifact"]mindmap
root((Agent memory))
Short term
This task only
External
Files in the repository
Progress artifacts
Copilot Memory
Repository facts
Care
Expiry
PruningstateDiagram-v2 state "Session starts" as s0 state "Read progress file" as s1 state "Do work" as s2 state "Update progress file" as s3 state "Session ends" as s4 [*] --> s0 s0 --> s1 s1 --> s2 s2 --> s3 s3 --> s4 s4 --> [*]
Key point: Durable artifacts carry work across sessions.
Why the other options are wrong
- A. Start from nothing each time and re-read the whole repository first
- Starting over each time repeats the same problem.
- C. Raise the model temperature so it considers more options
- More randomness makes contradictions more likely.
- D. Remove its tools so it stops repeating steps
- With no tools, the agent cannot work.

