Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found several related PRs that touch on shell output handling: Potentially Related PRs:
The most closely related is #35543, which also handles the edge case of output loss at process exit. Your PR extends this solution with batching and timing controls to prevent output loss in high-volume scenarios. No exact duplicates found, but #35543 may need consideration for interaction with your changes. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
|
Independent evidence now supports reopening this. In a 25.4 GB database, bash progress accounted for 851,118 updates and 9.68 GB of encoded event payload. In ten fresh-process synthetic trials, the exact baseline produced 30 metadata callbacks versus a median of 4 with 100 ms coalescing. I found this PR only after my duplicate #46287 was auto-closed for contribution-format violations. I will not resubmit the duplicate. This PR was closed by automated age/reaction cleanup rather than a code-review rejection; would a maintainer consider reopening it? |
|
Confirming the issue on the current stable Homebrew CLI, OpenCode 1.18.25 on macOS arm64. This also appears to contradict the claim above that event persistence is now off for local CLI use. Read-only, aggregate-only diagnostics; no event contents, session IDs, titles, or paths included: So this instance is overwhelmingly the part-level variant: The six-aggregate concentration also means age-based session deletion is a poor primary fix: a few output-heavy sessions can generate most of the growth quickly. The durable stream needs bounded/coalesced intermediate part updates or supported projection-aware event compaction. A built-in cleanup command for already affected databases would still be valuable. The installed 1.18.25 source path I checked still calls Please consider re-opening this. |
Issue for this PR
Closes #30001
Related to #35543. This PR also coalesces metadata updates and uses a bounded trailing-output drain.
Type of change
What does this PR do?
The shell tool currently awaits ctx.metadata for every decoded output chunk. For chatty commands, pipe chunking therefore controls durable update frequency, and process exit can win before trailing pipe output is consumed.
This change consumes output immediately, publishes the newest cumulative preview at most every 100 ms, then allows 100 ms for trailing output and performs a final flush before returning. The cumulative metadata.output contract is unchanged.
How did you verify your code works?
Screenshots / recordings
N/A
Checklist