Skip to content

[Critical] Agent Crash due to Unhandled File Path Error in Telegram Output #38

@lhb-goku

Description

@lhb-goku

The agent crashed and entered a zombie state after attempting to send a message to Telegram. The system incorrectly interpreted a text string (likely malformed output or a log snippet starting with prefix):) as a file path and attempted to open() it for upload. The resulting error was not handled gracefully, causing the agent's goroutine to panic or terminate unexpectedly.

Logs:
time=2026-03-02T12:23:39.304+07:00 level=ERROR msg="error sending message to channel" channel=telegram error="open document prefix): open prefix): no such file or directory" time=2026-03-02T12:25:04.670+07:00 level=WARN msg="inbound: agent not found" agent=default channel=telegram
Root Cause:
• The Telegram output adapter likely lacks validation for file_path before attempting os.Open().
• Error handling for file opening is insufficient, leading to a crash of the agent loop instead of a simple error log/reply.

Proposed Solution:

  1. Validate that the string looks like a valid file path before calling os.Open().
  2. Wrap the file upload logic in a recover() block or robust error handling.
  3. If os.Open() fails, fallback to sending the content as a text message instead of crashing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions