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

Function test_parse_session_start

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

Source from the content-addressed store, hash-verified

860
861 #[test]
862 fn test_parse_session_start() {
863 let input = br#"{
864 "session_id": "sess-123",
865 "transcript_path": "/tmp/codex.jsonl",
866 "model": "gpt-5.5",
867 "source": "startup",
868 "cwd": "/repo"
869 }"#;
870 let event = make_hook()
871 .parse_event(HookType::SessionStart, input)
872 .unwrap();
873 assert_eq!(event.session_id, "sess-123");
874 assert_eq!(event.event_type, HookType::SessionStart);
875 assert_eq!(
876 event.transcript_path.as_deref(),
877 Some(Path::new("/tmp/codex.jsonl"))
878 );
879 let raw = event.raw_json.unwrap();
880 assert_eq!(raw["model"], "gpt-5.5");
881 assert_eq!(raw["provider"], "openai");
882 }
883
884 #[test]
885 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