pub fn encode_failure(failure: &ToolFailure) -> Value
Encodes a tool failure as the sentinel completion output.