pi: finalize message on 'agent_settled' terminal event instead of warning #78

Open
opened 2026-07-21 22:18:53 +08:00 by weiwen · 0 comments
Owner

Symptom

WARN evie::pi: Unrecognized pi event line={"type":"agent_settled"}

pi emits an agent_settled event as (what appears to be) a terminal event. evie doesn't recognize it, so it falls into the PiEvent::Other #[serde(other)] catch-all in handle_pi_event_line (src/pi.rs:764), logs the warning, and returns None. Because no AgentEnd is produced, the turn is never finalized and only ends via idle timeout, exactly the failure mode the Other-branch comment (src/pi.rs:764-768) warns about.

Expected

Seeing agent_settled should finalize the current message: treat it as a terminal event and emit the response from the last MessageEnd text (the cumulative snapshot already tracked), the same way AgentEnd does today (src/pi.rs:761-763).

Notes

  • Add an explicit PiEvent variant for agent_settled rather than leaving it in the Other catch-all.
  • Verify against the current pi event stream whether agent_settled replaces or supplements agent_end so the finalization path handles both without double-finalizing.
## Symptom ``` WARN evie::pi: Unrecognized pi event line={"type":"agent_settled"} ``` pi emits an `agent_settled` event as (what appears to be) a terminal event. evie doesn't recognize it, so it falls into the `PiEvent::Other` `#[serde(other)]` catch-all in `handle_pi_event_line` (`src/pi.rs:764`), logs the warning, and returns `None`. Because no `AgentEnd` is produced, the turn is never finalized and only ends via idle timeout, exactly the failure mode the `Other`-branch comment (`src/pi.rs:764-768`) warns about. ## Expected Seeing `agent_settled` should finalize the current message: treat it as a terminal event and emit the response from the last `MessageEnd` text (the cumulative snapshot already tracked), the same way `AgentEnd` does today (`src/pi.rs:761-763`). ## Notes - Add an explicit `PiEvent` variant for `agent_settled` rather than leaving it in the `Other` catch-all. - Verify against the current pi event stream whether `agent_settled` replaces or supplements `agent_end` so the finalization path handles both without double-finalizing.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
weiwen/evie#78
No description provided.