Skip to content

submit_plan not appear after plan is finished #328

Closed

Description

@linxi-1214

This is the picture get from Youtube
Image

and my opencode is like

Image

the submit_plan didn't appear

I install plannotator as https://github.com/backnotprop/plannotator/tree/main/apps/opencode-plugin said.

Activity

  1. backnotprop commented on Mar 18, 2026

    @backnotprop
    Owner

    Deubg..

    1. Do you see /slash commands?
    Image
    1. Ask the Plan agent what tools it has
    Image
    Image
    1. double check install steps

    4.1

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["@plannotator/opencode@latest"]
    }
    

    4.21

    curl -fsSL https://plannotator.ai/install.sh | bash
    

    What version and OS?

  2. ilmpc commented on Mar 18, 2026

    @ilmpc

    Hey! I faced same issue, it feels like opencode changed plan mode prompt. And now LLM refuses to use edit even if it's explicitly allowed for plans.

    Image
  3. backnotprop commented on Mar 18, 2026

    @backnotprop
    Owner

    Yeah, I see it gets confused with the paths that OpenCode allows for plan mode. I'll add some flexibility into it.

    ah, opencodes config set for allowed paths is buggy

  4. ilmpc commented on Mar 18, 2026

    @ilmpc

    Issue is in theirs plan prompt. But for anthropics they use different prompt, which allow plan writing. Maybe tool that accepts plan as text would work. But essentially we need to patch prompt to make it work as intended.

    anomalyco/opencode#11078

  5. backnotprop commented on Mar 18, 2026

    @backnotprop
    Owner

    Yeah, I'm in the middle of this right now. Should have a patch soon.

  6. rcdailey commented on Mar 18, 2026

    @rcdailey
    Contributor

    I don't know if this is related but the submit_plan tool is still visible in context and I think that confuses the agent. The behavior is worse than before since it can't figure out where files go:

    Image
  7. backnotprop commented on Mar 18, 2026

    @backnotprop
    Owner

    @rcdailey are you saying it's being called when you're outside of plan mode?

    I'm sending a patch in now that will fix the submit writing issues.

  8. backnotprop commented on Mar 18, 2026

    @backnotprop
    Owner

    This is a tricky process right now. I'm not sure if the current patchwork is going to hold.

  9. backnotprop commented on Mar 18, 2026

    @backnotprop
    Owner

    Pushed patch updates to 0.14.0

  10. rcdailey commented on Mar 18, 2026

    @rcdailey
    Contributor

    Yes, normally I've been able to use submit_plan in any primary agent (for me, that's primarily the Build and Plan agents). The two have worked uniformly regardless of the agent selected.

    With your new approach of tighter integration in Plan mode, it's no longer clear to me what the intent is between the Plan primary agent and non-Plan agents: Do you intend Plan to be the only place that plannotator exists and can be invoked? If so, that's definitely not the behavior I observed as of my previous comment.

    I hope that makes sense.

  11. backnotprop commented on Mar 18, 2026

    @backnotprop
    Owner

    I will bring back the flexibility of memory vs file writing plans. And support both.

    This morning I removed the restrictions around file writing, but I'll make sure I'll re-prompt engineer in a more flexible manner.

    Submit plan will act the same way it used to and work with other agents. But there will be a new version for the file writing focus for users who want that.

    0.14.0 should be less intrusive, but will launch above updates in 0.14.1 today

  12. backnotprop commented on Mar 18, 2026

    @backnotprop
    Owner

    PR #333 addresses this by restoring the original text-based submit_plan(plan) that worked uniformly across all agents, and keeping the file-based workflow as a separate submit_plan_file(path) tool.

    Key changes:

    • Two tools: submit_plan (pass markdown text) + submit_plan_file (pass file path) — agent chooses based on context
    • Unified prompt for all primary agents — no more split behavior between plan/non-plan agents
    • Removed fragile TodoWrite replacements — the 40+ .replace() calls and regex rewrites are gone
    • Still strips OpenCode's STRICTLY FORBIDDEN rules and suppresses plan_exit

    #333

  13. rcdailey commented on Mar 18, 2026

    @rcdailey
    Contributor

    I want to make sure I'm on the same page with you. I apologize for any confusion.

    I fully support the file-based approach, what is unclear to me is how it is supposed to work. The agent not being clear on where the files should go seems like leaked implementation detail, not necessarily a flaw in your approach.

    I am also concerned that you're introducing two different ways to use the tool when arguably one is sufficient. Sorry if my feedback led you down this path.

    The file based approach is appealing to me because it (presumably) addresses one of the concerns I've had since I discovered Plannotator: The inability for the agent to iterate on the plan in the form of edits. Historically it had to recreate the entire document again every time I sent feedback. A file-based approach enables the agent to edit subsets of the present plan with each iteration of feedback which is a huge improvement.

    Where the files go, the fact that the agent is even editing a file at all, could be abstracted. I don't know what level of abstraction is appropriate, nor how this is influenced by the OC native plan tooling. It's also unclear to me as I indicated previously if the submit_plan tool should be visible in context if you're taking an opencode-first approach. I don't mind being in Plan mode to use Plannotator (that's sort of the purpose).

    You could argue that submit_plan being usable in the Build agent was unintended behavior; for me personally I don't feel like I'll lose anything by having to first swap to Plan mode to use plannotator going forward. I just want to make sure I understand what your intended use is going forward; I don't mean to necessarily ask for multiple ways to use it.

    Thanks for the quick turnaround on discussion.

  14. rcdailey commented on Mar 18, 2026

    @rcdailey
    Contributor

    Quick follow up. I'm even more confused now. First, I checked the opencode docs: https://opencode.ai/docs/modes/#plan

    edit - Cannot modify existing files, except for files located at .opencode/plans/*.md to detail the plan itself

    I'll be honest, I don't think I ever used plan mode in opencode without plannotator. So I don't really know how it's supposed to work.

    However based on the docs above, plan files should be written to a specific location. But when I tested a faux plan (in Plan Mode) using Plannotator v0.14.0, it did the following:

    1. Wrote a file to the root of my repo (which I thought should have been prohibited)
    2. Invoked submit_plan with the path to that file

    I suppose I assumed OC had its own built in "plan" tool that abstracted the fact that it was writing to markdown files from the user, but maybe I'm remembering the way Claude Code does it instead. Either way, writing the markdown file to the root of my repo in Plan mode feels wrong. But that might be an OC issue; plannotator seems to render the markdown file correctly.

  15. backnotprop commented on Mar 18, 2026

    @backnotprop
    Owner

    PR #333 has been updated. Here's what's changing:

    Single submit_plan tool, text or file path

    submit_plan(plan) accepts either markdown text or a file path. The agent has flexibility to pass plan text directly from context, or write a plan file and pass the path — whichever fits the workflow. One tool, works from any primary agent.

    • Text flow: No files written, no directory conflicts. Matches the pre-v0.13 behavior.
    • File flow: Agent writes a plan file, passes the path. On rejection, feedback points back at that same file so the agent can edit and resubmit without rewriting from scratch.

    What we fixed

    • Relaxed the tight OpenCode plan mode integration that was causing directory and permission conflicts
    • submit_plan works uniformly across all primary agents again, not just Plan

    How this maps to reported issues

    • @ilmpc: Agent refusing to write/edit in plan mode → text flow sidesteps the file permission conflict entirely. Prompt stripping still handles the plan agent case.
    • @rcdailey: submit_plan works uniformly across agents again. Single tool, not two. File-based iteration works — agent edits the same file on rejection. No leaked implementation details about where files should go.

    Will tag a release once I've finished testing.

  16. linxi-1214 commented on Mar 19, 2026

    @linxi-1214
    Author

    Deubg..

    1. Do you see /slash commands?
    Image 2. Ask the Plan agent what tools it has Image Image 4. double check install steps

    4.1

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["@plannotator/opencode@latest"]
    }
    

    4.21

    curl -fsSL https://plannotator.ai/install.sh | bash
    

    What version and OS?


    Finally,I solved the problem by switching to a different model。I switched model from GPT-5-mini to opus 4.6, and submit_plan is called successfully !
    Another solution is to explicitly instruct the model to use submit_plan to submit the plan,for example:

    generated the plan and use plannotator let me to review it
    
  17. ilmpc commented on Mar 19, 2026

    @ilmpc

    I'm not sure if this is repeatable behavior, but with latest (14.1) plannatator, model got rogue and started to write python to edit code (to bypass edit restrictions).

    I was working in old session (before plannatator upgrade) with 80k context with gpt 5.4. I've switched to plan and asked for refactor. It's ignored plan mode and started edit with scripts.

    Image

    UPD: well, it's repeatable with new session. looks like if model is not STRICTLY FORBIDDEN to write it starting to do whatever it wants.

    @backnotprop

  18. backnotprop commented on Mar 19, 2026

    @backnotprop
    Owner

    I'm patching that prompt @ilmpc

    It's wild to me how sensitive this harness is to different prompts.

  19. added 2 commits that reference this issue on Mar 19, 2026
    ec912db
    5dd60c1
  20. backnotprop commented on Mar 19, 2026

    @backnotprop
    Owner

    Fixed in v0.14.2 via #341. The plan mode prompt is now replaced instead of stripped, so agents keep their guardrails while gaining the .md file writing exception.

  21. rcdailey commented on Mar 19, 2026

    @rcdailey
    Contributor

    @backnotprop I'm sorry to report that in 0.14.2, in plan mode, the agent is using the string version of the submit plan tool instead of file-based plans like before. This is a step backwards, IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions