Repository navigation
Conversation
…replies Telegram sets message_thread_id on reply chains in ordinary groups. The outbound provider proof promoted it to receipt.threadId for unthreaded sends, so source-reply reconciliation saw a topic mismatch and marked the delivered run failed. Require forum proof before reporting a provider thread when no topic was requested. Closes openclaw#185720
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThe PR excludes ordinary group reply-chain IDs from topic receipts when no topic was requested and Telegram provides no forum evidence. Example: Telegram accepts message 7 replying to message 6 in an ordinary group, with reply-chain root 4.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness✅ Ready for maintainer review This PR repairs a confirmed Telegram receipt-classification bug without weakening requested-topic validation; the earlier proof and test-growth blockers are resolved. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherTelegram's outbound adapter converts accepted Bot API messages into delivery receipts consumed by shared source-reply reconciliation and session completion. flowchart LR
A[Telegram message tool] --> B[Bot API send]
B --> C[Accepted Telegram message]
C --> D[Telegram receipt classification]
D --> E[Source reply reconciliation]
E --> F[Persisted session status]
Technical reviewBest possible solution: Land the focused Telegram producer correction after required checks pass, retaining the separate diagnostic follow-up for genuinely ambiguous delivery. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the mismatch, and the supplied real Telegram/Gateway before-and-after output reproduces its persisted-status consequence on pinned revisions. Is this the best way to solve the issue? Correcting receipt classification at the Telegram producer is the smallest complete repair for false failures and preserves shared reconciliation and strict requested-topic checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d3b86610df08. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +25, Tests 0. Total +25 across 2 files. Added test files: 0. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 27, 2026, 2:47 PM ET / 18:47 UTC (Revision 2). |
Real Telegram Test Server delivery + persisted run-status proofCandidate production The user creates a root → middle → triggering-message reply chain in a verified non-forum supergroup. The provider instructs the real All message identifiers below are local to separate run-owned Test Server chats; private group/user/bot identities are omitted.
Each chain is a distinct run, with a separately recorded lastRunId. TDLib independently records both delivered Controls
Fixture, evidence and cleanup limitsThe ordinary fixtures are creator-owned Test Server supergroups: the existing run-owned forum fixture creates/upgrades the group, then a real TDLib operation disables forum mode. Both TDLib and Bot API readback confirm ordinary The only simulated component is model output. Telegram transport, accepted message metadata, source-reply reconciliation and persisted/public status are real. The API observer returns the parsed value unchanged. This is not a rendered Control UI screenshot claim or a repair for genuinely ambiguous-delivery diagnostics. Test Server acknowledgement reactions can return REACTION_INVALID on both refs; the text sends are accepted and the controls distinguish the receipt/status defect independently. Non-growing regression repairHead Observed focused checks: 142 tests passed across5 files, including wrong-topic and namespace controls; the final HTTP table was rerun 32/32 after its last fixture-only trim. Scoped Oxfmt/Oxlint passed. Hosted CI and review must evaluate the repaired head; no prior red is claimed green. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Final consolidated-table negative control (source head unchanged): copied the exact committed HTTP regression table onto pinned unfixed main |
|
Landed in 32075f3. Thanks @moonbow0407. Delivered Telegram reply-chain replies no longer show Run failed. |
… a reply chain (openclaw#185899) fix(telegram): don't mark delivered group replies in a reply chain as failed In a non-forum Telegram group, a reply sent into a reply chain was delivered, but the run was saved as failed (abortedLastRun true), so the UI showed "Run failed". The delivery receipt now matches the reply-chain thread fields, so the run is recorded as done. Evidence: real Telegram Test Server groups. On main both reply-chain responses were visibly delivered but saved as failed with abortedLastRun true; with this change both were delivered and saved as done with abortedLastRun false. Non-chain replies and genuine forum topics behave the same on both refs. Details: openclaw#185899 (comment). Ambiguous-delivery diagnostics are not addressed here. Thanks @moonbow0407. Co-authored-by: Ayaan Zaidi <[email protected]>
… a reply chain (#185899) fix(telegram): don't mark delivered group replies in a reply chain as failed In a non-forum Telegram group, a reply sent into a reply chain was delivered, but the run was saved as failed (abortedLastRun true), so the UI showed "Run failed". The delivery receipt now matches the reply-chain thread fields, so the run is recorded as done. Evidence: real Telegram Test Server groups. On main both reply-chain responses were visibly delivered but saved as failed with abortedLastRun true; with this change both were delivered and saved as done with abortedLastRun false. Non-chain replies and genuine forum topics behave the same on both refs. Details: #185899 (comment). Ambiguous-delivery diagnostics are not addressed here. Thanks @moonbow0407. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 32075f3) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 663c7ee9ab7afc08aee5dbb62533e778ff86b531)
… a reply chain (#185899) fix(telegram): don't mark delivered group replies in a reply chain as failed In a non-forum Telegram group, a reply sent into a reply chain was delivered, but the run was saved as failed (abortedLastRun true), so the UI showed "Run failed". The delivery receipt now matches the reply-chain thread fields, so the run is recorded as done. Evidence: real Telegram Test Server groups. On main both reply-chain responses were visibly delivered but saved as failed with abortedLastRun true; with this change both were delivered and saved as done with abortedLastRun false. Non-chain replies and genuine forum topics behave the same on both refs. Details: #185899 (comment). Ambiguous-delivery diagnostics are not addressed here. Thanks @moonbow0407. Co-authored-by: Ayaan Zaidi <[email protected]> Beta.5 baseline adaptation: Retain the native beta.5 owners, fixtures and public contracts; add focused regression controls and bounded fixture extraction; apply checkout formatting. (cherry picked from commit 32075f3) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 513da19202ff3e7951236a1453737d09eda91113)
Related to #185720.
What Problem This Solves
Fixes: a successful Telegram reply in an ordinary (non-forum) group can leave the session showing Run failed: Unknown error when the reply lands in an existing reply chain.
User Impact
Replies that the agent sends into a regular Telegram group, quoting the triggering message, now reconcile as delivered. The run no longer flips to a failed status after the message was actually sent. Forum-topic and DM-topic sends keep their existing wrong-topic checks.
Why This Change Was Made
In non-forum groups Telegram also sets
message_thread_idon messages that belong to a reply chain, pointing at the chain's root message. Inbound routing already treats that asscope: "none"(resolveTelegramMessageThreadSpec), but the outbound provider-proof path promoted the same field toreceipt.threadId. Core source-reply reconciliation then compared that thread ID against the unthreaded source conversation, saw a mismatch before checking the matchingreplyToId, and the pending-terminal cleanup marked the run failed without an error.The provider-observed thread is now ignored for unthreaded sends when the response carries no forum proof (
is_topic_message/chat.is_forum), reusing the existingresolveTelegramMessageForumFlagHintowner. Sends that requested a topic are unchanged, so a real wrong-topic delivery still fails loudly and keeps its receipt.Not in scope: the issue also notes that an ambiguous terminal delivery is recorded without a
lastRunError. That core cleanup path is separate; this PR fixes the producer that created the false mismatch.Evidence
#185899 (comment) — real Telegram Test Server reply chains: main visibly delivers both replies but persists failed / abortedLastRun:true; candidate visibly delivers both and persists done / abortedLastRun:false. Actual Bot API fields, stored tool receipts, shared reconciliation signals and public session status are recorded. Non-chain and genuine forum-topic controls pass on both refs.
The model is a deterministic local fixture; Telegram delivery and persisted status are real. Verified ordinary and forum fixtures are deleted, leases released, credential scratch removed, and consumers joined. No rendered Control UI claim is made.
Regression repair: the existing durable registered-send table now covers requested topics, non-forum chains and forum proof without net test growth (0 lines). 142 focused tests passed, final HTTP table 32/32, scoped formatting/lint passed. Production is unchanged after the live proof. Earlier contributor loopback red/green receipt results remain supporting unit evidence, not a substitute for this Test Server run.
Merge danger: a two-way code change with no schema/config migration. Blast radius is Telegram provider receipt classification for unrequested group reply chains; requested-topic and Direct Messages checks remain strict. Genuinely ambiguous-delivery diagnostics remain outside this partial fix.