Agent enters infinite loop in plan mode when attempting to write plan #8615

Closed
opened 2026-02-16 18:10:23 -05:00 by yindo · 2 comments
Owner

Originally created by @sin-ack on GitHub (Feb 5, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

When using gpt-5.2-codex xhigh, the agent appears to enter an infinite loop when attempting to create the final plan file:

Image

When interrupted and manually put into build mode to give write access, it complained about the lack of a write tool despite instructions, and used apply_patch instead:

Image

After letting the agent write the plan file and putting it into plan mode again, the agent will successfully proceed with the plan by using the exit_plan tool.

Plugins

None

OpenCode version

1.1.51-11a93a1 (beta branch)

Steps to reproduce

  1. Put OpenCode in plan mode
  2. Ask the agent to plan a feature
  3. Watch it enter infinite loop

Screenshot and/or share link

Company-internal repo, so I can't share unfortunately. Screenshots are above.

Operating System

Gentoo Linux amd64

Terminal

Ghostty 1.2.3

Originally created by @sin-ack on GitHub (Feb 5, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description When using gpt-5.2-codex xhigh, the agent appears to enter an infinite loop when attempting to create the final plan file: <img width="422" height="621" alt="Image" src="https://github.com/user-attachments/assets/94272bef-114f-46d4-b2d8-690041890c5e" /> When interrupted and manually put into build mode to give write access, it complained about the lack of a `write` tool despite instructions, and used `apply_patch` instead: <img width="1409" height="68" alt="Image" src="https://github.com/user-attachments/assets/4d2647cc-e6e1-4a24-ab7a-6d3a8da57454" /> After letting the agent write the plan file and putting it into plan mode again, the agent will successfully proceed with the plan by using the `exit_plan` tool. ### Plugins None ### OpenCode version 1.1.51-11a93a1 (beta branch) ### Steps to reproduce 1. Put OpenCode in plan mode 2. Ask the agent to plan a feature 3. Watch it enter infinite loop ### Screenshot and/or share link Company-internal repo, so I can't share unfortunately. Screenshots are above. ### Operating System Gentoo Linux amd64 ### Terminal Ghostty 1.2.3
yindo added the bug label 2026-02-16 18:10:23 -05:00
yindo closed this issue 2026-02-16 18:10:23 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 5, 2026):

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

  • #10883: unable to write plan to .opencode/plans in plan mode
  • #11078: plan mode: unwilling to write to .opencode/plans/
  • #9445: Planner agent gets stuck in infinite loop when planning undefined projects
  • #3038: The model loops attempting to edit files in PLAN mode
  • #10121: Codex in experimental plan mode create the plan file twice

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

@github-actions[bot] commented on GitHub (Feb 5, 2026): This issue might be a duplicate of existing issues. Please check: - #10883: unable to write plan to .opencode/plans in plan mode - #11078: plan mode: unwilling to write to `.opencode/plans/` - #9445: Planner agent gets stuck in infinite loop when planning undefined projects - #3038: The model loops attempting to edit files in PLAN mode - #10121: Codex in experimental plan mode create the plan file twice Feel free to ignore if none of these address your specific case.
Author
Owner

@sin-ack commented on GitHub (Feb 5, 2026):

Seems like #10883 and #11078 are the same issue, closing in favor of them.

@sin-ack commented on GitHub (Feb 5, 2026): Seems like #10883 and #11078 are the same issue, closing in favor of them.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8615