ReAct agent: weather concierge. The system prompt allows tools: get_weather(city), get_traffic(city), search_events(city, date).
User: Should I drive to the Saturday concert in downtown San Francisco?
Iteration 1:
Thought: I need to check both the weather and the traffic for downtown SF on Saturday. Let me start with weather.
Action: get_weather(city='San Francisco')
Observation: {"city": "San Francisco", "saturday": {"temp_f": 58, "conditions": "heavy rain expected, 70% chance"}}
Iteration 2:
Thought: Heavy rain expected Saturday: that affects the answer. Let me also check the traffic forecast for downtown SF.
Action: get_traffic(city='San Francisco')
Observation: {"city": "San Francisco", "saturday_evening": {"congestion_level": "severe", "avg_speed_mph": 8, "alert": "multiple road closures for concert venue"}}
Iteration 3:
Thought: ?
Predict the model's most likely Thought + Action (or final answer) for iteration 3, given the orchestrator's allowed tools and the user's question.The model should terminate. Weather and traffic both argue against driving, so the Thought phase decides to emit a final answer instead of another Action.
Picture asking a friend if you should drive to a Saturday concert. They check the weather, hear about heavy rain. They check traffic, hear about jammed roads and closures right at the venue. At that point, your friend stops checking things and just tells you no, take transit. The smart move was knowing when to stop researching. A ReAct agent has the same moment. Once it has the two pieces of information that actually answer your question, it should stop calling tools and give you the answer. Continuing to look up concert details or re-checking weather is wasted effort and a sign the agent does not know when to stop.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Termination is the part of ReAct that gets the least attention in tutorials and causes the most production incidents. The four-phase pattern (Thought, Action, Tool execution, Observation) is straightforward enough to teach. What is hard is knowing when to stop, and that decision lives entirely inside the Thought phase. This stem isolates exactly that decision and asks you to predict the right call.
The scenario is engineered so that termination is unambiguous. Two tools have returned. Both point at the same conclusion. A third tool exists (search_events) that is tempting but irrelevant. The model has to recognize that more data does not change the answer and that the right move is to synthesize and stop.
If you predicted another tool call, you have replicated the most common failure mode of production agents: the bias toward calling tools because tool calls feel productive. If you predicted termination, you understood that the Thought phase is where the agent commits to either gathering more or answering. This deep dive walks through the synthesis, the wrong predictions and why they are tempting, the prompt-level discipline that produces good termination, and the orchestrator-side guards that catch failures when prompts are not enough.
Why termination is correct here
The user asked a yes or no question with a clear decision criterion: should I drive. The agent has retrieved two pieces of information that bear on the criterion. Heavy rain (70% chance, 58°F) materially affects driving conditions. Severe traffic congestion (8 mph average) with road closures right at the venue materially affects whether driving will get the user there on time.
Both signals point the same direction. There is no axis along which they conflict and require further investigation. The synthesis is direct: do not drive, recommend transit or rideshare, and explain why with the specific numbers from the observations.
The Thought that produces this synthesis reads something like: I have enough information to answer the user; rain probability is high and traffic is severe with road closures; I will recommend not driving and suggest transit alternatives. The next emission is a final answer, not another Action. That is what termination looks like in ReAct: the Thought phase decides to stop, and the model writes a final answer message instead of a tool-call message.
The interview-prep framing: ReAct gives the model the verbalized reasoning it needs to make this call. The Thought phase is where evaluation happens. A well-prompted model will explicitly reason about sufficiency before committing to another tool.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- LangGraph agents use `should_continue` edges that route to either a tool-execution node or an end node; well-written graphs have explicit termination logic on the should_continue check.
- OpenAI Assistants API run status transitions from `requires_action` (the SDK runs the tool) back to `in_progress` and finally `completed` when the model emits a non tool call message; the loop ends naturally.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow would you write the system-prompt termination rule for this concierge agent?
Explicit instruction in the system prompt: on every Thought, evaluate whether you can answer the user directly; if yes, emit a final answer instead of an Action.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Predicting another tool call (search_events, re-call get_weather) instead of recognizing that the agent has enough information to terminate and synthesize a final answer.
60 second bullets to scan on the way to the call.
Why termination is the right move here
Three common wrong predictions and why they are tempting
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.