hermes - ✅(Solved) Fix [Bug]: send_model_picker bypasses _message_thread_id_for_send — "Message thread not found" in topic groups [3 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#12839Fetched 2026-04-20 12:16:43
View on GitHub
Comments
1
Participants
2
Timeline
8
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×3referenced ×3commented ×1labeled ×1

Error Message

paste.rs: HTTP Error 503: Service Temporarily Unavailable dpaste.com: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1016)>)

Additional Logs / Traceback (optional)

The gateway error log confirms:

Root Cause

Root Cause Analysis (optional)

Fix Action

Fixed

PR fix notes

PR #12853: fix(telegram): route model-picker thread_id through _message_thread_id_for_send

Description (problem / solution / changelog)

Problem

In Telegram forum groups with topics enabled, `/model` silently fell back to plain-text output instead of showing the interactive inline-keyboard picker. Reporter @wl-lgtm traced it (#12839) to `send_model_picker()` in `gateway/platforms/telegram.py`: it passes `message_thread_id=int(thread_id)` directly, skipping the `_message_thread_id_for_send()` helper that every other send method in the adapter uses. The helper converts the General-topic sentinel `"1"` to `None`; without it, Telegram sees `message_thread_id=1` (a non-existent topic) and rejects with "Message thread not found". The picker's try/except then logs a warning and the CLI falls back to text.

Fix

Swap the direct `int(thread_id) if thread_id else None` for the existing `self._message_thread_id_for_send(thread_id)` helper. Thirteen other call sites in this file already use it (send_text, send_photo, send_animation, voice, audio, etc.), so this just brings the picker in line.

Pre-implement audit

  • A (existing helper): `_message_thread_id_for_send` defined at line 269, already imported and used in 13 other call sites. Reuse.
  • B (shared callers): The helper is a classmethod; contract is preserved — this PR only adds a 14th call site, no signature change.
  • C (broader rival): No rival PR for #12839. `gh pr list --search "send_model_picker"` returns only historical unrelated commits.

Testing

New `tests/gateway/test_telegram_model_picker_thread.py`:

  • `test_send_model_picker_normalizes_general_topic_sentinel_to_none` — asserts that `metadata={"thread_id": "1"}` results in `send_message(..., message_thread_id=None, ...)`.
  • `test_send_model_picker_passes_real_thread_id_through` — asserts `"42"` stays `42` (no over-correction).

Both pass locally (2/2).

Fixes #12839

Changed files

  • gateway/platforms/telegram.py (modified, +5/-1)
  • tests/gateway/test_telegram_model_picker_thread.py (added, +136/-0)

PR #12856: fix(telegram): use _message_thread_id_for_send in send_model_picker

Description (problem / solution / changelog)

Fix

Closes #12839

send_model_picker was using int(thread_id) if thread_id else None directly instead of self._message_thread_id_for_send(thread_id), which all other send methods use. This caused:

  • General topic (thread_id="1") to pass message_thread_id=1 instead of None, triggering 'Message thread not found' errors
  • The picker to fall back to plain text output in forum groups

Changes

  • gateway/platforms/telegram.py: Replace inline thread_id logic with self._message_thread_id_for_send(thread_id) in send_model_picker
  • Tests: 3 new tests covering normal topics, General topic mapping, and no-thread scenarios

Changed files

  • gateway/platforms/telegram.py (modified, +1/-1)
  • tests/gateway/test_telegram_thread_fallback.py (modified, +96/-3)

PR #12873: fix: use _message_thread_id_for_send() in send_model_picker() for forum topics

Description (problem / solution / changelog)

Problem

In send_model_picker(), the code directly read metadata.get("thread_id") and passed int(thread_id) as message_thread_id to send_message(). This bypassed _message_thread_id_for_send(), which contains special handling for Telegram forum General topics (thread_id == "1" should be sent as None). As a result, sending the model picker in a forum General topic caused Telegram to return "Message thread not found".

Solution

Replace the raw metadata access with self._metadata_thread_id(metadata) and use self._message_thread_id_for_send(thread_id) when calling send_message(). This aligns send_model_picker() with all other send methods in the adapter, ensuring consistent forum topic handling.

Verification

  • Code review confirmed the two-line change matches the pattern already used in send(), send_exec_approval(), and send_typing().
  • No other callers of send_message() in the adapter bypass _message_thread_id_for_send().

Closes #12839.

Changed files

  • gateway/platforms/telegram.py (modified, +2/-2)

Code Example

hermes debug share
⚠️  This will upload the following to a public paste service:
System info (OS, Python version, Hermes version, provider, which API keys
    are configured — NOT the actual keys)
Recent log lines (agent.log, errors.log, gateway.log — may contain
    conversation fragments and file paths)
Full agent.log and gateway.log (up to 512 KB each — likely contains
    conversation content, tool outputs, and file paths)

Pastes auto-delete after 6 hours.

Collecting debug report...
Uploading...

Debug report uploaded:
  Report     https://paste.rs/9XJn4
  agent.log  https://paste.rs/rHvmO

  (failed to upload: gateway.log: Failed to upload to any paste service:
  paste.rs: HTTP Error 503: Service Temporarily Unavailable
  dpaste.com: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1016)>)

Pastes will auto-delete in 6 hours.
To delete now:  hermes debug delete <url>

Share these links with the Hermes team for support.

---
RAW_BUFFERClick to expand / collapse

Bug Description

In Telegram forum groups (topics enabled), /model falls back to text output instead of showing the interactive inline-keyboard picker.

Steps to Reproduce

  1. Open a Telegram forum group with topics enabled
  2. Send /model in any topic (including General)
  3. Observe: text list is returned instead of interactive picker

Expected Behavior

interactive picker shown

Actual Behavior

just text output of models

Affected Component

Gateway (Telegram/Discord/Slack/WhatsApp)

Messaging Platform (if gateway-related)

Telegram

Debug Report

hermes debug share
⚠️  This will upload the following to a public paste service:
  • System info (OS, Python version, Hermes version, provider, which API keys
    are configured — NOT the actual keys)
  • Recent log lines (agent.log, errors.log, gateway.log — may contain
    conversation fragments and file paths)
  • Full agent.log and gateway.log (up to 512 KB each — likely contains
    conversation content, tool outputs, and file paths)

Pastes auto-delete after 6 hours.

Collecting debug report...
Uploading...

Debug report uploaded:
  Report     https://paste.rs/9XJn4
  agent.log  https://paste.rs/rHvmO

  (failed to upload: gateway.log: Failed to upload to any paste service:
  paste.rs: HTTP Error 503: Service Temporarily Unavailable
  dpaste.com: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1016)>)

⏱  Pastes will auto-delete in 6 hours.
To delete now:  hermes debug delete <url>

Share these links with the Hermes team for support.

Operating System

Mac OS 26.3.1

Python Version

Python 3.14.4

Hermes Version

0.10

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

send_model_picker() (line 1315 in gateway/platforms/telegram.py) passes message_thread_id directly: message_thread_id=int(thread_id) if thread_id else None, Every other send method in the adapter uses _message_thread_id_for_send(), which converts the General topic sentinel "1" to None. Without this conversion, Telegram receives message_thread_id=1 for the General topic and rejects it with "Message thread not found" — since there's no actual forum topic with ID 1.

The gateway error log confirms: WARNING gateway.platforms.telegram: [Telegram] send_model_picker failed: Message thread not found

Proposed Fix (optional)

Two-line change in send_model_picker():

Line 1309: use existing helper instead of raw metadata access

thread_id = self._metadata_thread_id(metadata)

Line 1315: route through _message_thread_id_for_send like every other method

message_thread_id=self._message_thread_id_for_send(thread_id),

Are you willing to submit a PR for this?

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

extent analysis

TL;DR

The issue can be fixed by modifying the send_model_picker() function in gateway/platforms/telegram.py to use the existing _message_thread_id_for_send() helper.

Guidance

  • Review the send_model_picker() function and verify that it is passing the message_thread_id directly without conversion.
  • Check the gateway error log for the "Message thread not found" warning to confirm the root cause.
  • Apply the proposed fix by changing the send_model_picker() function to use the _message_thread_id_for_send() helper for thread ID conversion.
  • Test the fix by sending the /model command in a Telegram forum group with topics enabled and verify that the interactive picker is displayed.

Example

# Modified send_model_picker() function
def send_model_picker(self, metadata):
    # ...
    thread_id = self._metadata_thread_id(metadata)
    message_thread_id = self._message_thread_id_for_send(thread_id)
    # ...

Notes

The proposed fix assumes that the _message_thread_id_for_send() helper is correctly implemented and handles the conversion of the General topic sentinel "1" to None. If this helper function is not correctly implemented, additional changes may be required.

Recommendation

Apply the workaround by modifying the send_model_picker() function as proposed, as it directly addresses the identified root cause and should resolve the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - ✅(Solved) Fix [Bug]: send_model_picker bypasses _message_thread_id_for_send — "Message thread not found" in topic groups [3 pull requests, 1 comments, 2 participants]