Reproduction for a race condition in @mariozechner/pi-coding-agent's RPC mode. When a consumer sends a new prompt while a previous prompt is still streaming, events on stdout cannot be reliably attributed to the correct turn because streaming events (agent_start, turn_start, message_start, message_end, message_update, turn_end, agent_end) carry no originating-command id. Only command-ack response events are tagged.
bash repro.sh