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

Function test_parse_task_start

atomic-agent/src/hooks/cline.rs:591–608  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

589
590 #[test]
591 fn test_parse_task_start() {
592 let hook = make_hook();
593 let input = br#"{
594 "taskId": "abc123",
595 "hookName": "TaskStart",
596 "timestamp": "1736654400000",
597 "workspaceRoots": ["/path/to/project"],
598 "model": {"provider": "openrouter", "slug": "anthropic/claude-sonnet-4.5"},
599 "taskStart": {"task": "Add authentication to the API"}
600 }"#;
601 let event = hook.parse_event(HookType::SessionStart, input).unwrap();
602 assert_eq!(event.session_id, "abc123");
603 assert_eq!(event.event_type, HookType::SessionStart);
604 assert_eq!(
605 event.prompt.as_deref(),
606 Some("Add authentication to the API")
607 );
608 }
609
610 #[test]
611 fn test_parse_task_start_with_model_info() {

Callers

nothing calls this directly

Calls 3

make_hookFunction · 0.70
unwrapMethod · 0.45
parse_eventMethod · 0.45

Tested by

no test coverage detected