Skip to content

feat(telegram): pass reply and selected-quote context to agents - #736

Open
Dvredin wants to merge 7 commits into
littlebearapps:devfrom
Dvredin:feat/telegram-reply-quote-context
Open

feat(telegram): pass reply and selected-quote context to agents#736
Dvredin wants to merge 7 commits into
littlebearapps:devfrom
Dvredin:feat/telegram-reply-quote-context

Conversation

@Dvredin

@Dvredin Dvredin commented Aug 10, 2026

Copy link
Copy Markdown

What

  • decode Telegram selected quotes and reply captions as separate reference data
  • append a bounded, escaped <telegram_reply_context> block only after directive/project/resume routing
  • preserve the replied bot message when the same reply resumes an active, explicit, or persisted session
  • strip only routing-only resume footer lines before serialising the remaining reply reference
  • replace control/format characters and cap the complete serialised block, including wrappers, at 4,000 characters

Why

Replying with “what does this message say?” resumed the correct session but silently discarded the message being referenced. The agent therefore saw the follow-up without its referent. Reply data must remain separate from routing authority, while still reaching the agent after routing has completed.

Testing

  • regression tests failed before the source fix on explicit and active-session resume paths
  • rebased on current dev; isolated full suite: 3242 passed, 3 skipped; coverage 83.41%
  • uv run ruff check src tests
  • uv run ruff format --check --diff src tests
  • uv lock --check
  • docs prebuild + Zensical build
  • Bandit
  • wheel/sdist build, Twine check, and check-wheel-contents

Manual testing

  • reproduced from a Telegram reply whose routing token arrived but whose referenced bot text did not reach the agent prompt
  • verify the repaired prompt end-to-end after the combined owner-stack build is restarted

Related issues

No matching issue or duplicate PR was found in the current repository search.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ef8efb6b-0522-4759-822f-bbe960679805

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Dvredin
Dvredin force-pushed the feat/telegram-reply-quote-context branch from 4681941 to 1a017a7 Compare August 12, 2026 16:12
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.

1 participant