Skip to content

JSON parsing failed: Text: - macOS / Docker #25247

Closed as not planned
Closed as not planned

Description

@BastianZuehlke

Description

I randomly get JSON parsing errors, then the processing stops.

I get the same issue even if the LLM get served from Ollama or LM-Studio.
It happens if I use OpenCode directly on macOS or using the docker image.

I am using a clean OpenCode install, no tools (other than the default ones) or MCPs.

JSON parsing failed: Text: {"id":"chatcmpl-8w4gtjb6tplr8g1xoxrjvi","object":"chat.completion.chunk","created":1777577130,"model":"qwen/qwen3.6-27b","system_fingerprint":"qwen/qwen3.6-27b","choices":[{"index":0,"delta":{"reasoning_content":"\n"},"logprodata: {"id":"chatcmpl-b7yoftfoinwhk4joyloyjt","object":"chat.completion.chunk","created":1777577321,"model":"qwen/qwen3.6-27b","system_fingerprint":"qwen/qwen3.6-27b","choices":[{"index":0,"delta":{"role":"assistant","reasoning_content":"Let"},"logprobs":null,"finish_reason":null}]}.
Error message: JSON Parse error: Expected ':' before value in object property definition

Plugins

None

OpenCode version

1.14.30 (macOS) , 1.14.25 (Docker)

Steps to reproduce

Just need to give any prompt.

Screenshot and/or share link

No response

Operating System

macOS (npm install), docker

Terminal

No response

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 1, 2026
  2. github-actions commented on May 1, 2026

    @github-actions
    Contributor

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

    If your issue is distinct (e.g. a different reproduction path or different root cause), please add more context to differentiate it.

  3. BastianZuehlke commented on May 1, 2026

    @BastianZuehlke
    Author

    My understanding (based on reading the other issues) the llm is returning this corrupt JSON which stops OpenCode execution. ?
    I tested qwen 3.6 27b and 30b, so these models should / can not be used in OpenCode, at least not reliably ?

  4. water-in-stone commented on May 2, 2026

    @water-in-stone

    My understanding (based on reading the other issues) the llm is returning this corrupt JSON which stops OpenCode execution. ? I tested qwen 3.6 27b and 30b, so these models should / can not be used in OpenCode, at least not reliably ?

    I have submmited a MR to fix this bug.

  5. removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  6. darkhipo commented on May 14, 2026

    @darkhipo

    Same root cause as #23442

    This is the same server-side SSE buffering bug. Both chunks concatenated on one line, first truncated mid-key:

    "logprodata: {"id":"chatcmpl-b7yoftfoinwhk4joyloyjt"
    

    The first object is cut off at "logpro (should be "logprobs":null,...). Then data: appears as literal text, followed by a valid second chunk.

    I've added detailed analysis and a fix pattern in #23442 (comment) — including a splitMalformedSSE pre-processor that splits on data: boundaries when the primary parser finds zero complete objects.

    This confirms the bug is not provider-specific — it affects Z.AI GLM-5.1 and Ollama/LM Studio with Qwen 3.6-27b. Likely a shared upstream SSE library issue or a common proxy/load-balancer buffering problem.

  7. github-actions commented on Jul 14, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 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

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions