pi: parse turn_end streams

This commit is contained in:
Peter Steinberger
2025-12-10 11:31:21 +00:00
parent cce65e19e1
commit 81385cf820
2 changed files with 69 additions and 38 deletions

View File

@@ -46,6 +46,9 @@ function stripRpcNoise(raw: string): string {
const msgType = msg?.type;
const role = msg?.role;
// Drop early lifecycle frames; we only want final assistant/tool outputs.
if (type === "message_start") continue;
// RPC streaming emits one message_update per delta; skip them to avoid flooding fallbacks.
if (type === "message_update") continue;