Skip to content

fix(telegram): omit General topic id for model picker#19961

Closed
baenregod wants to merge 1 commit into
NousResearch:mainfrom
baenregod:fix/telegram-model-picker-general-topic
Closed

fix(telegram): omit General topic id for model picker#19961
baenregod wants to merge 1 commit into
NousResearch:mainfrom
baenregod:fix/telegram-model-picker-general-topic

Conversation

@baenregod

Copy link
Copy Markdown

Summary

  • Reuse Telegram's existing thread-id send helper in send_model_picker()
  • Prevent /model inline keyboard sends from passing message_thread_id=1 for the General forum topic
  • Add regression coverage for General-topic omission and non-General topic preservation

Test Plan

  • python -m pytest tests/gateway/test_telegram_approval_buttons.py -q -o 'addopts='\n\n## Context\nTelegram represents the General forum topic internally as thread id 1, but the Bot API rejects outbound message_thread_id=1 with Message thread not found. Normal Telegram text sends already route through _message_thread_id_for_send() to omit this value; the model picker path was bypassing that helper and falling back to the long text model list when the inline keyboard send failed.

@alt-glitch alt-glitch added type/bug Something isn't working P1 High — major feature broken, no workaround comp/gateway Gateway runner, session dispatch, delivery platform/telegram Telegram bot adapter labels May 5, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #12873 — same fix: route send_model_picker() thread_id through _message_thread_id_for_send() to omit General topic id=1.

1 similar comment
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #12873 — same fix: route send_model_picker() thread_id through _message_thread_id_for_send() to omit General topic id=1.

@kshitijk4poor

Copy link
Copy Markdown
Collaborator

Thanks for catching this — the General-topic mapping (message_thread_id="1"None) you proposed for send_model_picker is now on main. It landed via #22410 (salvage of @leehack's #22053 telegram DM topic fix), which routed send_model_picker through _thread_kwargs_for_send — a strict superset of the _message_thread_id_for_send mapping you proposed. That helper now handles both forum General topics (your case) AND Hermes-created DM topic lanes that #22053 was originally about.

The parallel code path in the send_message tool's standalone _send_telegram helper had the same bug — fixed in #22423 just now (Fixes #22267).

Closing as superseded — thanks for the contribution and for keeping us focused on this bug class!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P1 High — major feature broken, no workaround platform/telegram Telegram bot adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants