-
Notifications
You must be signed in to change notification settings - Fork 13k
Long-running shell commands incorrectly trigger loop detection #19519
Description
What would you like to be added?
When the CLI executes a shell command that takes a significant amount of time to complete (such as a heavy grep search across a large directory), it incorrectly triggers the "potential loop detected" warning.
This results in a poor user experience. Instead of receiving clear feedback that a long shell process is currently executing, the user is left waiting, only to eventually receive a loop warning that makes the product feel buggy and unresponsive.
Steps to reproduce
- Run a command that takes a long time to return output but is not actually looping (e.g., a broad
grepcommand likegrep -ri "function call" packages/core/src/tools/definitions/on a large codebase). - Wait for the command to process.
- Observe the CLI prompt:
? A potential loop was detectedwith options to keep or disable loop detection. - Note that the command also exits with code 1 in this state.
Why is this needed?
The CLI should differentiate between a single, long-running shell execution and actual repetitive, looping tool calls. If a command is legitimately taking a long time, the UI should reflect this with clear feedback (e.g., a "running..." spinner or status indicator) rather than halting with a loop detection error.
Additional context
No response
Metadata
Metadata
Assignees
Labels
Type
Fields
Give feedbackProjects
Status