From 80bdaab8ee03fcf4deae026abc9afd28283313c2 Mon Sep 17 00:00:00 2001 From: ProofOfConcept Date: Fri, 6 Mar 2026 21:54:19 -0500 Subject: [PATCH] enrich: explicitly filter for text blocks in transcript extraction Only extract content blocks with "type": "text". Previously relied on tool_use/tool_result blocks lacking a "text" field, which worked but was fragile. Now explicitly checks block type. --- src/enrich.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/enrich.rs b/src/enrich.rs index 34fd643..f024129 100644 --- a/src/enrich.rs +++ b/src/enrich.rs @@ -97,8 +97,10 @@ fn extract_conversation(jsonl_path: &str) -> Result { arr.iter() .filter_map(|c| { - if let Some(t) = c.get("text").and_then(|v| v.as_str()) { - Some(t.to_string()) + // Only extract text blocks; skip tool_use, tool_result, thinking, etc. + let is_text = c.get("type").and_then(|v| v.as_str()) == Some("text"); + if is_text { + c.get("text").and_then(|v| v.as_str()).map(|s| s.to_string()) } else { c.as_str().map(|s| s.to_string()) }