A transit agency instruments its agent runs with hooks and needs to record a metric each time a delegated agent completes its assigned work. Which statement correctly describes the relevant event?
Select an answer to reveal the explanation.
Short Explanation
Two finish lines, two hooks. SubagentStop trips when a delegated worker hands in its report; Stop is reserved for the main agent wrapping up the whole response.
Full Explanation
Instrumentation has to attach to the scope it is measuring. A transit agency counting completed delegated work is asking about a unit inside the run, not about the run itself, and the hook events distinguish exactly those two scopes.
SubagentStop fires when a delegated agent finishes its work, while Stop fires when the main agent completes its response. A fan-out of five route-analysis subagents therefore produces five SubagentStop events and one Stop, which is precisely the per-delegation granularity the metric needs. The same split matters for gating: a Stop hook blocks the overall response, whereas SubagentStop applies to one delegated unit, so quality checks on delegated output belong there.
Treating Stop as firing for subagents too, with SubagentStop a retained alias, would collapse five delegations into a single count and destroy the metric; placing SubagentStop at launch rather than completion records the event at the wrong moment and makes duration unmeasurable; restricting it to abnormal termination inverts the event's meaning and would force success to be inferred from absence, which cannot distinguish a clean finish from a hook that never ran.
Exam caveat: counting SubagentStop events measures delegations that ended, not delegations that succeeded—the payload has to be inspected to tell those apart. Operational check: run a known fan-out of five and assert the metric records five SubagentStop events and exactly one Stop for the whole run.