mirror of
https://github.com/RightNow-AI/openfang.git
synced 2026-07-30 23:05:08 +00:00
When an LLM produces text alongside tool_use blocks (e.g., a chat message followed by memory_store calls), the text was lost if the final EndTurn iteration returned empty text. The empty-response guard would activate and return "[Task completed — the agent executed tools but did not produce a text summary.]" even though the agent DID produce text in an earlier iteration. This is a common pattern when agents are instructed to respond to users AND persist state via memory_store in the same turn. Fix: accumulate text content from all ToolUse iterations. When the final EndTurn has empty text, use accumulated text as fallback before triggering the empty-response guard. Applied to both sync and streaming agent loop paths.