Skip to content

Error message: JSON Parse error: Unterminated string] error with Kimi k 2.5 and huggingface provider in build mode #12506

Closed

Description

@aditya-oss-prog

Description

build mode edit tool fails with JSON Parse error on large multi-line newString payloads

Bug Summary

after planning build model fails with a JSON Parse error: Unterminated string when the newString parameter contains a large multi-line payload with embedded code blocks, markdown formatting, and escaped characters. The JSON serialization of the edit payload appears to produce an unterminated string, causing the JSON parser to reject the input before the tool can execute.

Error Message

⚙ invalid [tool=edit, error=Invalid input for tool edit: JSON parsing failed: 
Text: {"filePath": "IMPLEMENTATION_PLAN.md", "oldString": "**Document Version**: 1.0\n**Last Updated**: ..."}
Error message: JSON Parse error: Unterminated string]

Plugins

No plugins just opencode with huggingface provider

OpenCode version

1.1.40

Steps to reproduce

  1. create a plan in plan mode.

  2. ask it to write to file in build mode it can be implementation plan file or any code file.

Screenshot and/or share link

No response

Operating System

macos Tahoe 26.2 and ubuntu 24.04 in wsl

Terminal

macos default terminal and windows terminal wsl window

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. github-actions commented on Apr 8, 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 workingwindows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions