An OpenCode lifecycle event over 512 KiB ends the actor's session
The OpenCode lifecycle reader caps one event at 512 KiB (opencode/lifecycle.rs:9). A tool result carrying an inline image (~3 MB) exceeds it. The daemon logs OpenCode lifecycle event exceeded the bounded buffer, the actor's session ends, and it doesn't resume, because by then the provider has closed the session.
We've hit this on two hosts, and running a 16 MiB bound fixed it. Two PRs, take whichever you prefer:
- #138: per-line framing at 16 MiB that keeps every event.
- narrow: raise the cap to 16 MiB only (branch). One constant and a regression test. An event over 16 MiB still disconnects, as today.
Thanks for the detailed report and both proposed fixes. We integrated your PR #138 into main, keeping the per-line framing approach: the 16 MiB limit now applies to each encoded line rather than an entire HTTP chunk.
We also added an HTTP regression test confirming that an oversized event explicitly disconnects the session and cannot be followed by a misleading successful completion. The large-event and shared-runtime regression tests pass. Thanks for identifying this and providing a concrete fix!