Skip to content

fix(telegram): skip rich entity detection for emails - #68757

Open
ooiuuii wants to merge 1 commit into
NousResearch:mainfrom
ooiuuii:fix/telegram-email-entity-detection
Open

fix(telegram): skip rich entity detection for emails#68757
ooiuuii wants to merge 1 commit into
NousResearch:mainfrom
ooiuuii:fix/telegram-email-entity-detection

Conversation

@ooiuuii

@ooiuuii ooiuuii commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Keeps Telegram rich messages deliverable when status, draft, or final text contains an email address.

  • detects email-like tokens in the centralized rich-message payload builder
  • sets skip_entity_detection before Telegram can auto-link an invalid provider-prefixed email entity
  • covers rich send, edit, and draft paths through the shared builder
  • preserves normal entity detection for content without email tokens

Related Issue

Fixes #68754

Type of Change

  • Bug fix
  • Tests

How Has This Been Tested?

  • pytest tests/gateway/test_telegram_rich_messages.py tests/gateway/test_telegram_rich_newlines.py -q (85 passed)
  • ruff check plugins/platforms/telegram/adapter.py tests/gateway/test_telegram_rich_newlines.py
  • git diff --check

Checklist

  • I have performed a self-review of my code
  • I have added tests that prove the fix is effective
  • New and existing focused tests pass locally

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins platform/telegram Telegram bot adapter labels Jul 21, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused fix. The premise remains present on current main: _rich_message_payload() only emits skip_entity_detection for an explicit caller flag (plugins/platforms/telegram/adapter.py:1670-1685), while rich send, edit, and draft all call that shared builder with the default (plugins/platforms/telegram/adapter.py:1791, 1900, 1994).

The PR's centralized, email-shaped predicate therefore reaches all reported delivery paths without the broader every-@ behavior discussed on #68754/#68852. The added URL control case in tests/gateway/test_telegram_rich_newlines.py:120 also preserves normal entity detection for non-email content. No blocking issues found.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 30, 2026
@GottZ

GottZ commented Aug 3, 2026

Copy link
Copy Markdown

This was generated by AI during triage.

Summary

Two open PRs address #68754 through the shared Telegram rich-message payload builder: #68757 uses an email-token predicate matching the reported failure, while #68852 triggers on every @ and also changes profile skill counting.

Related pull requests

Duplicates

#68757 and #68852 substantially duplicate the Telegram fix in the same shared payload builder; #68852 is the broader mixed-scope variant.

Suggested consolidation

Keep #68757 open with a salvage path: retain its centralized email-token predicate and focused regression tests, consistent with the maintainer-bot keep-open verdict. Close #68852 as a duplicate of #68757 despite its COMMENTED keep-open review, because its diff uses the contributor-rejected every-@ policy and bundles the separately identified profile-counting defect; any profile work should be split into a correctly scoped PR.

Complex graph

flowchart LR
    classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
    classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
    classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
    classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
    classDef best stroke-width:3px,stroke:#b45309
    classDef target stroke-width:3px,stroke:#4338ca
    I68754(["issue #68754 (open)"])
    subgraph Dup68757 ["PRs duplicating each other"]
        P68757["PR #68757 (open)"]
        P68852["PR #68852 (open)"]
    end
    P68757 -->|best fix| I68754
    class I68754 open
    class P68757 open
    class P68852 open
    class P68757 best
    class P68757 target
    click I68754 "https://github.com/NousResearch/hermes-agent/issues/68754"
    click P68757 "https://github.com/NousResearch/hermes-agent/pull/68757"
    click P68852 "https://github.com/NousResearch/hermes-agent/pull/68852"
Loading

Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label).

Cross-PR triage: Reviewed 2 pull requests and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 11 kB of PR diffs, 3 kB of issue/PR text, 2 kB of discussion (4 comments), 3 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.

@ooiuuii
ooiuuii force-pushed the fix/telegram-email-entity-detection branch from dc9b788 to 4ef33c5 Compare August 13, 2026 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have platform/telegram Telegram bot adapter sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Telegram rich messages can reject provider-prefixed email text

4 participants