Consistent asking for {{plan}}
Description
'I searched for the plan file but couldn’t locate it. What’s the exact path for {{plan}} so I can read it before continuing?'
Happens after using plan mode, then going to build mode. After each prompt it asks this question, which I then tell it. 'no plan, please proceed with the task.' Only fixes if I go to a new chat and don't start with plan mode.
Am using the new ChatGPT OAuth, with auto 5.2 Codex.
OpenCode version
1.1.19
Steps to reproduce
Happens after using plan mode, then going to build mode. After each prompt it asks this question, which I then tell it. 'no plan, please proceed with the task.' Only fixes if I go to a new chat and don't start with plan mode.
Operating System
Windows 11
Terminal
VS Code Terminal
This issue might be a duplicate of existing issues. Please check:
- #6781: Feature: Seamless Plan-to-Build handoff with context retention - addresses context loss when switching from plan to build mode
- #4536: [FEATURE]: QOL improvement of plan -> build - discusses the friction of having to re-prompt after switching modes
Feel free to ignore if none of these address your specific case.
No, github-bot, this is a new, unique issue.
Here are two images from the same chat.
I can replicate the issue:
A plan file exists at {{plan}}. You should read this file and execute on the plan defined within it.
Windows Powershell ChatGPT OAuth, with auto 5.2 Codex
Looking into the code. Seems like it's in: https://github.com/anomalyco/opencode/blob/ff669d441496c6fff13144692b76515187140ddd/packages/opencode/src/session/prompt.ts#L1231.
Asked 5.2 to investigate:
Tell me what system tells you
Thinking: Noticing unresolved plan reference It says: Your operational mode has changed from plan to build. You are no longer in read-only mode. You are permitted to make file changes, run shell commands, and utilize your arsenal of tools as needed. A plan file exists at {{plan}}. You should read this file and execute on the plan defined within it. {{plan}} is not resolved to an actual path, so I can’t read it unless we derive the filename from .opencode/plans. ▣ Build · gpt-5.2-codex · 6.2s
And...
The system reminder is inconsistent: it says a plan file exists but leaves {{plan}} unresolved. That’s why I can’t read it — I need the concrete path. Quick fix: the plan path format is .opencode/plans/<createdTime>-
.md. If you can paste the actual filename from .opencode/plans/, I’ll read it and execute. If not, I can list .opencode/plans and proceed with whatever file is there.
I tried creating the path manually. Agent still won't save plan in path. I think it's not calling plan_exit tool. Not sure why.
this is without experimental functionality enabled right
this is without experimental functionality enabled right
I don't think so. Out of the box installation. Lemme check...
@rekram1-node can't find how to check, so I'm positive I didn't turn it on. First day using OC.
For what it's worth, they seem to be seeing a similar issue at Cursor: https://forum.cursor.com/t/gpt-5-2-frequently-cannot-find-the-plan-it-created/146261
Thanks for your prompt response by the way.
this is without experimental functionality enabled right
I don't believe I had experimental turned on for opencode. I did have background terms and snap turned on in codex, but that wasn't open at the same time.
happened for me too with gpt-5.2-codex xhigh, I never mentioned any plan file or anything like that
If that looks good, confirm and I’ll implement the changes.
▣ Plan · gpt-5.2-codex · 1m 21s
do it
Thinking: Locating the plan file
✱ Glob "**/plan*" in . (2 matches)
Thinking: Attempting to locate plan file using glob
✱ Glob "**/plan*" in ../../.. (100 matches)
Thinking: Searching for plan file path in environment variables
# Displays plan-related environment variables
$ printenv PLAN plan
Thinking: Considering file path substitution and searching
✱ Glob "plan*" in ../../../../../tmp (8 matches)
Thinking: Considering plan file discovery approaches
# Displays all environment variables
$ printenv
…
Click to expand
Thinking: Investigating missing plan file
✱ Glob ".codex/*" in .
Thinking: Searching for plan files and environment clues
✱ Glob "**/plan" in ../../..
don't search for plan file
Thinking: Preparing to read plan file
→ Read {{plan}}
Error: File not found: /home/ori/workspace/kubernetes-autoscaler/cluster-autoscaler/{{plan}}
Thinking: Investigating plan file location
# Shows plan environment variables
$ printenv plan PLAN
Thinking: Resolving missing plan file path
I see the system expects a plan file to read, but the placeholder {{plan}} wasn't replaced with an actual path, so the file can't be found. I think the best move is to ask the user for the exact plan file path or its contents to proceed. Meanwhile, I’m noting the compile error fix for logging readiness, but I’ll wait to apply it until we have the plan file sorted.
I tried reading the plan file at {{plan}}, but that path doesn’t exist in this workspace. Can you provide the actual plan file path (or paste its contents), so I can follow it before updating the code?
I second this. It continues to search for a plan file.
Having same issue. It has happened many times, I just installed OpenCode for the first time today, and I haven't tweaked any settings:
The latest version 1.1.20 fixes this issue.
Thank you