Skip to content

[Bug]: Text content before tool calls is not delivered on Telegram (only visible in CLI) #6067

@erikamrc84

Description

@erikamrc84

Bug Description

When the model generates text content alongside tool calls in the same turn (e.g. a conversational response + a
memory/vitals update), the text is captured internally (_last_content_with_tools) and printed to CLI output (┊ 💬
...), but never sent to Telegram.

The only message that reaches Telegram is the final_response from the last turn (after tool execution). If that turn
contains new content (e.g. reasoning), the pre-tool text is silently dropped.

Steps to reproduce:

  1. Configure a model that tends to write a response and call tools in the same turn (e.g. MiMo, Gemini)
  2. Chat via Telegram
  3. Send a message that triggers both a text response and a tool call (e.g. a greeting that also updates vitals)
  4. Observe: the text response is visible in journalctl logs but not in Telegram

Steps to Reproduce

  1. Set session_reset: mode: daily in config.yaml
  2. Use a model that generates text + tool calls in the same turn (e.g. MiMo v2 Pro)
  3. Chat via Telegram with a prompt that triggers both a conversational response and a tool call (e.g. a greeting that
    also updates vitals via MCP)
  4. Check journalctl logs — the text response appears as ┊ 💬 ...
  5. Check Telegram — only the post-tool response (e.g. reasoning) is delivered, the pre-tool text is missing

Expected Behavior

Expected: The text generated before tool calls should be included in the Telegram response.

Actual Behavior

The text content generated before tool calls is only visible in CLI/journalctl logs (printed as ┊ 💬 ...) but never
delivered to Telegram. Only the final response after tool execution is sent. If the model produces new content in the
post-tool turn (e.g. reasoning), the pre-tool text is silently dropped.

Affected Component

Agent Core (conversation loop, context compression, memory)

Messaging Platform (if gateway-related)

Telegram

Operating System

Ubuntu 24.04.4 LTS

Python Version

3.13.12

Hermes Version

0.7.0

Relevant Logs / Traceback

Root Cause Analysis (optional)

Relevant code: run_agent.py line ~8169 (_last_content_with_tools) — the fallback at line ~8283 only triggers when the
final response is empty, not when it has content.

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions