[PR #8953] feat(bash): stream large output to tmpfile with filtering and GC #12920

Open
opened 2026-02-16 18:17:48 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/8953

State: open
Merged: No


What does this PR do?

Stream command output directly to a temp file when it exceeds 50KB,
avoiding memory bloat for commands with huge output. Inspired by
block/goose#2817.

New feature:

  • output_filter param: pass a regex (e.g. "^(warning|error):") to
    capture only matching lines inline while full output goes to file

The agent is informed that Grep and Read can be used to analyze the
temp files.

UI now shows filtered output stats (e.g. "Filtered: 7 matches from
2.1 KB (1.9 KB omitted)") so users can see how much output was
filtered and the total size.

Assisted-by: OpenCode (Opus 4.5)

How did you verify your code works?

Unit tests, and also by trying it out directly. (Though I only lightly tested it interactively)

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/8953 **State:** open **Merged:** No --- ### What does this PR do? Stream command output directly to a temp file when it exceeds 50KB, avoiding memory bloat for commands with huge output. Inspired by block/goose#2817. New feature: - output_filter param: pass a regex (e.g. "^(warning|error):") to capture only matching lines inline while full output goes to file The agent is informed that Grep and Read can be used to analyze the temp files. UI now shows filtered output stats (e.g. "Filtered: 7 matches from 2.1 KB (1.9 KB omitted)") so users can see how much output was filtered and the total size. Assisted-by: OpenCode (Opus 4.5) ### How did you verify your code works? Unit tests, and also by trying it out directly. (Though I only lightly tested it interactively)
yindo added the pull-request label 2026-02-16 18:17:48 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12920