executeStopHooks fires stop hooks when the model finishes responding, passing the final response content as stop_response. SystemMessage is surfaced as a Warning by [dispatchHook]. AgentName + LastUserMessage are populated so builtins like cache_response can key on the user's question and resolve th
(ctx context.Context, sess *session.Session, a *agent.Agent, responseContent string, events EventSink)
| 236 | // are populated so builtins like cache_response can key on the user's |
| 237 | // question and resolve the agent through the runtime closure. |
| 238 | func (r *LocalRuntime) executeStopHooks(ctx context.Context, sess *session.Session, a *agent.Agent, responseContent string, events EventSink) { |
| 239 | r.dispatchHook(ctx, a, hooks.EventStop, &hooks.Input{ |
| 240 | SessionID: sess.ID, |
| 241 | AgentName: a.Name(), |
| 242 | StopResponse: responseContent, |
| 243 | LastUserMessage: sess.GetLastUserMessageContent(), |
| 244 | }, events) |
| 245 | } |
| 246 | |
| 247 | // notifyError fires both notification(level=error) and on_error in one |
| 248 | // call. They're always emitted together (an error is always also a |
no test coverage detected