Skip to content

Agent unable to save due to malformed write payload #12412

Closed

Description

@amatecha

Description

Started a new project and have been trying to formulate a proper Plan (as people always suggest). I first made a PLAN.md from another agent. That is the only file in the project, other than .opencode having been created by opencode.

Upon attempting to save the plan (to .opencode/plan/****.md) it fails every time. Somehow the payload to the write tool is always malformed.

  • It seems to try to indicate the filePath twice, and the second instance is escaped improperly. <- causing the JSON parse error
  • The path it was intending to write to is incorrect. My working directory for the project is /home/amatecha/git/myproject (and that is where I launched opencode from), but the logged filePath is /home/amatecha/.opencode/plans/gateway-development-plan.md for some reason. It should have been /home/amatecha/git/myproject/.opencode/plans/gateway-development-plan.md

Example:

  ⚙ invalid [tool=write, error=Invalid input for tool write: JSON parsing failed: Text:{"content":"exampletext","filePath":"/home/amatecha/.opencode/plans/gateway-development-plan.md","filePath"/home/amatecha/.opencode/plans/gateway-development-plan.md"}.
Error message: JSON Parse error: Unrecognized token '/']

(note I replaced the plan text with "exampletext" above. The length of the string previously there was 16663 bytes, if that's relevant)

Installed opencode via shell script install method. I have the following feature flag in my .bashrc:

export OPENCODE_EXPERIMENTAL_PLAN_MODE=1

I'm using qwen3-coder-next via llama.cpp if that's relevant.

Plugins

none that I know of

OpenCode version

1.1.53 (happened in 1.1.51 as well)

Steps to reproduce

1.have Experimental Plan mode enabled
2. create a new dir
3. cd into dir
4. run opencode
5. go to Plan mode and come up with a quick plan
6. tell the agent to save the plan and confirm whatever filename it suggests
7. note the failure to save due to above-described error

Screenshot and/or share link

No response

Operating System

Linux Mint 22

Terminal

xfce4-terminal

Activity

  1. github-actions commented on Feb 6, 2026

    @github-actions
    Contributor

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

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

  2. amatecha commented on Feb 6, 2026

    @amatecha
    Author

    Issue also being reported on the model page at https://huggingface.co/unsloth/Qwen3-Coder-Next-GGUF/discussions/5 and https://huggingface.co/unsloth/Qwen3-Coder-Next-GGUF/discussions/2 , may be something wrong with the model itself? Even on the original Qwen model, https://huggingface.co/Qwen/Qwen3-Coder-Next/discussions/14 /shrug

  3. crashr commented on Feb 6, 2026

    @crashr
  4. crashr commented on Feb 6, 2026

    @crashr

    I got it working with this reverse proxy which I wrote some time ago to connect a streaming client to llama-server when it wasn't able to stream when tool calling was used.
    https://github.com/crashr/llama-stream

  5. changed the title [-]Plan mode (experimental) unable to save due to malformed write payload[/-] [+]Agent unable to save due to malformed write payload[/+] on Feb 9, 2026
  6. github-actions commented on Apr 11, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions