Skip to content

Fair amount of this: Error message: JSON Parse error: Unterminated string #20786

Closed as not planned

Description

@berenddeboer

Description

See this error a fair amount (once a day?) since the last few versions. I use Codex GPT-5.4 either medium or xhigh. I feel it happens more on medium, but could be mistaken.

Plugins

No response

OpenCode version

1.3.13

Steps to reproduce

Feels random.

But asking it to continue works, so not a biggie.

Screenshot and/or share link

No response

Operating System

Ubuntu 24.04

Terminal

Alacritty in tmux

Activity

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

    @github-actions
    Contributor

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

    If your issue is different, please add more details to distinguish it from these existing reports.

  3. zeug-zz commented on Apr 7, 2026

    @zeug-zz

    I’m seeing what looks like a more specific variant of this bug on 1.3.17, and it may be related to #19405.
    In my case the failure is not just a generic:
    Error message: JSON Parse error: Unterminated string
    The leaked payload includes a raw Responses API event frame like:

    {"type":"response.created","response":{"id":"resp_...","instructions":"..."}}
    and the instructions field contains the full assembled OpenCode prompt, including:
    - system/developer instructions
    - AGENTS / repo guidance
    - skill listings
    - project-specific context
    It also appears to get contaminated by synthetic internal text, for example:
    - <system-reminder> ... Plan Mode ...
    - [MEMORY TRIGGER DETECTED]
    That makes this look like a boundary-corruption issue where:
    1. a streaming/event payload is being treated as final JSON,
    2. synthetic reminder/middleware text is getting merged into the same parse stream,
    3. the parser then dies with Unterminated string.
    So this may overlap with both:
    - this issue (#20786) for the unterminated JSON parsing failure
    - #19405 for synthetic reminder leakage into model-visible content
    The notable extra symptom here is that response.created.instructions is dumped raw, so the failure can expose a huge amount of prompt/context text instead of only failing quietly.
    This might be worth handling as:
    - do not parse response.created as final structured output
    - keep synthetic reminder/memory-trigger text out of the provider transport stream
    - redact/suppress instructions in error logging
  4. removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  5. github-actions commented on Jul 3, 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