Repository navigation
fix(telegram): preserve direct-message topics in config and cron writeback - #127010
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 21, 2026, 1:13 AM ET / 05:13 UTC. ClawSweeper reviewWhat this changesPreserve Telegram Direct Messages topic identity when resolving username or t.me targets and writing the result to existing config defaults or cron delivery targets; consolidate three cron UI tests into one table-driven case. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep this active: the patch is a focused Telegram-owned fix with no code-level finding, but it still needs the required real Telegram topic proof before merge. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherTelegram send operations resolve a user-facing target into a numeric chat ID, then persist that destination for config defaults and scheduled jobs. Those persisted values later determine the chat and topic used for delivery. flowchart LR
A[User-facing Telegram target] --> B[Target parser]
B --> C[Chat ID resolution]
C --> D[Topic-aware writeback]
D --> E[Config default]
D --> F[Cron delivery target]
E --> G[Telegram message delivery]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource +45, Tests -22. Total +23 across 3 files. View PR surface stats
Review metrics
Mantis proof suggestionTelegram Desktop can directly demonstrate that a resolved and persisted Direct Messages target delivers to the selected topic rather than its channel base. A maintainer can ask Mantis to capture proof by posting this exact PR comment: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the Telegram-owned matcher reuse after a redacted live Telegram proof confirms resolution, config/cron persistence, and subsequent delivery remain scoped to the selected Direct Messages topic. Do we have a high-confidence way to reproduce the issue? Yes—current main’s match key omits direct-message topic identity at extensions/telegram/src/target-writeback.ts:41, while the branch’s focused config and cron cases define the failing path. Is this the best way to solve the issue? Yes—the patch repairs the Telegram persistence owner and reuses the established semantic matcher instead of retaining a second, incomplete target-equivalence implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against df8fedcc00dc. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
25062c8 to
2bd366a
Compare
|
Land-ready proof for reviewed head
|
|
Merged via squash.
|
…eback (openclaw#127010) * fix(telegram): preserve direct message topics in target writeback * test(ui): consolidate cron scheduler status coverage
What Problem This Solves
Fixes an issue where Telegram users sending to a channel Direct Messages topic through a username or
t.metarget would lose the topic after chat-ID resolution, while config and cron writeback could also overwrite unrelated direct-topic or unthreaded destinations for the same channel.Why This Change Was Made
Telegram writeback maintained a duplicate target matcher that considered forum thread IDs but ignored channel Direct Messages topic IDs, and its resolved-target formatter dropped the direct-topic suffix. Preserve that suffix at the Telegram-owned writeback boundary and reuse the existing canonical Telegram target matcher for both config and cron persistence, removing the obsolete duplicate matching path. This completes the topic routing introduced in #120916 and reuses the canonical target identity from #126625. A test-only, table-driven cron UI cleanup also repairs the existing current-main max-lines regression introduced in #126945, which otherwise fails the required hosted merge gate.
User Impact
Resolved Telegram Direct Messages destinations retain their original topic, and only the intended config default or scheduled cron delivery target is updated. Ordinary unthreaded targets, explicit forum topics, shorthand forum topics, unrelated accounts, and neighboring channel Direct Messages topics remain unchanged.
Release note: Telegram: preserve channel Direct Messages topic scope while resolving and persisting config and scheduled delivery targets.
Evidence
-100123replacing-100123:direct-topic:77and incorrectly rewriting neighboring destinations; restoring the branch fixed all four.node scripts/run-vitest.mjs extensions/telegram/src/targets.test.ts extensions/telegram/src/threading-tool-context.test.ts extensions/telegram/src/transport-payload.test.ts extensions/telegram/src/send-mutation-targets.test.ts extensions/telegram/src/topic-conversation.test.ts extensions/telegram/src/session-conversation.test.ts— 6 files passed; 101 tests passed. Coverage includes config/cron writeback, sibling target matching, conversation persistence, message mutations, and actual grammY/Bot API JSON and multipart payload construction.node scripts/run-vitest.mjs ui/src/pages/cron/view.test.ts— 1 file passed; 42 cron UI tests passed, preserving enabled/disabled/loading scheduler coverage.node --import tsx scripts/run-oxlint-shards.mts --only=core --split-core --core-stripe=5/5 --threads=1— first reproduced the existing current-maineslint(max-lines)failure, then passed after consolidating three duplicate scheduler tests into one table-driven case.node scripts/check-changed.mjs— the original Telegram-only diff passed all changed extension and extension-test gates, including formatting, production/test typechecks, extension lint, plugin boundaries, database-first guards, zero runtime import cycles, and 2 files / 5 plugin-doctor tests. After the required UI-test repair expanded scope, the rerun passed every preceding guard and failed only because this linked worktree's shared dependency tree lacks current-main@panzoom/panzoomand currentpakotypes; its single permittedpnpm installrefused to purge the shared installation without a TTY. Exact-head hosted CI performs the complete clean dependency/typecheck proof.git diff --check origin/main...HEAD— passed..agents/skills/autoreview/scripts/autoreview --mode uncommitted --engine codex— clean for the CI-repair test change..agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main --engine codex— clean; no accepted/actionable findings.+15/-37(net-22); tests/test support:+82/-37(net+45).