pub async fn run_captured(cmd: &mut Command, agent_name: &str) -> Result<String>
Run a command capturing stdout and stderr, returning stdout text on success.
Stdin is inherited. On failure, stderr is included in the error message.