Map Antigravity's `terminationReason` onto the `finish_reason` field used by the record pipeline (mirrors the Codex adapter's stop normalization).
(mut raw: Value)
| 1074 | /// Map Antigravity's `terminationReason` onto the `finish_reason` field used |
| 1075 | /// by the record pipeline (mirrors the Codex adapter's stop normalization). |
| 1076 | fn normalize_stop_raw(mut raw: Value) -> Value { |
| 1077 | let reason = raw |
| 1078 | .get("terminationReason") |
| 1079 | .and_then(Value::as_str) |
| 1080 | .map(|s| s.to_string()); |
| 1081 | |
| 1082 | if let Some(reason) = reason { |
| 1083 | let finish_reason = match reason.as_str() { |
| 1084 | "model_stop" => "stop", |
| 1085 | "max_steps_exceeded" => "length", |
| 1086 | other => other, |
| 1087 | }; |
| 1088 | if let Some(obj) = raw.as_object_mut() { |
| 1089 | obj.entry("finish_reason".to_string()) |
| 1090 | .or_insert_with(|| Value::String(finish_reason.to_string())); |
| 1091 | } |
| 1092 | } |
| 1093 | |
| 1094 | raw |
| 1095 | } |
| 1096 | |
| 1097 | /// Map Antigravity's `error` field onto the `status` field the provenance |
| 1098 | /// accumulator reads for tool calls. |
no test coverage detected