Skip to content

fix(telegram): classify inbound events from the canonical mention decision so direct mentions stop lurking#99866

Merged
obviyus merged 1 commit into
mainfrom
fix/inbound-addressing-fact
Jul 4, 2026
Merged

fix(telegram): classify inbound events from the canonical mention decision so direct mentions stop lurking#99866
obviyus merged 1 commit into
mainfrom
fix/inbound-addressing-fact

Conversation

@obviyus

@obviyus obviyus commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Closes #99854

What Problem This Solves

Fixes an issue where a group agent with unmentionedInbound: room_event and message_tool_only delivery would compose answers to direct @-mentions but never post them: every inbound turn — including explicit mentions — was classified room_event, so the model received the lurk directive ("default: no reply; your final text stays private") on every turn and the strong message(action=send) delivery hint never fired. Users tagging the bot saw silence while [source-reply/private-final] warnings accumulated.

Why This Change Was Made

Two "was the bot addressed" facts were computed independently and diverged: the body layer's mention decision fed the prompt context (ExplicitlyMentionedBot: true), while the session layer re-classified the event kind from separately-copied mention booleans and produced room_event for the same message. The fix computes inboundEventKind once in resolveTelegramInboundBody, immediately beside the mention decision and from the same effectiveWasMentioned fact, and carries it forward; the session layer's duplicate classifier wiring is deleted. The contradictory state is now unrepresentable by construction (per the repo rule that hot paths carry prepared facts forward rather than rediscovering them).

User Impact

Tagging the bot (or replying to it) in a group now reliably classifies as a user request, so the strong delivery hint fires and the agent posts visibly via message(action=send). Unmentioned group chatter still lurks as room events — no regression to selective-speech behavior.

Evidence

  • Fail-confirmed regression (production repro): with the fix reverted, expected 'room_event' to be 'user_request'; green after. Coverage: explicit @-mention → user_request; unmentioned chatter → room_event; reply-to-bot → user_request.
  • Focused suites (bot-message-context dm-threads/require-mention/reactions/sticker/dm-topic) green; oxlint and git diff --check clean; re-verified after rebase onto current main.
  • Commit is net-deletion in prod code (+24/−18 across three files; the removed lines are the duplicate classifier wiring).
  • Landed on maintainer instruction with manual orchestrator review in lieu of CI wait; live confirmation follows on the next production deployment.

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram size: S maintainer Maintainer-authored PR labels Jul 4, 2026
@obviyus
obviyus merged commit a845c0e into main Jul 4, 2026
36 of 38 checks passed
@obviyus
obviyus deleted the fix/inbound-addressing-fact branch July 4, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Direct @-mentions classified as room_event: mention fact diverges between classifier and prompt context, agent lurks instead of replying

1 participant