Stream pi's thinking as an ephemeral live preview #19
Labels
No labels
in-review
ready-for-agent
ready-for-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
weiwen/evie#19
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What to build
Pi already emits its reasoning ("thinking") over the RPC event stream, interleaved with the answer in each cumulative
message_update. Evie currently parses thinking and throws it away, so the user stares at a bare typing indicator during long turns.Stream thinking as an ephemeral preview in the live Telegram message: while the current assistant message has no answer text yet, show the latest thinking prefixed with
💭. The instant answer text begins arriving, the preview flips to the answer. The final delivered message is answer-only — the thinking is never persisted into chat history.The preview must be bounded to a single Telegram message: keep the tail of the thinking (drop the head) so it can never paginate into multiple messages and leave orphaned stale messages behind when the shorter answer lands. The preview string is pre-formatted on the pi side and pushed through the existing string snapshot channel, so the Telegram rendering layer stays unaware of the thinking/answer distinction. The HTTP interface (which discards streamed snapshots) is unaffected.
Note: evie does not set pi's thinking level, so whether thinking events appear depends on pi's default for the configured model. Verify empirically that a preview actually renders; if pi defaults thinking off, that is a separate follow-up (out of scope here).
Acceptance criteria
💭-prefixed thinking preview💭preview, preview flips to plain answer text when text arrives, tail-bounding truncates over-long thinkingcargo build,cargo test,cargo clippyare cleanBlocked by
Implemented in commit
fbef1fdon branch sandcastle/issue-19.Changes:
assistant_thinking()to extract thinking blocks frommessage_updateevents (mirrorsassistant_text())thinking_preview()that tail-bounds raw thinking text to 3800 Unicode chars and prefixes with 💭read_agent_responseto emit thinking preview when amessage_updatehas thinking but no text; text takes priority so the preview flips the instant answer text arrivesNo Rust toolchain in sandbox — CI must validate. Logic is a straightforward extension of the existing snapshot pattern.