Implementation hallucinated in plan mode #1383

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

Originally created by @nikhilmaddirala on GitHub (Aug 19, 2025).

Originally assigned to: @thdxr on GitHub.

When using plan mode with Claude Sonnet 4 (on a fairly simple task), the agent made a plan and hallucinated an implementation without realizing that it's in plan mode. Later when I switched it to build mode, it claimed that the implementation was already complete even though it didn't edit any files.

Ref: https://opencode.ai/s/mmQMJPzp

Originally created by @nikhilmaddirala on GitHub (Aug 19, 2025). Originally assigned to: @thdxr on GitHub. When using plan mode with Claude Sonnet 4 (on a fairly simple task), the agent made a plan and hallucinated an implementation without realizing that it's in plan mode. Later when I switched it to build mode, it claimed that the implementation was already complete even though it didn't edit any files. Ref: https://opencode.ai/s/mmQMJPzp
yindo closed this issue 2026-02-16 17:30:44 -05:00
Author
Owner

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

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

  • #1965: Gemini uses sed to edit files in plan mode - describes similar behavior where agents try to use tools to edit/fix files during planning stage
  • #1799: v0.4.11 ignores plan restrictions - reports plan mode agents going to bash to write files, ignoring plan mode restrictions

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

@github-actions[bot] commented on GitHub (Aug 19, 2025): This issue might be a duplicate of existing issues. Please check: - #1965: Gemini uses `sed` to edit files in `plan` mode - describes similar behavior where agents try to use tools to edit/fix files during planning stage - #1799: v0.4.11 ignores plan restrictions - reports plan mode agents going to bash to write files, ignoring plan mode restrictions Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Aug 19, 2025):

Thx for issue nikhil, Do you think this is basically same issue as #1965?

I have seen this happen a few times too

@rekram1-node commented on GitHub (Aug 19, 2025): Thx for issue nikhil, Do you think this is basically same issue as #1965? I have seen this happen a few times too
Author
Owner

@nikhilmaddirala commented on GitHub (Aug 21, 2025):

Thx for issue nikhil, Do you think this is basically same issue as #1965?

I have seen this happen a few times too

Upon closer inspection, yes it's the same issue. It edited the file using cat >> file << 'EOF'.

But this was Claude Sonnet 4, and this never happens with claude code, so I think the issue is with opencode prompts.

Feel free to merge the issues.

@nikhilmaddirala commented on GitHub (Aug 21, 2025): > Thx for issue nikhil, Do you think this is basically same issue as #1965? > > I have seen this happen a few times too Upon closer inspection, yes it's the same issue. It edited the file using cat >> file << 'EOF'. But this was Claude Sonnet 4, and this never happens with claude code, so I think the issue is with opencode prompts. Feel free to merge the issues.
Author
Owner

@rekram1-node commented on GitHub (Aug 21, 2025):

Will do thx!

@rekram1-node commented on GitHub (Aug 21, 2025): Will do thx!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1383