Topic 4 of 5 · 4 min read
Re-planning when an assumption breaks
Goal: Revise the remaining steps of a plan after a failed step so the agent keeps finished work and routes around the blocker.
When a step fails because an assumption was wrong, keep the finished steps, name the broken assumption and rewrite only the steps that depended on it. Do not restart, and do not push on as if nothing happened.
Check yourself · 1 of 3
A plan step fails because an API does not support a parameter the plan assumed. What is the best first move?
Why it matters
Every plan rests on guesses: the library has this method, the table has that column, the API returns this shape. The agent wrote the plan before it knew. When reality disagrees, an agent tends to do one of two bad things. It repeats the failing step with small changes, or it throws the plan away and starts over, redoing work that was fine. The first wastes budget. The second loses progress and often repeats the original mistake.
How to re-plan
- Notice the break. Signals: a step fails for a reason the plan did not expect, a tool result contradicts a note, or the same step has failed twice. Two identical failures are a signal to stop retrying.
- Name the assumption. Write one sentence: "I assumed
/v1/userssupports filtering by email; it returns 400 for that parameter." - Check what still holds. Which finished steps are still valid? Which pending steps depended on the broken assumption? Only the dependent steps need rewriting.
- Find a route around. Another endpoint, a different library, a smaller scope, or a question to the person who owns the decision.
- Write the revised plan, with the change marked. Keep the done items, mark changed items and say why. Then continue.
- Re-check the goal. If the new route changes what the user gets, ask before going on.
Before and after
Original plan:
1. [done] Add EmailFilter component
2. [failed] Call GET /v1/users?email=... (400: unknown parameter)
3. [pending] Show filtered rows
4. [pending] Add test for filtered rows
Revised plan (assumption: the API filters by email - false):
1. [done] Add EmailFilter component (kept)
2. [changed] Fetch GET /v1/users?search=... which the docs list as supported. Check: curl returns 200
3. [pending] Show filtered rows (unchanged)
4. [pending] Add test using the search parameter (changed)
Step 1 survives. The plan is revised in place, not restarted.
What goes wrong
- Silent drift. The agent changes the approach and does not say so; the final summary no longer matches the plan you approved.
- Plan inflation. Each failure adds five steps and the plan grows past the goal.
- Sunk-cost pushing. The agent keeps patching a route that cannot work.
- Over-restart. Finished, valid work is deleted because a fresh start feels cleaner.
- Goal change without asking. The detour quietly drops a requirement, such as filtering by email.
Examples
The method that does not exist
The plan calls client.listAll(). The run fails: listAll is not a function. The agent reads the installed package and finds client.list({ cursor }). It records the false assumption, rewrites the one step that used it, adds a pagination loop, and leaves the three finished steps alone.
When the detour changes the goal
The only supported way to filter users is a paid API tier. The route around would be filtering in the browser, which loads every user. That changes cost and privacy, so the agent stops and asks instead of choosing silently.
Key points
- Keep finished steps that are still valid and rewrite only the steps that depended on the broken assumption.
- State the broken assumption in one sentence before changing the plan.
- Two identical failures in a row are a signal to re-plan, not to retry a third time.
- Mark what changed and why in the revised plan so the summary matches what happened.
- Ask the owner when the new route changes what the user gets.
Common mistakes
- Retrying the same failing step with tiny variations instead of questioning the assumption behind it.
- Discarding the whole plan and finished work after one failure.
- Changing the approach without recording what changed, so the final report hides the detour.
- Letting the detour quietly drop a requirement instead of asking whether it may.
Check yourself · 2 of 3
Which signal most clearly says an agent should re-plan rather than retry?
Check yourself · 3 of 3
After a failure, an agent's revised plan removes the requirement "filter by email" because the API cannot do it, and does not mention this. What is the problem?
Practice items, not counted towards your mastery.
Start here
- Plan-and-Solve Prompting: Improving Zero-Shot Chain-of-Thought Reasoning (opens in a new tab)PaperFree
Shows that asking a model to plan first and then carry out the plan reduces missing-step errors.
- Reflexion: Language Agents with Verbal Reinforcement Learning (opens in a new tab)PaperFree
The source for reflecting on a failed attempt in words and carrying the lesson into the next try.
- Plan-and-Execute Agents (LangChain blog) (opens in a new tab)ArticleFree
Compares plan-and-execute with a plain tool loop and explains the cost and speed trade-off.