Plan Agent refuses to show code snippets #2223

Open
opened 2026-02-16 17:34:43 -05:00 by yindo · 8 comments
Owner

Originally created by @raymelon on GitHub (Oct 22, 2025).

Originally assigned to: @rekram1-node on GitHub.

Question

Hello. It's over a week since I tested OpenCode, and decided to check it out again.

One of the new things I noticed is that the Plan Agent is not showing code snippets anymore.

Is this a new behavior?

Curious how to make it less restrictive just like before.

There will be scenarios where seeing the specific code modifications is helpful, such as:

  1. Code review before allowing the Build agent do the code changes
  2. Or, allowing the user to do the modifications following from a list of instructions

I really believe that these two scenarios should not require Build Agent to be activated. Requiring a Build Agent is an overkill. Moreso, the agent will surely execute unintended actions like code modifications and running terminal commands.

OpenCode v0.15.13
OpenCode Zen - Code Supernova 1M
Windows 10 21H2
Warp v0.2025.10.15.08.12.stable_01
WSL 1 - Ubuntu-18.04

Image

Originally created by @raymelon on GitHub (Oct 22, 2025). Originally assigned to: @rekram1-node on GitHub. ### Question Hello. It's over a week since I tested OpenCode, and decided to check it out again. One of the new things I noticed is that the Plan Agent is not showing code snippets anymore. Is this a new behavior? Curious how to make it less restrictive just like before. There will be scenarios where seeing the specific code modifications is helpful, such as: 1) Code review before allowing the Build agent do the code changes 2) Or, allowing the user to do the modifications following from a list of instructions I really believe that these two scenarios should not require Build Agent to be activated. Requiring a Build Agent is an overkill. Moreso, the agent will surely execute unintended actions like code modifications and running terminal commands. OpenCode v0.15.13 OpenCode Zen - Code Supernova 1M Windows 10 21H2 Warp v0.2025.10.15.08.12.stable_01 WSL 1 - Ubuntu-18.04 ![Image](https://github.com/user-attachments/assets/fbe9ec21-75dc-4ad7-bf57-3666211205e2)
Author
Owner

@github-actions[bot] commented on GitHub (Oct 22, 2025):

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

  • #2709: Plan Agent does modifications to files - This issue mentions that in plan mode the agent sometimes cannot create code examples in the chat, which is very similar to your issue about not showing code snippets
  • #3038: The model loops attempting to edit files in PLAN mode - This issue suggests exposing the edit tool in PLAN mode but returning clear admonition text, which relates to your request for seeing code modifications in plan mode
  • #3241: Opencode stuck in Plan mode - User mentions that when asking for tools, the agent says it doesn't have edit tool, which could be related to the restrictive behavior you're experiencing

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

@github-actions[bot] commented on GitHub (Oct 22, 2025): This issue might be a duplicate of existing issues. Please check: - #2709: Plan Agent does modifications to files - This issue mentions that in plan mode the agent sometimes cannot create code examples in the chat, which is very similar to your issue about not showing code snippets - #3038: The model loops attempting to edit files in PLAN mode - This issue suggests exposing the edit tool in PLAN mode but returning clear admonition text, which relates to your request for seeing code modifications in plan mode - #3241: Opencode stuck in Plan mode - User mentions that when asking for tools, the agent says it doesn't have edit tool, which could be related to the restrictive behavior you're experiencing Feel free to ignore if none of these address your specific case.
Author
Owner

@raymelon commented on GitHub (Oct 22, 2025):

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

  • Plan Agent does modifications to files. #2709: Plan Agent does modifications to files - This issue mentions that in plan mode the agent sometimes cannot create code examples in the chat, which is very similar to your issue about not showing code snippets
  • The model loops attempting to edit files in PLAN mode #3038: The model loops attempting to edit files in PLAN mode - This issue suggests exposing the edit tool in PLAN mode but returning clear admonition text, which relates to your request for seeing code modifications in plan mode
  • Opencode stuck in Plan mode #3241: Opencode stuck in Plan mode - User mentions that when asking for tools, the agent says it doesn't have edit tool, which could be related to the restrictive behavior you're experiencing

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

Hey bot, I really appreciate your reply but my concern is a completely different issue.

