Loop Detection & Last-Prompt-Wins
Runaway agents get stopped, and a new prompt always interrupts the old one.
What you'll see
- In prompt mode, kick off a large task that makes many tool calls.
- The orchestrator tracks a sliding window of the last 20 tool calls.
- Send a new prompt mid-run -- the in-flight LLM call is cancelled immediately ("last-prompt-wins").
- Explain loop detection: after 3 identical tool invocations in the window, the call is blocked.
Commands shown
rysh
analyze every file in this repo and summarize the architecture
actually, just tell me the Go version in go.mod
echo 'loop detection: blocks after 3 identical calls in a 20-call window'
Keys used
EnterEscape
Transcript
0:00Runaway agents get stopped, and a new prompt always interrupts the old one.
0:03Start rysh and drop into prompt mode.
0:08Give the agent a big task. The orchestrator watches a sliding window of twenty tool calls as it works.
0:20Change your mind mid-thought. Send a new prompt and the in-flight LLM call is cancelled -- last prompt wins.
0:34And if the agent repeats the same tool call three times, loop detection blocks it so it can never spin forever.
0:42Safe by design: no infinite loops, always interruptible.
Key takeaway
Rysh prevents infinite loops and keeps the agent interruptible -- your latest prompt always takes over.