Skip to content

Tool.edit should recieve json object #6838

Closed as not planned
Closed as not planned

Description

@xihale

Description

I found LLM is likely to pass json type content to write .json files, thus they directly pass json object to edit tool, however, the tool doesn't parse it well, which waste many tokens to change themselves' ways to stringify it (which is likely to make mistakens) or use cat << EOF fallback.

Plugins

oh my opencode

OpenCode version

1.0.203

Steps to reproduce

  1. just let LLM write a json file may reproduce it.

Screenshot and/or share link

Image

Operating System

6.12.63-1-MANJARO

Terminal

Ghostty

Activity

  1. github-actions commented on Jan 4, 2026

    @github-actions
    Contributor

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

    All of these issues relate to JSON parsing failures and tool parameter handling when LLMs attempt to pass JSON objects directly to the edit/write tools.

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

  2. github-actions commented on Mar 25, 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.

  3. smrr723 commented on Apr 10, 2026

    @smrr723

    This is still an issue:-

    Environment:- OpenCode MacOS app version 1.4.3 - using GitLab Duo Agentic Chat (Claude Opus 4.6)

    This happens often when attempting to write a large amount of data to a markdown file.

    screenshot_2026-04-10_at_22.06.38.png

    screenshot_2026-04-10_at_22.03.41.png

  4. removed
    bugSomething isn't working
    on May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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