As the title suggests, the output of Analytics Conversations Details Query does not include "segment_type: wrapup" until after wrap is completed, unlike all other segment types (interact/hold etc) which do appear at the start.
Observing a number of test calls, the results follow the same pattern:
While agent is wrapping call (Left side of image), the latest segment for purpose = "agent" is still "interact" and its segment_end shows a timestamp. This indicates the interact segment has ended however, it's still the last segment for the agent session.
The expectation is there should be a new segment with a wrapup type at this point.
It's only until the completion of wrap (Right side of image) that the new segment appears in the query output as purpose = "agent" and segment_type = "wrapup".
Cheers,
Eddie