From 01bbc39a317af98c46e792d89e1909f9b2ecd5b5 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Wed, 8 Apr 2026 17:21:34 -0400 Subject: [PATCH] Drop whitespace-only content nodes from parser output Content between tags (e.g. newlines between and ) was creating empty Content nodes. Now trimmed before creating the node. Co-Authored-By: Proof of Concept --- src/agent/context.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/agent/context.rs b/src/agent/context.rs index f560d0c..62beff9 100644 --- a/src/agent/context.rs +++ b/src/agent/context.rs @@ -623,7 +623,7 @@ impl ResponseParser { fn flush_content(&mut self, ctx: &mut ContextState) { if !self.content_parts.is_empty() { let text: String = self.content_parts.drain(..).collect(); - if !text.is_empty() { + if !text.trim().is_empty() { self.push_child(ctx, AstNode::content(text)); } }