[Bug] Agent task does not terminate after completion and enters repeated response loo
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 4.7k
- Forks
- 719
- Avg merge
- 4h 30m
- Merged PRs (30d)
- 83
Description
The agent/task runner sometimes fails to terminate after completing a task.
Observed behavior:
- The agent completes the requested work and produces a final report.
- The UI continues showing "Task running".
- The agent starts another thinking cycle without receiving a new user instruction.
- It repeatedly generates messages such as:
"Inspection complete. Nothing was modified..."
"Nothing is pending..."
"I'll wait for your next instruction." - Even explicit instructions such as "STOP", "do not respond", and "terminate the task" caused additional responses.
- In one case, the agent repeatedly inspected the same file/state without making progress.
- Pressing Cancel finally changed the task to Done.
The problem also occurred during a simple ProductCard implementation task. The agent correctly identified the next action, read the required file, and then instead of editing it, repeatedly generated the same status message.
This makes the autonomous coding workflow unreliable because a completed or active task can remain in the running state indefinitely.
I suspect a task-runner/agent finish-state problem where the model's final response is not being recognized as terminal, or where the runner re-invokes the model after a terminal response.
Please investigate the task termination/finish-state handling and repeated-turn behavior.After the agent completes the requested work and produces its final response, the task should automatically transition to Done and stop generating further model turns or tool calls.
A final response should be treated as terminal unless there is an explicit pending action/tool call.
The agent should never repeatedly generate status messages without a new user instruction.Additional reproduction:
The same behavior occurred during a simple ProductCard implementation task.
The agent:
- correctly understood the requested next steps,
- read the required homepage file,
- then failed to perform the next edit,
- repeatedly generated the same "What did we do so far?" status response,
- continued thinking/restarting without making progress.
This suggests the problem is not specific to one project task or completion report. It may be a broader agent/task-runner state or turn-management problem.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the agent/task runner's finish-state and turn-management handling, using the reported repeated-response and Cancel behavior as the reproduction. Check the ProductCard scenario, where the agent read the homepage file but did not perform the next edit. Done means completed final responses transition the task to Done, with no further model turns or tool calls unless an explicit action remains.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- ai, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100