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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

make_hookFunction · 0.70
unwrapMethod · 0.45
parse_eventMethod · 0.45

Tested by

no test coverage detected