@raymelon commented on GitHub (Oct 22, 2025): > This issue might be a duplicate of existing issues. Please check: > > * [Plan Agent does modifications to files. #2709](https://github.com/sst/opencode/issues/2709): Plan Agent does modifications to files - This issue mentions that in plan mode the agent sometimes cannot create code examples in the chat, which is very similar to your issue about not showing code snippets > * [The model loops attempting to edit files in PLAN mode #3038](https://github.com/sst/opencode/issues/3038): The model loops attempting to edit files in PLAN mode - This issue suggests exposing the edit tool in PLAN mode but returning clear admonition text, which relates to your request for seeing code modifications in plan mode > * [Opencode stuck in Plan mode #3241](https://github.com/sst/opencode/issues/3241): Opencode stuck in Plan mode - User mentions that when asking for tools, the agent says it doesn't have edit tool, which could be related to the restrictive behavior you're experiencing > > Feel free to ignore if none of these address your specific case. Hey bot, I really appreciate your reply but my concern is a completely different issue.
Author
Owner

@raymelon commented on GitHub (Oct 22, 2025):

I insisted. But the Plan Agent is also firm on its stand.

Seems like a deadlock, unless I undo a bunch of stuff until this hard rule is out of the session's context.

Image
@raymelon commented on GitHub (Oct 22, 2025): I insisted. But the Plan Agent is also firm on its stand. Seems like a deadlock, unless I undo a bunch of stuff until this hard rule is out of the session's context. <img width="1467" height="920" alt="Image" src="https://github.com/user-attachments/assets/6f8a0122-ab01-48d1-a423-a7303153ddd9" />
Author
Owner

@raymelon commented on GitHub (Oct 22, 2025):

I insisted. But the Plan Agent is also firm on its stand.

Seems like a deadlock, unless I undo a bunch of stuff until this hard rule is out of the session's context.

Image

Tried undoing up to the plan, to no avail. The hard rule is still prevailing.

Image
@raymelon commented on GitHub (Oct 22, 2025): > I insisted. But the Plan Agent is also firm on its stand. > > Seems like a deadlock, unless I undo a bunch of stuff until this hard rule is out of the session's context. > > <img alt="Image" width="1467" height="920" src="https://private-user-images.githubusercontent.com/23053494/504128681-6f8a0122-ab01-48d1-a423-a7303153ddd9.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjExMjg0MzMsIm5iZiI6MTc2MTEyODEzMywicGF0aCI6Ii8yMzA1MzQ5NC81MDQxMjg2ODEtNmY4YTAxMjItYWIwMS00OGQxLWE0MjMtYTczMDMxNTNkZGQ5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTEwMjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUxMDIyVDEwMTUzM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWVmNjk1Mzg1NmUwZGI0MGYxM2M1ZDdmMmRlMzY5NzkzYmQyMTM4MGE0MzYzNjg3YmJlMTI1NTFhYjY1OWE4NTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.0jcCEJK8lw_zzlx_f62NCJMKgmW8rvPOPs46tbEEUFI"> Tried undoing up to the plan, to no avail. The hard rule is still prevailing. <img width="1467" height="920" alt="Image" src="https://github.com/user-attachments/assets/6cfafa17-3e3f-458e-9716-c4fdf996ba58" />
Author
Owner

@raymelon commented on GitHub (Oct 22, 2025):

Toggled Thinking blocks. It says "No code changes, no using tools to edit files."

I think this can be fixed by enforcing the prompt with something like "No code changes. CODE SNIPPETS in the plan is NOT a CODE CHANGE. CODE SNIPPETS in the plan is NOT using tools to edit files. CODE SNIPPETS in the plan is perfectly fine."

What do you guys think?

Image
@raymelon commented on GitHub (Oct 22, 2025): Toggled Thinking blocks. It says "No code changes, no using tools to edit files." I think this can be fixed by enforcing the prompt with something like "No code changes. CODE SNIPPETS in the plan is NOT a CODE CHANGE. CODE SNIPPETS in the plan is NOT using tools to edit files. CODE SNIPPETS in the plan is perfectly fine." What do you guys think? <img width="1467" height="920" alt="Image" src="https://github.com/user-attachments/assets/668ec46c-76b5-43e3-bffb-e010987cfdb8" />
Author
Owner

@rekram1-node commented on GitHub (Oct 22, 2025):

@raymelon are you saying that the llm won't output code ever or that it won't attempt to make an edit giving u ability to accept / deny?

Right now plan agent doesnt even have an edit tool so it is somewhat limited in some of this

@rekram1-node commented on GitHub (Oct 22, 2025): @raymelon are you saying that the llm won't output code ever or that it won't attempt to make an edit giving u ability to accept / deny? Right now plan agent doesnt even have an edit tool so it is somewhat limited in some of this
Author
Owner

@raymelon commented on GitHub (Oct 23, 2025):

The former. LLM refuses to output code because it thinks that outputting code meant editing files.

@raymelon commented on GitHub (Oct 23, 2025): The former. LLM refuses to output code because it thinks that outputting code meant editing files.
Author
Owner

@rekram1-node commented on GitHub (Oct 23, 2025):

I think that may just be the supernova model getting into weird state I haven't ran into this ever...

Maybe we could adjust prompt but it just depends how common the issue is, llms will do weird stuff sometimes

@rekram1-node commented on GitHub (Oct 23, 2025): I think that may just be the supernova model getting into weird state I haven't ran into this ever... Maybe we could adjust prompt but it just depends how common the issue is, llms will do weird stuff sometimes
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2223