Map Antigravity's `terminationReason` onto the `finish_reason` field used by the record pipeline (mirrors the Codex adapter's stop normalization).
(mut raw: Value)
| 389 | /// Map Antigravity's `terminationReason` onto the `finish_reason` field used |
| 390 | /// by the record pipeline (mirrors the Codex adapter's stop normalization). |
| 391 | fn normalize_stop_raw(mut raw: Value) -> Value { |
| 392 | let reason = raw |
| 393 | .get("terminationReason") |
| 394 | .and_then(Value::as_str) |
| 395 | .map(|s| s.to_string()); |
| 396 | |
| 397 | if let Some(reason) = reason { |
| 398 | let finish_reason = match reason.as_str() { |
| 399 | "model_stop" => "stop", |
| 400 | "max_steps_exceeded" => "length", |
| 401 | other => other, |
| 402 | }; |
| 403 | if let Some(obj) = raw.as_object_mut() { |
| 404 | obj.entry("finish_reason".to_string()) |
| 405 | .or_insert_with(|| Value::String(finish_reason.to_string())); |
| 406 | } |
| 407 | } |
| 408 | |
| 409 | raw |
| 410 | } |
| 411 | |
| 412 | /// Map Antigravity's `error` field onto the `status` field the provenance |
| 413 | /// accumulator reads for tool calls. |
no test coverage detected