transcript: decode Pi assistant content once; let go of a long pending line

main

Commit

Stefan Haubold1w ago

Follow-ups from #2904 (trail 2589):

  • piDecodeMessage built the whole record (decoding every tool call's arguments and marshalling the blocks) only to learn whether the message is empty, and unmarshalled the content a second time for its tool call IDs. One pass over the content blocks now gives both, without decoding arguments.
  • Feed kept pending's backing array after a line it held was read, so one long line in a live stream stayed allocated for the adapter's lifetime. A buffer over 1 MiB is now let go.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com Entire-Checkpoint: 01M649R4TMNEY2GME9GTEGZYCW