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:510–530  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 3

make_hookFunction · 0.70
unwrapMethod · 0.45
parse_eventMethod · 0.45

Tested by

no test coverage detected