Map Antigravity's `error` field onto the `status` field the provenance accumulator reads for tool calls.
(mut raw: Value)
| 412 | /// Map Antigravity's `error` field onto the `status` field the provenance |
| 413 | /// accumulator reads for tool calls. |
| 414 | fn normalize_tool_raw(mut raw: Value) -> Value { |
| 415 | let has_error = raw |
| 416 | .get("error") |
| 417 | .and_then(Value::as_str) |
| 418 | .is_some_and(|e| !e.is_empty()); |
| 419 | |
| 420 | if let Some(obj) = raw.as_object_mut() { |
| 421 | obj.entry("status".to_string()).or_insert_with(|| { |
| 422 | Value::String(if has_error { "error" } else { "completed" }.to_string()) |
| 423 | }); |
| 424 | } |
| 425 | |
| 426 | raw |
| 427 | } |
| 428 | |
| 429 | #[cfg(test)] |
| 430 | mod tests { |
no test coverage detected