Ignore all-newline message chunks at the beginning of LLM content.

DeepSeek 4 Flash likes to send "\n\n" as content between the reasoning
and tool call sections.
This commit is contained in:
Bartosz Taudul
2026-08-03 22:09:48 +02:00
parent 1c2a8b4c40
commit a6d96d4201

View File

@@ -1395,13 +1395,20 @@ void TracyLlm::AppendResponse( const char* name, const nlohmann::json& delta )
{
assert( back[name].is_string() );
back[name].get_ref<std::string&>().append( str );
m_usedCtx++;
}
else
{
back[name] = std::move( str );
for( auto c : str )
{
if( c != '\n' )
{
back[name] = std::move( str );
m_usedCtx++;
break;
}
}
}
m_usedCtx++;
}
else if( json.is_array() )
{