Skip to content

Direct shell persists every output chunk synchronously #37787

Description

@flowluap

Description

The direct user shell path in packages/opencode/src/session/prompt.ts awaits sessions.updatePart for every decoded process-output chunk. Chatty commands therefore couple OS-pipe consumption to SQLite projection and event broadcast work, producing many cumulative durable updates.

Expected: consume process output continuously, publish cumulative running snapshots at a bounded cadence, and persist one authoritative final snapshot without late updates.

A 20-write paced command currently permits up to 20 running updates. A 100 ms publisher reduces this to 4 updates while preserving byte-for-byte final output.

Plugins

None

OpenCode version

dev at f557328

Steps to reproduce

  1. Run a direct shell command that emits many paced chunks, for example i=0; while [ $i -lt 20 ]; do printf '%02d\n' $i; i=$((i + 1)); sleep 0.02; done.
  2. Observe MessageV2.Event.PartUpdated events for the running tool part.
  3. Each decoded output chunk triggers another cumulative durable running-part update.

Screenshot and/or share link

No response

Operating System

macOS 26.5.1

Terminal

Ghostty

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions