Repository navigation
fix(telegram): preserve sent replies when required pins fail - #129342
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 9:53 AM ET / 13:53 UTC. ClawSweeper reviewWhat this changesThe PR propagates required Telegram pin failures while preserving the identifier of a text reply that was successfully sent first. Merge readinessKeep open for protected maintainer review: current main still swallows required-pin failures and loses text-delivery identity, while this focused patch restores the partial-delivery signal that prevents duplicate fallback replies. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — execution before step 1 Assertions:
How this fits togetherTelegram delivery sends a reply, optionally pins its first delivered message, and returns accepted message IDs to command dispatch. Command dispatch uses partial-delivery state to avoid sending a second fallback reply after a visible reply already exists. flowchart LR
A[Command reply] --> B[Telegram delivery]
B --> C[Send text reply]
C --> D[Record accepted message ID]
D --> E[Required or optional pin]
E --> F[Partial delivery result]
F --> G[Fallback decision]
Decision needed
Why: The patch is source-proven and focused, but the maintainer label and member-authored status require an explicit human merge decision. Before merge
Agent review detailsSecurityNone. PR surfaceSource +4, Tests +19. Total +23 across 2 files. View PR surface stats
Review metrics
Mantis proof suggestionA redacted Telegram Desktop run would directly show that a pin failure leaves the initial reply visible without a duplicate fallback. A maintainer can ask Mantis to capture proof by posting this exact PR comment: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the owner-boundary repair; its small production growth is justified by the required/optional pin contract, then land after protected maintainer review and exact-head CI completion. Do we have a high-confidence way to reproduce the issue? Yes—current source and the regression test define a high-confidence path: send text, make a required pin fail, and verify that the accepted message ID survives as partial delivery. Is this the best way to solve the issue? Yes—the delivery owner is the correct place to record the successful send before propagating the later required-pin failure; a command-dispatch guard would duplicate delivery-state policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 474d7855e481. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Mantis Telegram proof — FAILSummary: A real Telegram user invoked a fixture slash command whose single text reply required pinning, while the Bot API proxy failed the first pinChatMessage after sendMessage succeeded. Main reproduced the silent required-pin failure with one visible reply, one successful sendMessage, and one failed pinChatMessage. The candidate did not prevent duplicate delivery: durable ingress retried the command, producing two identical visible replies, two sendMessage calls, and two pin attempts; the second pin succeeded.
Motion-trimmed clips: |
|
Merged via squash.
|


What Problem This Solves
Telegram reports success when an explicitly required message pin fails. Naively propagating the pin failure also loses the already-sent message identity and causes slash-command fallback handlers to send a second visible reply.
Why This Change Was Made
The Telegram delivery owner swallowed all pin errors and omitted its existing accepted-message-ID collector when sending ordinary text, even though media and text fallback siblings already preserve those IDs. Required pin errors now propagate, and the original successful text delivery is recorded before the post-send pin fails.
User Impact
Required pin failures are visible as accurate partial delivery, including the original accepted Telegram message identifier; duplicate fallback replies are prevented. Optional pins remain best-effort and preserve existing successful-send behavior.
Evidence
node scripts/run-vitest.mjs extensions/telegram/src/bot/delivery.test.ts extensions/telegram/src/bot-native-command-dispatch.delivery.test.tspassed all 132 owner and slash-command sibling tests.undiciimporter required a temporary test-runner alias to the already-installed parent dependency; the alias was restored immediately after proof and is not included in this change.