Repository navigation
fix(telegram): preserve direct-message topic routing - #126207
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 19, 2026, 8:47 PM ET / August 20, 2026, 00:47 UTC. ClawSweeper reviewWhat this changesThe PR preserves Telegram direct-message topic identity from inbound routing through sessions and outbound sends so replies use Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessNo source-level patch blocker found: the branch restores distinct direct-message topic identity through routing and delivery. Keep it open because the Telegram-scoped policy requires real Telegram proof before merge, and the supplied evidence is mock/test-only. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherThe Telegram plugin turns incoming updates into a scoped conversation and session identity, then uses that identity to route agent work and replies. The change keeps direct-message topics distinct from forum topics all the way to the Telegram Bot API. flowchart LR
A[Telegram update] --> B[Thread scope detection]
B --> C[Conversation identity]
C --> D[Session and binding route]
D --> E[Reply delivery target]
E --> F[Telegram Bot API]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +21, Tests +140. Total +161 across 43 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Mantis proof suggestionA Telegram Desktop recording can directly prove the visible routing result that mocks cannot establish. A maintainer can ask Mantis to capture proof by posting this exact PR comment: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the canonical scoped identity only after a redacted Telegram Desktop or bot-to-bot run proves an inbound direct-message topic produces a reply in that same topic with Do we have a high-confidence way to reproduce the issue? Yes, from source: current main classifies direct-message topics separately but serializes their binding route as a forum topic; the branch’s focused transport test exercises the corrected inbound-to-delivery path. Is this the best way to solve the issue? No for merge yet: the scoped identity is the best source-level repair, but it still needs real Telegram behavior proof for the external Bot API boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0a86702241ce. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
4eeaf75 to
97a000f
Compare
97a000f to
9c17255
Compare
9c17255 to
737834d
Compare
|
Addressed the exact-head persisted-state P1 in f702f73cb544d6a548b0249c9e07e60511342200. Current main correctly recorded a channel Direct Messages target as The repair is plugin-owned and evidence-driven: only an authenticated inbound Direct Messages topic observation promotes the exact matching legacy identity. Session state moves first through the existing canonical session replacement transaction, preserving the session id, transcript, windows/artifacts, and conversation-delivery references. The binding then moves atomically as one plugin-state key/value operation, including its hashed storage key. This ordering is recoverable across the two databases: a session failure leaves the legacy binding intact, while a later binding failure leaves canonical history available and retryable. Forum topics remain Proof:
Incremental repair delta: production +421/-4 (net +417); tests +447/-0. Total PR delta is production +755/-317 (net +438); tests +640/-53. The production growth is the two required ownership capabilities: an atomic plugin-state key move and canonical session-alias promotion with complete reference rehoming, plus the Telegram observation/migration coordinator. Live Telegram Desktop proof remains unavailable because no approved seeded channel Direct Messages fixture was provisioned; the deterministic inbound-to-persistence-to-transport regression is the available behavior proof. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
f702f73 to
737834d
Compare
|
The P1 migration finding is adjudicated as not applicable because the state in question was never shipped under this repository's compatibility contract. The finding correctly identifies an ambiguous Exact containment proof for the commit that originally added Direct Messages topic support: The root Architecture policy defines "shipped" as reachable from a stable release Git tag; betas, nightlies, Commit @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
* fix(telegram): preserve direct message topic identity * fix(telegram): break topic routing import cycle
…tchet - bot-handlers.callback-actions.test.ts still used the pre-openclaw#126207 isForum: false param shape; convert all call sites to the current threadSpec: TelegramThreadSpec shape (check-test-types failure). - Add the required // SAFETY comment on the pre-existing InlineKeyboardMarkup cast in bot-handlers.callback-actions.ts, which this branch's first commit introduced as a new uncommented assertion exceeding the file's grandfathered baseline (checks-fast-baseline-ratchets failure).
What Problem This Solves
Fixes an issue where Telegram Direct Messages topics were converted into forum topics during conversation binding, causing replies to use
message_thread_idinstead ofdirect_messages_topic_id.Why This Change Was Made
Carry one scoped Telegram thread fact through inbound routing, bindings, sessions, commands, suppression/debounce keys, conversation refs, and delivery targets. Forum and Direct Messages topics remain distinct even when their numeric IDs match.
User Impact
Conversation-bound replies stay in the correct Telegram Direct Messages topic instead of silently moving to a forum-topic route.
Evidence
d7133e7df6f5418810609be4827f61e2c51e7120is not contained by a stable release tag:git tag --containsreturns onlyv2026.8.1-beta.2and internalrelease-publish/*tags, whilev2026.7.1,v2026.7.1-1, andv2026.7.1-2do not contain it. Under the repository compatibility policy, that beta/main-only internal state is unshipped, so this PR intentionally starts from fresh canonical scoped state without a migration or runtime fallback.node scripts/check-changed.mjs, and autoreview passed.