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

Function test_parse_after_thought

atomic-agent/src/hooks/cursor.rs:1026–1045  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1024
1025 #[test]
1026 fn test_parse_after_thought() {
1027 let hook = make_hook();
1028 let input = br#"{
1029 "conversation_id": "c1",
1030 "text": "I need to check the file structure first",
1031 "duration_ms": 500,
1032 "model": "claude-sonnet-4-6"
1033 }"#;
1034 let event = hook.parse_event(HookType::PostToolUse, input).unwrap();
1035 assert_eq!(event.session_id, "c1");
1036 assert_eq!(event.event_type, HookType::PostToolUse);
1037 assert_eq!(event.tool_name.as_deref(), Some("AgentThought"));
1038 let raw = event.raw_json.unwrap();
1039 assert_eq!(
1040 raw["reasoning_text"],
1041 "I need to check the file structure first"
1042 );
1043 assert_eq!(raw["duration"], 500);
1044 assert_eq!(raw["model"], "claude-sonnet-4-6");
1045 }
1046
1047 #[test]
1048 fn test_parse_after_thought_minimal() {

Callers

nothing calls this directly

Calls 3

make_hookFunction · 0.70
unwrapMethod · 0.45
parse_eventMethod · 0.45

Tested by

no test coverage detected