executeTurnEndHooks fires turn_end once per turn — symmetric to turn_start. Observational; the result is discarded. Reason is one of the turnEndReason* constants above and is reported via [hooks.Input.Reason] so handlers can branch on the exit path.
(ctx context.Context, sess *session.Session, a *agent.Agent, reason string, events EventSink)
| 201 | // of the turnEndReason* constants above and is reported via |
| 202 | // [hooks.Input.Reason] so handlers can branch on the exit path. |
| 203 | func (r *LocalRuntime) executeTurnEndHooks(ctx context.Context, sess *session.Session, a *agent.Agent, reason string, events EventSink) { |
| 204 | r.dispatchHook(ctx, a, hooks.EventTurnEnd, &hooks.Input{ |
| 205 | SessionID: sess.ID, |
| 206 | AgentName: a.Name(), |
| 207 | Reason: reason, |
| 208 | }, events) |
| 209 | } |
| 210 | |
| 211 | // contextMessages converts a context-providing hook's AdditionalContext |
| 212 | // into a one-element transient system-message slice ready to thread |
no test coverage detected