Repository navigation
Conversation
|
🦞👀 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 Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c6f14253c3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex review: needs maintainer review before merge. What this changesKeeps a matching approver’s Telegram approval card in the originating private topic and coordinates terminal results across approver cards. Example: An approver requests an exec approval in private Telegram topic 200489 with target set to dm.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current Telegram routing defect and resolves the earlier duplicate-result finding; no actionable patch defects remain. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe shared approval runtime plans delivery and finalizes cards; Telegram supplies account-scoped recipients, topic routing, and message transport. flowchart TD
A[Approval request] --> B[Shared delivery planner]
B --> C[Telegram recipient resolver]
C --> D[Requester private topic]
C --> E[Other approver DMs]
D --> F[Approval resolution]
E --> F
F --> G[Shared finalizer and Telegram card updates]
Technical reviewBest possible solution: Retain the focused account-scoped topic routing and shared fan-out context, then settle the failing exact-head QA gate before landing. Do we have a high-confidence way to reproduce the issue? Current-main source maps approvers to bare DM recipients and drops the private topic; supplied before-fix Telegram events demonstrate that path, though no reproduction was executed during this read-only review. Is this the best way to solve the issue? The patch repairs recipient derivation in Telegram and exposes existing finalization order through the shared runtime, preserving account filtering, other approvers, and failed-edit fallback. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bd02bf934fd0. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +70, Tests +270, Other +2. Total +342 across 8 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. 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 HistoryReviewed November 13, 2026, 1:20 PM ET / 18:20 UTC (Revision 3). |
Wait for an approver card in the originating topic before sending a fallback result. Keep terminal button cleanup for every approver and send one fallback to the origin only if its card edit fails. Cover requester-first and requester-second fanout, expiry and deleted origin cards through the real approval handler.
Co-authored-by: obviyus <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…w#198038) * fix(telegram): keep DM topic approvals in their conversation * fix(telegram): avoid duplicate terminal approval replies Wait for an approver card in the originating topic before sending a fallback result. Keep terminal button cleanup for every approver and send one fallback to the origin only if its card edit fails. Cover requester-first and requester-second fanout, expiry and deleted origin cards through the real approval handler. --------- Co-authored-by: obviyus <[email protected]>
* fix(telegram): keep DM topic approvals in their conversation * fix(telegram): avoid duplicate terminal approval replies Wait for an approver card in the originating topic before sending a fallback result. Keep terminal button cleanup for every approver and send one fallback to the origin only if its card edit fails. Cover requester-first and requester-second fanout, expiry and deleted origin cards through the real approval handler. --------- Co-authored-by: obviyus <[email protected]> (cherry picked from commit 129ccc3) Release adaptation: retain the release runtime dependency seams and existing unit cases; add the private-topic integration regressions as a separate file. Bring only the prerequisite topic-aware pending-target identity from #137438 (6a6fa4d), using existing routing helpers, rather than its broader changes. Use the existing async native approval capability so its async Telegram resolver and runtime are actually invoked; no new storage internals are added. Companion closure: #192162 fixes forum-origin normalization, not this private DM numeric origin, and is not required. Proof: source/route review and node --check passed. Runtime tests are blocked by missing worktree dependencies; no dependency installation was attempted. Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vincentkoc <[email protected]> (cherry picked from commit a427f5c9511eb3aa972c8b56d4fcc39efdf02f77)
Additional live routing proof — 2026-11-15The bot owner verified this on a real Telegram bot in a private DM topic: the approval stayed in the conversation that requested it, instead of being sent to the root DM. The owner explicitly asked to preserve this screenshot here as proof. The screenshot shows the terminal approval/result card in that same topic, alongside the original queue-mode request. Scope: this confirms the observed conversation routing. The recorded result is Expired, so this is not evidence of successful authorization or execution of that particular configuration change. The running build's exact source ancestry was not independently established. |
Port Telegram callbacks, hook session keys, private-topic approvals and interactive widgets with complete send/edit/route security companions. Include Feishu captioned media, iOS permission Sendable callbacks, WebKit animation/menu retirement and pending automations props handling. Keep Matrix malformed formatted-mention parsing linear-time. Adapt the 11.4 equivalents to the fixed beta baseline where available. Source PRs: #196217, #191585, #196822, #194027, #197519, #198038, #196991, #198380, #198658, #184432. Companion scope: #191647, #192162, #198022, #197271, #194146; #197670 is folded into #197519 equivalent. (cherry picked from commit 928c118) (cherry picked from commit 569ca48) (cherry picked from commit efa744e) (cherry picked from commit c301da9) (cherry picked from commit 641c4d5) (cherry picked from commit b9d3fb4) (cherry picked from commit a213a51) (cherry picked from commit ec46689) (cherry picked from commit 779d22e) (cherry picked from commit 129ccc3) (cherry picked from commit 849c050) (cherry picked from commit b22f35f) (cherry picked from commit 8b414e9) (cherry picked from commit 01ecda4) (cherry picked from commit f978e54) (cherry picked from commit 6e60479) (cherry picked from commit ec7b49a) (cherry picked from commit 1d72ad0) (cherry picked from commit 5e2c66f) (cherry picked from commit dfb6454) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit f7c581c7f8bf0e57c7d8799e928a121b24462450) Co-authored-by: vincentkoc <[email protected]>

Closes #197907
What Problem This Solves
An exec or plugin approval requested inside a private Telegram bot topic is sent to the root DM, not to the topic. The topic only gets "Approval required. I sent the approval request to Telegram DMs, not this chat." The user has to leave the conversation to find the card.
User Impact
When the requester is also an approver on the same Telegram account, the approval card and its result stay in the topic where the request started. Other approvers still get their usual DM card. The requester gets one terminal result, whichever approver card is processed first.
This screenshot shows the original bug, before the fix:
Why This Change Was Made
With
execApprovals.target: "dm", the delivery plan uses only approver DM targets. The approver DM target for the requester is the bare chat id, so the topic was dropped.Evidence
Live Telegram Test Server E2E, real Gateway + deterministic mock model, leased QA user, Threaded Mode on,
execApprovals: { enabled: true, approvers: [<qa user>], target: "dm" },tools.exec.mode: "ask". The user sendsEXEC:/usr/bin/touch ...inside a fresh DM topic, then taps Allow Once.mainat8ebe740925ca: the cardApproval required ... /approve <id> allow-oncewas posted in the root DM (no topic). The topic gotApproval required. I sent the approval request to Telegram DMs, not this chat., and the tap could not find the button in the topic.b358a299a60b: the card was posted in the topic (topicId=200489). The tap edited the same card toExec approval resolved / Allowed once, the command ran, and oneEXEC_DONEreply arrived in the topic. No redirect notice and no message in the root DM. A laterPING:afterin the topic was answered there.Captured Telegram events (TDLib recorder on the QA user;
msg#is the tail of the TDLib message id, so equal ids are the same message):main 8ebe740 (before)
this head b358a29 (after)
main: with this head's test files onmainsource, 15 cases fail (approval-native: matching private-chat approver keeps the origin topic, saved account binding;approval-handler.runtime: terminal results on the private topic for every outcome, and all six requester-first/requester-second/expiry/failed-edit fan-out orderings). All pass on this head.approval-native,approval-handler.runtime(requester-first, requester-second, expiry and failed-edit orderings),approval-native-route-coordinator,approval-handler-runtime.