()
| 1371 | |
| 1372 | #[test] |
| 1373 | fn test_parse_stop_turn_end() { |
| 1374 | let hook = make_hook(); |
| 1375 | let input = br#"{ |
| 1376 | "conversationId": "ec33ebf9", |
| 1377 | "transcriptPath": "/tmp/transcript.jsonl", |
| 1378 | "workspacePaths": ["/workspace/project"], |
| 1379 | "executionNum": 1, |
| 1380 | "terminationReason": "model_stop", |
| 1381 | "error": "", |
| 1382 | "fullyIdle": true |
| 1383 | }"#; |
| 1384 | let event = hook.parse_event(HookType::TurnEnd, input).unwrap(); |
| 1385 | assert_eq!(event.session_id, "ec33ebf9"); |
| 1386 | assert_eq!(event.event_type, HookType::TurnEnd); |
| 1387 | // terminationReason is normalized into finish_reason |
| 1388 | let raw = event.raw_json.unwrap(); |
| 1389 | assert_eq!( |
| 1390 | raw.get("finish_reason").and_then(Value::as_str), |
| 1391 | Some("stop") |
| 1392 | ); |
| 1393 | } |
| 1394 | |
| 1395 | #[test] |
| 1396 | fn test_parse_stop_max_steps_maps_to_length() { |
nothing calls this directly
no test coverage detected