Skip to main content

parse_devflow_result

Function parse_devflow_result 

Source
pub fn parse_devflow_result(stdout: &str) -> Option<AgentResult>
Expand description

Search stdout for a DEVFLOW_RESULT marker.

The marker is a single line starting with DEVFLOW_RESULT: followed by a JSON object with at minimum a status field. Matching is case-insensitive.

When an agent is run with --output-format json (e.g. Claude), its final message is wrapped in a JSON result envelope with the text — and its embedded newlines — escaped inside a result field. In that case the marker never appears at the start of a line, so we first unwrap the envelope and search the inner text.