Repository navigation
fix(telegram): route poll answers into sessions - #95830
Conversation
|
@openclaw-mantis verify this PR on Telegram Desktop. Please generate before/after GIF evidence for Telegram Scenario:
This PR already has source-level and changed-lane local proof in the PR body; the remaining proof gap is Telegram Desktop visible proof for the real transport path. |
|
Codex review: needs maintainer review before merge. Reviewed August 5, 2026, 5:10 AM ET / 09:10 UTC. ClawSweeper reviewWhat this changesThe PR stores routes for public Telegram polls and delivers authorized poll votes to the originating direct-chat or topic agent session. Merge readinessKeep this PR open: current main accepts poll-answer updates but has no route persistence or handler, while the exact head supplies the missing Telegram-owned path with strong live proof and no verified patch defect. A maintainer should explicitly sponsor the new public-poll agent-turn behavior before merging. Priority: P1 Review scores
Verification
How this fits togetherTelegram poll-answer updates omit the originating chat and topic, so the Telegram plugin must retain that send-time route before converting the vote into its normal inbound message flow. The recovered message then goes through existing authorization, session routing, and durable ingress handling. flowchart LR
A[Public Telegram poll] --> B[Poll route registry]
C[Poll answer update] --> D[Recover chat and topic route]
B --> D
D --> E[Membership and policy checks]
E --> F[Normal inbound agent turn]
Decision needed
Why: Current docs expose public versus anonymous polls but do not establish that public votes must wake an agent, so accepting this new observable behavior requires product intent rather than a purely mechanical review decision. Before merge
Agent review detailsSecurityNone. PR surfaceSource +717, Tests +1365. Total +2082 across 32 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: After an explicit maintainer decision that public Telegram polls should create agent turns, merge this exact head and retain anonymous polls as the display-only default. Do we have a high-confidence way to reproduce the issue? Yes—current main has a clear source reproduction: it returns a poll ID without recording the origin and completes poll-answer updates with no handler or agent turn. The read-only review did not rerun the live Telegram scenario. Is this the best way to solve the issue? Unclear pending product direction: the plugin-local route registry and canonical inbound pipeline are the best technical shape, but maintainers must decide whether public poll visibility should also mean agent-turn routing. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 81238d0c0ec5. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (29 earlier review cycles; latest 8 shown)
|
6b62999 to
40ac7bd
Compare
|
Rebased current head onto latest Fix in this head:
Local validation on
Remaining proof gap is still live Telegram Desktop/Mantis proof for a real non-anonymous poll vote reaching the intended session. The code-level routing defect called out in the last review is fixed in this head. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Updated contributor-side proof for current head Evidence in the PR body now reflects the refreshed 2026-07-04 validation:
The remaining gap is the maintainer-gated Telegram Desktop/Mantis artifact. I tried the workflow-dispatch route from this contributor account, but GitHub rejected it with Maintainer-side next step: please run Mantis Telegram Desktop Proof for PR #95830, or post the Mantis Telegram Desktop proof request from the ClawSweeper review, to capture a non-anonymous Telegram poll vote reaching the correct direct and topic-agent sessions on this head. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Still active. I am refreshing this PR against current |
40ac7bd to
799ef05
Compare
|
@openclaw-mantis telegram desktop proof: verify a non-anonymous Telegram poll vote reaches the correct OpenClaw direct and forum-topic sessions on exact PR head Please capture these current-head scenarios:
The prior registry-read retry finding is fixed on this head. Credentialed Telegram Desktop proof is the remaining contributor-unavailable gate. |
|
@clawsweeper review Please re-review exact head The previous P1 is addressed: keyed-store lookup failures now propagate and a spooled The PR body now distinguishes source coverage from execution proof honestly. Hosted CI is the exact-head executable check; credentialed Telegram Desktop proof remains the explicit external gate. |
c442f33 to
57cf15d
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
57cf15d to
a8e9206
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
a8e9206 to
da45651
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
da45651 to
9ec1ea6
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Thanks @clawSean — landed with durable poll-route ordering and exact-head Telegram direct/forum proof. |
Fixes #89573.
What Problem This Solves
OpenClaw could send Telegram polls, but a vote on a public poll produced no agent turn. Telegram's
poll_answerupdate contains the poll id and voter selection, but omits the originating chat and forum-topic route.Root Cause and Canonical Fix
The Telegram plugin discarded the send-time origin and treated poll answers outside the normal inbound message pipeline. The fix now:
telegram.poll-registry;Unknown polls, retractions, bot votes, identity-less
voter_chatanswers, and unauthorized forwarded-poll voters remain intentional non-outcomes. Polls remain anonymous by default; the tool schema and result now explain that public polls are the opt-in for agent-routed votes.Operator Behavior
Direct-chat public polls enable answer routing immediately. Telegram only guarantees
getChatMemberfor other group members when the bot is an administrator, so group public-poll routing is enabled only after that prerequisite is confirmed. Each vote also proves that the voter is still a current member of the origin group. Disabled group/topic targets, channel poll routes, and anonymous polls return unavailable instead of promising an inbound turn that cannot occur. The poll still sends when routing cannot be enabled, but the message-tool result returnspollAnswerRouting: "unavailable"with a concrete operator action instead of failing silently or resending the poll.This is the best owner-boundary fix: origin is recorded where Telegram still exposes it, authentication remains in Telegram ingress, and the resulting vote follows the same session, reply, delivery, and ordering path as a normal inbound message. The temporary public async admission hook was removed; no core policy, JSON sidecar, parallel session resolver, or new configuration surface was added.
Evidence
ef3ffac7337887ae6b83e4c2651b05a1b79e0031; branch base:a1d20ae31bc57e327747ed99493faaf86339ada9.tsgo, testtsgo, full Oxlint, all 125 plugin package-boundary compiles, formatting, plugin boundaries, SDK surface, dead exports, andgit diff --check. The remote check runner was unavailable during the first changed-gate attempt, so the repository-mandated local fallback produced this evidence.tsgo, focused Oxlint, dead exports, andgit diff --checkpassed.tsgo, focused Oxlint, andgit diff --checkpassed.497, selectedYes, Telegram emitted the vote, the gateway created a new inbound agent request containingPoll response to "Ready?": Yes, and the bot repliedPOLL_VOTE_RECEIVEDas message499.48125, the bot sent poll48127; the real user selectedYes; the vote-triggered reply48130remained in topic48125. The temporary topic was deleted after proof.OPENCLAW_E2E_OKreply from an ephemeral gateway built from this checkout.The exact-head regression pass also resolves the prior review questions without production shims: synthetic poll turns inherit durable replay from the canonical AsyncLocalStorage frame and produce a completed deferred participant; grammY's pinned
sendPollcontract usesmessage_thread_idfor forum supergroups and private bot topics and explicitly disallows channel direct-message chats. The existing direct-topic session test and the new durable replay test cover those contracts.{ "channel": "telegram", "head": "ef3ffac7337887ae6b83e4c2651b05a1b79e0031", "environment": "ephemeral gateway + mock provider + real Telegram Bot API + real TDLib user", "scenarios": [ "direct-chat public poll -> real user vote -> originating agent turn", "forum-topic public poll -> real user vote -> same-topic agent turn" ], "directPollBotApiMessageId": 497, "directReplyBotApiMessageId": 499, "forumTopicId": 48125, "forumPollBotApiMessageId": 48127, "forumReplyBotApiMessageId": 48130, "selectedOption": "Yes", "agentObserved": "Poll response to \"Ready?\": Yes", "visibleReply": "POLL_VOTE_RECEIVED", "providerRequestCount": 3, "verdict": "pass" }Scope Metrics
Redundancy
#89573 is the canonical issue. #95309 is the stale broader sidecar/migration alternative; #72501 is its closed predecessor. This PR uses the current plugin-state and compositional Telegram handler seams.
AI Assistance
Implementation and review were assisted by AI tooling. Maintainer review verified the current send, authorization, session, durable-ingress, storage, and Telegram API contracts before publication.