Try this first
Run Rover on a longish task, and about four turns in, notice it is doing the wrong thing.
What are your options right now? With the code as it stands: Ctrl-C. That is the whole
interface. You lose the session and start over.
Three things you actually want
| You want to | Because | What it needs |
|---|---|---|
| Interrupt | It is going the wrong way | Stop cleanly, keep the transcript |
| Redirect | It is close, one correction needed | Add a user message, continue |
| Restart | The context is a mess | Fresh transcript, keep what was learned |
All three are small changes to the loop, and all three depend on something you already have:
the messages list is yours.
Interrupt
try:
output, failed = run_tool(call.name, call.arguments)
except KeyboardInterrupt:
output, failed = "The user interrupted this. Stop and wait for instructions.", True
Catching Ctrl-C at the tool call and turning it into a tool result means the model finds out
it was interrupted, in the transcript, instead of the process dying.
The session survives. You can now type the correction.
Redirect
Redirecting is one line, because a transcript is just a list:
messages.append({"role": "user", "content": "Stop editing README. Fix the failing test first."})
Append and continue the loop. There is no special mechanism, no API for steering. It is a
conversation, and you can talk in the middle of it.
A prompt after each turn is enough of an interface:
if reply.wants_tool:
note = input("[enter to continue, or type a correction] ").strip()
if note:
messages.append({"role": "user", "content": note})
That is a supervised agent. Twelve lines, and it changes how the tool feels to use.
Restart, without losing what was learned
Sometimes the transcript is beyond saving — twenty turns of a wrong approach, and every future
turn is anchored to it.
Restarting does not have to mean starting from nothing. Ask for a handover first:
messages.append({"role": "user", "content":
"Summarise for a fresh session: what you were asked, what you tried, "
"what you learned about this codebase, and what you would do next. "
"Be specific about file names and what did not work."})
summary = llm.send(messages).text
messages = [{"role": "user", "content":
f"You are continuing earlier work. Here is what happened:\n\n{summary}\n\n"
f"Now: {original_task}"}]
You have thrown away twenty turns of transcript and kept the findings. The new session is
cheap, focused, and knows what the last one learned.
This is the same idea as compaction in Module 6, done by hand. Doing it manually first is
worth it, because you can see exactly what survived and what did not.
The transcript is a list you own. Interrupting, correcting, and restarting are all just
edits to that list.
Try this before the next lesson
Add the after-each-turn prompt. Use Rover for a real task for ten minutes.
Notice how often you type something. That number tells you whether your tool descriptions are
carrying enough — every correction you type is a description that could have been clearer.