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

Function test_parse_session_start

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

Source from the content-addressed store, hash-verified

874
875 #[test]
876 fn test_parse_session_start() {
877 let input = br#"{
878 "session_id": "sess-123",
879 "transcript_path": "/tmp/codex.jsonl",
880 "model": "gpt-5.5",
881 "source": "startup",
882 "cwd": "/repo"
883 }"#;
884 let event = make_hook()
885 .parse_event(HookType::SessionStart, input)
886 .unwrap();
887 assert_eq!(event.session_id, "sess-123");
888 assert_eq!(event.event_type, HookType::SessionStart);
889 assert_eq!(
890 event.transcript_path.as_deref(),
891 Some(Path::new("/tmp/codex.jsonl"))
892 );
893 let raw = event.raw_json.unwrap();
894 assert_eq!(raw["model"], "gpt-5.5");
895 assert_eq!(raw["provider"], "openai");
896 }
897
898 #[test]
899 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