Skip to content

[BUG] opencode export outputs truncated JSON when piped #14948

Closed as not planned

Description

@voyleg

Description

opencode export <sessionID> returns truncated JSON when stdout is piped for sessions with large file attachments (5-10 MB). The same session export is valid when redirected directly to a file (>). This breaks tools that consume export output via pipe (e.g. jq, plugins calling opencode export through subprocess stdout capture).

Plugins

None

OpenCode version

1.2.10

Steps to reproduce

I faced this with PDFs:

  1. Get a 5+ MB PDF, e.g., download from https://arxiv.org/pdf/1409.0575.
  2. Create a new session with a prompt like "Read 1409.0575.pdf. Reply nothing."
  3. Piped export fails: opencode export <sessionID> | jq . >/dev/null
  4. Redirect to file works: opencode export <sessionID> > good.json; jq . good.json >/dev/null

Expected behavior:
Piped output should be valid JSON and identical (content-complete) to direct redirect output.

Screenshot and/or share link

No response

Operating System

macOS 26.2

Terminal

No response

Activity

  1. github-actions commented on Feb 24, 2026

    @github-actions
    Contributor

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

  2. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Feb 24, 2026
  3. github-actions commented on Apr 26, 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

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions