()
| 508 | |
| 509 | #[test] |
| 510 | fn test_parse_stop_turn_end() { |
| 511 | let hook = make_hook(); |
| 512 | let input = br#"{ |
| 513 | "conversationId": "ec33ebf9", |
| 514 | "transcriptPath": "/tmp/transcript.jsonl", |
| 515 | "workspacePaths": ["/workspace/project"], |
| 516 | "executionNum": 1, |
| 517 | "terminationReason": "model_stop", |
| 518 | "error": "", |
| 519 | "fullyIdle": true |
| 520 | }"#; |
| 521 | let event = hook.parse_event(HookType::TurnEnd, input).unwrap(); |
| 522 | assert_eq!(event.session_id, "ec33ebf9"); |
| 523 | assert_eq!(event.event_type, HookType::TurnEnd); |
| 524 | // terminationReason is normalized into finish_reason |
| 525 | let raw = event.raw_json.unwrap(); |
| 526 | assert_eq!( |
| 527 | raw.get("finish_reason").and_then(Value::as_str), |
| 528 | Some("stop") |
| 529 | ); |
| 530 | } |
| 531 | |
| 532 | #[test] |
| 533 | fn test_parse_stop_max_steps_maps_to_length() { |
nothing calls this directly
no test coverage detected