StreamStoppedEvent reports that a RunStream loop has stopped. Reason carries the turnEndReason* classification (normal, error, canceled) so consumers can tell successful completion apart from crashes and user-initiated stops. Delivery is best-effort: it is emitted non-blockingly during teardown and
| 497 | // the guaranteed terminal signal. Do not assume session-end hooks have finished |
| 498 | // when this event arrives: it is emitted before they run. |
| 499 | type StreamStoppedEvent struct { |
| 500 | AgentContext |
| 501 | |
| 502 | Type string `json:"type"` |
| 503 | SessionID string `json:"session_id,omitempty"` |
| 504 | Reason string `json:"reason,omitempty"` |
| 505 | } |
| 506 | |
| 507 | func StreamStopped(sessionID, agentName, reason string) Event { |
| 508 | return &StreamStoppedEvent{ |
nothing calls this directly
no outgoing calls
no test coverage detected