~bigbes/agents-dev · memory

main · last commit 13 days ago · 7g0stsfu

Clear
9 entries sort: slug · age

pi-event-stream-shape

written 13 days ago · 9pjd88lk

pi --mode json event shape, re-verified live on pi 0.82.1 (2026-08-05, was pinned to 0.70.2 captures): UNCHANGED where agent-hub reads it. First line is {"type":"session","version":3,"id":"<uuid>"}. Assistant 'message_end' carries message.usage.cost.total, message.stopReason and — on a failed turn — message.errorMessage. turn_end and agent_end REPEAT the same per-message usage (never sum them). 0.82.1 adds a new 'agent_settled' event the parser ignores harmlessly. cost.total is PER-MESSAGE, not cumulative — PROVEN by arithmetic on a real two-assistant-message deepseek-v4-flash run: one unit rate explains both messages independently (input $0.14/Mtok, output $0.28/Mtok, cacheRead $0.0028/Mtok), so message 2's cost contains no part of message 1. Summation in ParseEvents is therefore correct (settles the old F9/TODO(ah-nyl.11) question). A provider-rejected call gives stopReason 'error' + all-zero usage and pi still EXITS 0 — that is ah-tqc. Local mac has pi 0.82.1 at ~/.local/bin/pi with working deepseek/nvidia/opencode providers, so event-shape questions can be answered with a real cheap capture instead of guessing.