pub(super) fn terminal_status(
tool_use_id: Option<&str>,
parent_results: &HashMap<String, bool>,
) -> SubAgentStatusExpand description
What an Active subagent’s status should become once its parent turn is
confirmed idle.
Completed when the parent recorded a tool_result for this dispatch —
proof it returned. Abandoned otherwise, which now means what it always
claimed to: no evidence it ever came back.
An errored result still counts as Completed. The distinction this
draws is returned vs cut off, and a dispatch that reported an error
returned. Folding failures into Abandoned would recreate the same
conflation this fix exists to remove, just with a smaller blast radius.
Surfacing the error state itself needs a status the enum doesn’t have yet
(and a matching frontend union) — tracked as follow-up in the report above.
Nothing reads the is_error flag today — this function only asks
contains_key. It is parsed and carried in parent_results purely so the
follow-up has it available without re-reading every transcript; do not
mistake that for it being surfaced or logged anywhere (reagent P2 on
#3007, on an earlier version of this comment that claimed otherwise).