Skip to content

[codex] fix Telegram reply context mixing#122

Draft
attid wants to merge 1 commit into
PleasePrompto:mainfrom
attid:codex/telegram-reply-context
Draft

[codex] fix Telegram reply context mixing#122
attid wants to merge 1 commit into
PleasePrompto:mainfrom
attid:codex/telegram-reply-context

Conversation

@attid
Copy link
Copy Markdown
Contributor

@attid attid commented May 3, 2026

Summary

This fixes Telegram reply handling so that when a user replies to a message and addresses the bot, the bot receives both the replied-to text and the user message.

Root Cause

Telegram reply metadata was only used to decide whether a message was addressed to the bot. The replied-to message content was never merged into the prompt sent to the orchestrator, so the model only saw the new message text.

Changes

  • add a small Telegram helper that merges reply context into the prompt
  • update _resolve_text() to include reply_to_message.text or reply_to_message.caption
  • add a regression test covering reply plus mention in group chat

Impact

Telegram users can now reply to an existing message and mention the bot without losing the original message context in the prompt.

Validation

  • uv run pytest tests/messenger/telegram/test_app.py tests/messenger/telegram/test_handlers.py -q

@PleasePrompto
Copy link
Copy Markdown
Owner

I reviewed this draft and left it unmerged because it is still marked as draft. I did not find malicious-code indicators in the small Telegram reply-context diff, but I want it out of draft and rebased against v0.17.0 before a merge review. Thanks for the focused fix.

@attid attid force-pushed the codex/telegram-reply-context branch from eacfa37 to 6bc18c4 Compare May 18, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants