Subagents often getting stuck into tool usage loops #1366

Closed
opened 2026-02-16 17:30:38 -05:00 by yindo · 3 comments
Owner

Originally created by @arthur404dev on GitHub (Aug 18, 2025).

Originally assigned to: @thdxr on GitHub.

Sometimes subagents get stuck on tool usage loops, the one that triggers it the most is the read tool.

Example:

Image Image
Originally created by @arthur404dev on GitHub (Aug 18, 2025). Originally assigned to: @thdxr on GitHub. Sometimes `subagents` get stuck on tool usage loops, the one that triggers it the most is the `read` tool. Example: <img width="782" height="996" alt="Image" src="https://github.com/user-attachments/assets/2e96ae3e-10a3-4850-8629-d556d8a59961" /> <img width="1553" height="1071" alt="Image" src="https://github.com/user-attachments/assets/bfac6fc0-6f3e-4472-a474-8d98819ab62d" />
yindo closed this issue 2026-02-16 17:30:38 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Aug 18, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #262: "gemini 'i'm finished' loop" - Similar issue with agents getting stuck in loops
  • #1682: "BUG: dumps system prompt in an infinite loop for absolutely no reason" - Agent getting stuck in infinite loops with system prompt repetition
  • #1746: "agent loop should stop if user rejects a permission" - Related to agent loop behavior issues
  • #2005: "display bug(TUI): task tool does not show tool calls on the 4th+ concurrent task" - Specific issue with the task tool that you mentioned triggers loops most often

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Aug 18, 2025): This issue might be a duplicate of existing issues. Please check: - #262: "gemini 'i'm finished' loop" - Similar issue with agents getting stuck in loops - #1682: "BUG: dumps system prompt in an infinite loop for absolutely no reason" - Agent getting stuck in infinite loops with system prompt repetition - #1746: "agent loop should stop if user rejects a permission" - Related to agent loop behavior issues - #2005: "display bug(TUI): `task` tool does not show tool calls on the 4th+ concurrent task" - Specific issue with the task tool that you mentioned triggers loops most often Feel free to ignore if none of these address your specific case.
Author
Owner

@spoons-and-mirrors commented on GitHub (Aug 19, 2025):

I have never witnessed such behavior, isn't this a prompt design issue from your Architect agent? @arthur404dev
what version of opencode are you running?

@spoons-and-mirrors commented on GitHub (Aug 19, 2025): I have never witnessed such behavior, isn't this a prompt design issue from your Architect agent? @arthur404dev what version of opencode are you running?
Author
Owner

@rekram1-node commented on GitHub (Dec 27, 2025):

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

@rekram1-node commented on GitHub (Dec 27, 2025): [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1366