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

Function test_parse_session_start

atomic-agent/src/hooks/codex.rs:716–736  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

714
715 #[test]
716 fn test_parse_session_start() {
717 let input = br#"{
718 "session_id": "sess-123",
719 "transcript_path": "/tmp/codex.jsonl",
720 "model": "gpt-5.5",
721 "source": "startup",
722 "cwd": "/repo"
723 }"#;
724 let event = make_hook()
725 .parse_event(HookType::SessionStart, input)
726 .unwrap();
727 assert_eq!(event.session_id, "sess-123");
728 assert_eq!(event.event_type, HookType::SessionStart);
729 assert_eq!(
730 event.transcript_path.as_deref(),
731 Some(Path::new("/tmp/codex.jsonl"))
732 );
733 let raw = event.raw_json.unwrap();
734 assert_eq!(raw["model"], "gpt-5.5");
735 assert_eq!(raw["provider"], "openai");
736 }
737
738 #[test]
739 fn test_parse_session_start_uses_thread_id_fallback() {

Callers

nothing calls this directly

Calls 3

make_hookFunction · 0.70
unwrapMethod · 0.45
parse_eventMethod · 0.45

Tested by

no test coverage detected