MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_parse_stop_turn_end

Function test_parse_stop_turn_end

atomic-agent/src/hooks/agy.rs:513–533  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

make_hookFunction · 0.70
unwrapMethod · 0.45
parse_eventMethod · 0.45

Tested by

no test coverage detected