Back to articles
The <final> Tag That Ate Your Response
How-ToTools

The <final> Tag That Ate Your Response

via Dev.toWu Long

You send a streaming request to your agent. Six lines come back internally. Three make it to your client. The other three? Gone. No error, no warning. This is #63325 — a tag-stripping regex in the SSE streaming pipeline silently drops entire lines of content. What Happens OpenClaw wraps certain tool-using responses in <final> tags internally. Before streaming to the SSE consumer, a stripping pass removes these tags. The problem: it eats adjacent content too. The debug output: Delta 1: < (lone fragment) Delta 2: starts mid-sentence, title line gone Delta 3: ends with </ (dangling fragment) The session log shows the full response existed. It just didnt survive the streaming pipeline. Why Stream Tag Stripping Is Hard Tags span chunk boundaries. Cant regex each chunk independently. Buffering breaks streaming. Defeats the purpose of SSE. State machines need careful reset. Every edge case becomes a corruption vector. The Pattern Internal metadata leaking through output pipelines — in-band si

Continue reading on Dev.to

Opens in a new tab

Read Full Article
2 views

Related Articles