Description
opencode run --format json doesn't include the user's prompt anywhere in the event stream. The stream starts at step_start, goes straight to the assistant's text / tool_use / step_finish events, and never emits anything carrying the message I sent. Anything that rebuilds a transcript from the JSON stream (logging, eval harnesses, ATIF exporters) loses the user turn entirely.
opencode export <sessionID> does contain the user message, so it's recorded internally — it just never reaches the run stream.
Looking at packages/opencode/src/cli/cmd/run.ts, the text handler in the event loop only emits parts gated on part.time?.end, and a user text part has no time field, so it's skipped. There's also no dedicated user/prompt event type in JSON mode, so even the assistant text events carry no role to distinguish them.
Plugins
No response
OpenCode version
1.15.10
Steps to reproduce
opencode --model=openai/gpt-4o-mini run --format json -- "say hello"
- Read stdout — the first line is
step_start; no event contains say hello.
opencode export <sessionID> — the user message is present there, confirming it's stored but not streamed.
Screenshot and/or share link
No response
Operating System
macOS (Darwin 25.5.0)
Terminal
No response
Description
opencode run --format jsondoesn't include the user's prompt anywhere in the event stream. The stream starts atstep_start, goes straight to the assistant'stext/tool_use/step_finishevents, and never emits anything carrying the message I sent. Anything that rebuilds a transcript from the JSON stream (logging, eval harnesses, ATIF exporters) loses the user turn entirely.opencode export <sessionID>does contain the user message, so it's recorded internally — it just never reaches the run stream.Looking at
packages/opencode/src/cli/cmd/run.ts, the text handler in the event loop only emits parts gated onpart.time?.end, and a user text part has notimefield, so it's skipped. There's also no dedicated user/prompt event type in JSON mode, so even the assistanttextevents carry no role to distinguish them.Plugins
No response
OpenCode version
1.15.10
Steps to reproduce
opencode --model=openai/gpt-4o-mini run --format json -- "say hello"step_start; no event containssay hello.opencode export <sessionID>— the user message is present there, confirming it's stored but not streamed.Screenshot and/or share link
No response
Operating System
macOS (Darwin 25.5.0)
Terminal
No response