Skip to content

fix(cli): drain stdout in export to prevent truncation (fixes #29330)#29378

Open
levgiorg wants to merge 1 commit into
anomalyco:devfrom
levgiorg:fix/issue-29330-export-truncation
Open

fix(cli): drain stdout in export to prevent truncation (fixes #29330)#29378
levgiorg wants to merge 1 commit into
anomalyco:devfrom
levgiorg:fix/issue-29330-export-truncation

Conversation

@levgiorg
Copy link
Copy Markdown

@levgiorg levgiorg commented May 26, 2026

Issue for this PR

Closes #29330

Type of change

  • Bug fix

What does this PR do?

Fix opencode export producing truncated JSON output when piped. Ensures stdout is fully drained before the process exits so large session exports are not cut off at pipe boundaries.

How did you verify your code works?

  • All CI checks pass (check-duplicates, check-standards, add-contributor-label, check-compliance)
  • TypeScript typecheck passes
  • Existing tests pass

Screenshots / recordings

Not applicable — no UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Large export output was truncated when piped because stdout writes weren't fully flushed before process exit. Added explicit drain/wait to ensure complete output delivery.

Fixes anomalyco#29330
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label May 26, 2026
@github-actions
Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential duplicate found:

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label May 26, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

opencode export <id> | jq produces truncated / invalid JSON when piped (large sessions)

1 participant