Skip to content

fix: keep node completion follow-ups in their originating conversation - #160675

Merged
roboclaw-bot merged 51 commits into
mainfrom
openclaw/fix-telegram-topic-completion-routing
Oct 7, 2026
Merged

roboclaw-bot merged 51 commits into
mainfrom
openclaw/fix-telegram-topic-completion-routing

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #160602

Worked on by: @brokemac79

Work sessions

What Problem This Solves

Fixes node-command completion and delivery-error follow-ups escaping their originating Telegram topic into the operator's DM.

User Impact

Completion follow-ups retain the authenticated command's original account, conversation and thread, even when the saved session route or heartbeat destination changes. Existing notification opt-outs, target:none, direct-message restrictions and current delivery authority still apply. Legitimate direct-origin and explicitly requested DM work remain supported.

Legacy nodes may still produce foreground output plus their normal completion follow-up, both in the original conversation. This change does not introduce a duplicate-suppression protocol or a lost-invoke-result recovery guarantee.

Why This Change Was Made

The synthetic completion turn was using execution/heartbeat sender context as its delivery conversation. The fix snapshots authenticated source facts before awaited raw/plugin node dispatch and carries them through the existing registry, completion event, conversation owner and finalizer. Captured exec routes are isolated before model input; unrelated generic/cron work keeps its existing owners.

The candidate has been deliberately reduced. The proposed result-first ordering, protocolFeatures negotiation, terminal-to-invoke recovery, second authority-state class, generalized generic-event holding and cron route-continuation/retirement changes are removed. Current-main features are preserved. The reduced repair retains 40 changed paths against pinned main 3856df4, rather than the earlier 83-path proposal. Current-main conversation continuations and host-generated notice policy are preserved.

A review also found that holding every failed completion could strand work when queue admission failed before any delivery owner existed. Native no-publication facts and actual intent/dispatch boundaries now distinguish that case: the original-route event remains eligible for the existing bounded wake retry. A queued or ambiguous delivery stays with its existing recovery owner and is not regenerated by another model turn. Deferred routes still progress after a permanent rejection.

Evidence

October 7 diagnosis and current-main integration

Current source: 3c1dce4, tree f2cf0a2c7e9be6f36ad8c8139e29e7108f77acc1. After native observation proved a new conflict in targets.ts, pinned main 3856df4 was integrated. Its outbound helper consolidation is retained, including the captured exec discriminator, pre-await route copy, no stale-thread inheritance and exact post-refinement checks. This was conflict repair, not a CI-green refresh. Earlier source cf7fe6d had integrated main 947b358 to resolve three actual conflicts, retaining the reduced 40-path scope. The node-event adapter keeps its captured authorization result while deriving types from the registry owner. The shared conversation-completion classifier retains producer-aware routing in both prompt and scheduler consumers. The consolidated rollback case keeps its typed queue/released/no-send assertions.

  • Current resolver and sibling contracts: 191 tests across seven files passed, 107.22 s wrapper / 107.60 s wall, covering ordinary owner routes, real-plugin captured route refinement, no-replay/custody, rollback sending, and raw/plugin node invocation. A new real-plugin case first failed when the exec guard was removed: an unthreaded captured group was incorrectly sent to saved topic 47. With the guard retained, pnpm test src/infra/outbound/targets.exec-route-authority.test.ts --maxWorkers=1 passed 18 tests in 17.30 s wall; it reuses the existing compiler/plugin fixture and adds no Gateway boot. Fresh production and Gateway-root/messaging/Gateway-method test types, changed resolver lint, line caps and diff checks passed. A fresh one-pass independent P0–P2 review found no actionable issues; it was static, not execution. Hosted CI seconds remain unclaimed.
  • Earlier cf7 affected contracts: 99 tests across six Gateway/heartbeat/real-outbound files passed, 291.05 s test wrapper / 291.43 s wall. This includes original-route recovery, queued/ambiguous no-replay, legacy bindings, scheduler controls and the actual rollback sender. All 46 classifier tests passed (335 ms Vitest / 1.53 s wall); the new ordinary-producer control first failed against the text-only merged classifier. Four cheap classifier cases were added; no sleeps or new Gateway boots were added.
  • Earlier cf7 core production types, Gateway-server/infra/messaging test typegraphs, changed-owner lint, line caps and diff checks passed. Independent chunked static review returned no actionable P0–P2 findings, with attribution limits noted in one context-only chunk. These checks are separate from fresh exact-head ClawSweeper, hosted CI and security admission. Current hosted CI seconds are not claimed.
  • The earlier local injection failure was not the CI regression. The disposable read-only image mapped the OS account home to a read-only directory; Crabline's recorder failed with EROFS and injection returned HTTP 500. A task-only image corrected that home mapping to its existing writable private temporary home, retaining network-none, read-only root and all runner isolation guards. The native recorder then accepted the event and the same injection returned HTTP 200. No product, dependency, permission or assertion change was used to manufacture that result.
  • The executed Slack settlement failure is inherited, not called flaky or fixed. CI run 37373053256, job 111975178155, tested merge c413c4e7fb9fe833e9b22215a36345fd3285bd8a with ordered parents 0e54386 and f6e47a1. Under CI-matched Node 24.19.0, pnpm 12.5.1, the healthy isolated fixture and identical diagnostic-only test edits, both that exact merge and its main-parent baseline reproduced the same failure: the preview control passed, then the visible child reached terminal completion with its expected marker but announcement delivery remained pending until the settlement timeout. Each run had 1 passed / 1 failed / 14 unselected; candidate 160.20 s test phase (732.03 s including build), baseline 166.97 s (750.96 s including build). The original delivery assertions and timeouts were unchanged. Both containers were confirmed removed. This is historical baseline attribution, not a passing current-head E2E claim or a CI exception receipt.

No CI job was rerun to hide these failures, and no generic/cron announcement-settlement feature was added. Older successful review and transport proof remain historical; the successor must pass its own native admission.

Historical October 5 integrated repair

Historical source: f6e47a1, tree b3fee2a26c8b71abb5b99151a965f86698038118. GitHub later reported a real conflict with main, so this candidate integrates pinned main a38b64b. The only overlapping PR owner was conversation-identity.ts: the resolution preserves main's removal of redundant normalization while retaining synthetic account/conversation/thread pairing. The source scope remains 40 files; no floating-main refresh loop.

Affected proof on this repaired candidate: all 27 tests in conversation identity and actual delivery-custody routing passed (97.78 s test wrapper; 98.16 s wall), including original-route recovery, terminal rejection and ambiguous/queued no-replay. Core production types, the infra/agents-sessions test typegraphs, source lint, line caps and diff checks passed. A fresh full-candidate independent static P0–P2 review was scoped-clean; executable proof was performed separately. Unchanged prior proof is retained below, not relabeled as new execution.

The preceding 617b head received a completed exact-head ClawSweeper review at 2026-10-05T20:38:45.252Z, with no actionable findings, and exact-head security review succeeded. Its CI attempt still had never-started hosted-runner failures during the GitHub Actions incident. Those old startup jobs were not rerun against an obsolete conflicting candidate. This new head requires fresh exact-head review and native CI/security admission; no gate is waived.

Prior integrated source: 617b0ed, tree e293891b9a967731edc595d6534450c9f03f709b. Integrated main 3ae653d to resolve four real conflicts. The final source also composes without conflict with native-captured main b2750b2 (merge-tree 98089a958614a8a2f1ccf19efcf91d8060d7e0a9). This is composition evidence, not execution of that merge tree; no repeated floating-main integration.

  • The six-file integrated routing/custody/legacy matrix initially reported 96 passed, 1 failed in 313.10 s. It caught host-generated failure notices inheriting captured exec authority. The owner was corrected; all 16 affected continuation/notice cases passed in 77.62 s. The failed invocation remains failed, not retroactively green. Same-origin recovery, queued/ambiguous no-replay, route provenance and coalesced generic-event controls passed in that matrix.
  • A native line-cap failure was fixed by moving the unchanged target-awareness helper into the existing session-publication owner, not by disabling the guard. All 5 awareness/lifecycle cases passed, 54.31 s. The moved helper body was checked byte-for-byte after normalizing its export keyword.
  • Complete changed-file gates passed on production candidate 7c21bf8 (exit 0): format and line caps, production types, all 27 selected core-test typegraphs, lint, dead exports, import cycles, schema/database and routing/auth guards. Earlier interrupted and failed attempts remain recorded separately. The follow-up passed fresh production types, the selected infra/messaging test typegraphs, type-aware lint, line caps, import-cycle and diff checks. Unchanged gate inputs retain the prior evidence. No guard, security review or permission requirement was disabled.
  • The full 7c21bf8 candidate and complete follow-up delta received independent P0–P2 review. The final delta is scoped-clean, with no actionable findings after repair; its source matches the committed delta. This does not replace current-head ClawSweeper, CI or owner-review gates.
  • The subsequent 7c21bf8 ClawSweeper review found a real leak of terminally rejected completion occurrences. The existing native regression failed with a hidden held occurrence; the repair consumes only a published, owner-released attempt with typed permanent no-send proof. The final 55-case custody, event-routing and legacy-binding matrix passed (209.73 s), including original-route recovery, ambiguous non-replay, deferred-route progression and admission of all 20 ordinary notifications after terminal settlement.
  • CI on 7c21bf8 found two rollback assertions still expecting the former raw SQLite error shape. They now assert queue-stage/released custody, no-send metadata and the preserved original cause. All 6 real sender/SQLite cases passed (38.45 s); the single-send, intent-callback and media-cleanup checks remain enabled. A local compiler-input race failed before tests ran; the frozen-input rerun passed and is recorded separately.
  • The review caught ordinary notifications whose text resembles exec completion being omitted from model input. Two native generic/cron controls failed before repair; the prompt, cron classifier and generic drain now use the same producer-aware predicate. All 41 selected classifier, notification, stale-wake and generic-drain cases passed across four files (67.60 s wrapper). Counts overlap earlier routing evidence and are not summed as distinct tests.
  • The later CI run exposed one additional regression: a delivered failure notice incorrectly retired work whose model turn failed. The existing legacy test and a new captured-route variant both failed before repair. Settlement now requires a completed exec turn; failed model work and dedupe state remain available for later success. All 62 tests across the four affected files passed (186.01 s wrapper), including permanent rejection, no-replay and late-admission controls. Two stale node-event expectations and one non-producer fixture key were corrected to the actual event contract without relaxing authorization. Fresh core/test types, four-file type-aware lint, line caps and diff checks passed; independent P0–P2 review of this complete follow-up found no actionable issues. Earlier CI attempts remain failed evidence, not relabeled green.
  • Prior 617b production LOC: +750/-251 (net +499); tests/helpers: +1977/-64. Growth carries authenticated route facts through the existing dispatch owners and validates exact route/custody boundaries; no second retry manager or persistence owner is introduced.

No current-head live Telegram run is claimed for this integration. The prior live evidence below covers the retained reduced behavior; changed continuation/notice composition was tested locally through native owners. Hosted CI and required reviews remain separate landing gates.

Historical reduced-candidate live proof and supporting checks

Historical source: c1c7f16, tree 420f4c05e592ce10cc85d34dd8713b8b3cba7c19. Actual conflicts were resolved against 260a319; it is an ancestor. No repeated floating-main refresh.

The build, live proof and whole-candidate clean review used dd2406b. The final commit changes only one test expectation/comment to match earlier scoped-route rejection; all production, configuration and build inputs are byte-identical. That changed test and its type/lint checks passed. Prior-head evidence is not mislabeled as execution of the final test-only commit.

Real Telegram Test Server — reduced production candidate

Both cases used a fresh dedicated team QA lease, a run-owned disposable forum/topic, the actual built candidate Gateway and an isolated released 2026.9.4 Linux node with no result-first feature. Each issued exactly one harmless tagged printf. The model was scripted; Telegram, node execution, routing, message tool and finalizer were real.

Case (2026-10-03 UTC) Observed result Wall time
12:50:28–12:54:09: completion send rejected One native execution/result, exit 0. Foreground/progress succeeded; only matching completion send #3 received synthetic pre-upstream 400. Native error-final arrived in the original account/chat/topic. Later unrelated wake did not regenerate it. 220.69 s
12:54:45–12:59:04: completion and error-final rejected One native execution/result, exit 0. Matching sends #3/#4 rejected. Fresh native failed-final settlement retained the original account/chat/topic; later unrelated wake caused no regeneration or additional execution. 259.06 s

Both runners exited 0. Native transcripts, tool-result correlation, wire admission/result counts, recorder receipts and rejection records were inspected; each rejection explicitly recorded upstreamForwarded:false. No private sendMessage attempt occurred. Each unrelated main-session control emitted one private typing action after that control started; this is not a zero-private-traffic claim and was not a completion/status message.

Cleanup is confirmed for both fresh leases: owned forums deleted, node/Gateway/provider/userbot consumers joined, credential state removed, lease scratch empty, and Gateway/model/Bot API adapter/node-bridge listeners closed. No paid model calls, new cloud allocation, production permission changes, personal Telegram, VPS or Surface access occurred.

Local/native contract proof and review

  • 204 distinct affected tests across 10 files passed after reconciliation. The broad run took 223.42 s and exposed three diagnostic-expectation mismatches, not delivery failures. The corrected 17-case resolver file and previously unstarted 15-case conversation file then passed in 18.65 s. These overlap; counts are not summed twice. The broad invocation itself remains recorded as failed, not retroactively green.
  • Twelve focused custody/provenance cases include real SQLite schema-admission rejection, actual outbound transaction rollback after writer admission, same-origin recovery, queued/ambiguous non-replay, permanent rejection followed by automatic deferred work, mixed unbound/tagged/untagged/invalid routes, and uninspected interval controls. The initial trigger fixture hit schema admission rather than publication; the refined transaction test verifies the actual no-publication reason and zero pending delivery/I/O.
  • 10 final-effect authority cases passed on the same production source (49.85 s Vitest). Real SQLite/session/queue/message owners and the real Telegram HTTP adapter sent to a synthetic loopback sink: allowed topic and explicit DM produce physical POSTs; forbidden account/chat and writer revocation/reassignment after admission produce zero POSTs, including queued recovery. This is native boundary proof, not live Telegram security-negative testing. These tests begin with pending-final custody and are separate from the no-custody regression above.
  • Complete changed-file gates passed on the reduced candidate (359.95 s), with affected successor deltas passing (355.82 s and 323.30 s). Format, line caps, core/test typegraphs, lint, dead-export, import-cycle and repository/schema guards remained enabled. Final test-only delta passed formatting, type-aware lint, selected test typegraph and diff checks. No CI runs were manually dispatched; hosted CI seconds are not claimed.
  • Fresh whole-candidate precommit/committed reviews identified actionable edge cases; each was repaired and regressed. The final whole-candidate P0–P2 committed review is scoped-clean. At that historical publication, the automatic ClawSweeper assessment was still pending; older b040 reviews did not cover that update.
  • Exact production build passed, 371.82 s, Node 26.8.2 / pnpm 12.5.1; pnpm build includes UI. The build report flags startup JS 365.0 KiB versus 364.7 KiB and CSS above its advisory target but below the hard ceiling. No all-budgets-green or independently proven baseline-attribution claim.

Limits and historical context

The injected 400 is the existing Test Server adapter's definite pre-upstream rejection, not genuine server-generated thread-not-found or accepted-but-unacknowledged delivery. Negotiated recovery is no longer part of this PR. No blanket security, migration, deployment or merge clearance is claimed. This patch adds no persistent schema or numeric protocol-version change.

Historical evidence is retained: operator-reported 6f84cb9 failed with an error-final DM spillover; it remains withdrawn. b040d3c later passed an operator legacy topic-retention cell and two qualified team Test Server cases, but is not the final candidate. An earlier interrupted attempt remains inconclusive; later partial fixture failures are not relabeled passing. The former warning-only stale saved-route withholding policy was removed with the broader recovery design; its retired policy request is not treated as approval or as a requirement for behavior no longer present.

Worked on by


View the OpenClaw team session

roboclaw-bot and others added 2 commits September 28, 2026 19:25
Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: 3e0ac4d1-fe43-4607-bfe2-67fb6bf957ef
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Sep 28, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 7, 2026, 1:23 PM ET / 17:23 UTC (Revision 28).

ClawSweeper review

What this changes

The branch preserves node commands’ originating account, conversation, and topic through completion replies and delivery-error follow-ups, while separating delivery attempts from transport recovery.

Merge readiness

✅ Ready for maintainer review

This remains a useful fix for the linked node-completion routing bug. The prior conflict and permanent-rejection blockers are resolved, and no actionable introduced defect was found.

Likely related people: steipete and obviyus, with medium-confidence routing based on recent merged work.

Priority: P1
Reviewed head: 3c1dce497dfd5025ca9c8060a96b52328a96ee0c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful owner-boundary repair with strong scoped behavior proof and regression coverage; no remaining substantive review blocker was identified.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Recorded Telegram Test Server runs exercise the built Gateway, released Linux node, completion message tool, and finalizer, showing error finals remain in the originating topic without unrelated-wake replay. Recorded native final-effect cases cover forbidden destinations and writer revocation/reassignment; newer resolver and custody integration changes have focused regression results. Live proof is historical, not an exact-head Telegram execution. Existing stored formats remain unchanged, with legacy-state compatibility covered.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Recorded Telegram Test Server runs exercise the built Gateway, released Linux node, completion message tool, and finalizer, showing error finals remain in the originating topic without unrelated-wake replay. Recorded native final-effect cases cover forbidden destinations and writer revocation/reassignment; newer resolver and custody integration changes have focused regression results. Live proof is historical, not an exact-head Telegram execution. Existing stored formats remain unchanged, with legacy-state compatibility covered.
Evidence reviewed 9 items Pinned change identity: Reviewed the introduced delta from pinned base 3856df4 to head 3c1dce4. Raw head records list cf7fe6d and the pinned base as parents; this is the PR head, not the GitHub test merge.
Origin capture and authenticated dispatch: Raw and plugin node dispatch capture host-bound source facts before awaited work; the registry retains that route for authorized completion events. Node-selected completion payloads do not supply the destination.
Latest conflict repair: The consolidated resolver excludes captured exec routes from saved-thread inheritance and checks route identity after asynchronous plugin refinement. The real-plugin regression specifically covers an unthreaded captured group with a saved topic. Live GitHub reads confirm this head is mergeable; blocked check state is not a remaining conflict.
Findings None None.
Security None None.

How this fits together

Paired nodes return command-completion events to the Gateway, which uses the heartbeat runner to prepare follow-up agent turns. Those turns pass through conversation routing and durable outbound delivery before reaching the user’s chat.

flowchart TD
  A[Authenticated conversation] --> B[Node command dispatch]
  B --> C[Captured originating route]
  B --> D[Node completion event]
  C --> D
  D --> E[Heartbeat event selection]
  E --> F[Conversation and authority checks]
  F --> G[Durable delivery owner]
  G --> H[Original chat or recovery]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +501, Tests +1961, Docs +4. Total +2466 across 40 files.

View PR surface stats
Area Files Added Removed Net
Source 22 758 257 +501
Tests 17 2020 59 +1961
Docs 1 5 1 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 40 2783 317 +2466

Review metrics

Metric Value Why it matters
Production versus regression coverage production +758/-257; tests/helpers +2020/-59 Production growth carries origin and custody facts through existing owners; the larger test delta covers routing, rejection, legacy-node, and recovery boundaries.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #160602
Summary: This PR is the explicit candidate fix for the reported interactive node-completion routing failure; merged background-command continuation work overlaps but does not supersede it.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep completion output bound to its authenticated origin and let the existing delivery owner exclusively manage retries and reconciliation.

Do we have a high-confidence way to reproduce the issue?

Yes: the linked report provides two observed wrong-chat deliveries, and current main lacks node-origin capture. This reviewer inspected source and recorded proof without executing a reproduction.

Is this the best way to solve the issue?

Yes: the reduced patch repairs origin ownership within existing dispatch and recovery paths, preserves legacy nodes, and avoids introducing another protocol or retry manager.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against d72a907b6125.

Labels

Label changes:

No label changes.

Label justifications:

  • P1: The linked report establishes repeated node-completion error finals reaching the wrong Telegram conversation during an existing workflow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Recorded Telegram Test Server runs exercise the built Gateway, released Linux node, completion message tool, and finalizer, showing error finals remain in the originating topic without unrelated-wake replay. Recorded native final-effect cases cover forbidden destinations and writer revocation/reassignment; newer resolver and custody integration changes have focused regression results. Live proof is historical, not an exact-head Telegram execution. Existing stored formats remain unchanged, with legacy-state compatibility covered.
  • proof: sufficient: Contributor real behavior proof is sufficient. Recorded Telegram Test Server runs exercise the built Gateway, released Linux node, completion message tool, and finalizer, showing error finals remain in the originating topic without unrelated-wake replay. Recorded native final-effect cases cover forbidden destinations and writer revocation/reassignment; newer resolver and custody integration changes have focused regression results. Live proof is historical, not an exact-head Telegram execution. Existing stored formats remain unchanged, with legacy-state compatibility covered.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. The destination of completion and error-final messages is user-visible Telegram behavior, and recorded Test Server proof covers it.

Evidence

What I checked:

  • Pinned change identity: Reviewed the introduced delta from pinned base 3856df4 to head 3c1dce4. Raw head records list cf7fe6d and the pinned base as parents; this is the PR head, not the GitHub test merge. (3c1dce497dfd)
  • Origin capture and authenticated dispatch: Raw and plugin node dispatch capture host-bound source facts before awaited work; the registry retains that route for authorized completion events. Node-selected completion payloads do not supply the destination. (src/gateway/node-registry.system-run.ts:29, 3c1dce497dfd)
  • Latest conflict repair: The consolidated resolver excludes captured exec routes from saved-thread inheritance and checks route identity after asynchronous plugin refinement. The real-plugin regression specifically covers an unthreaded captured group with a saved topic. Live GitHub reads confirm this head is mergeable; blocked check state is not a remaining conflict. (src/infra/outbound/targets.ts:447, 3c1dce497dfd)
  • Prior settlement finding resolved: Confirmed permanent rejection after published delivery intent retires the occurrence; unqueued failures retain bounded retry eligibility, and queued or ambiguous attempts are not regenerated. The regression checks deferred-route progress and restored capacity for twenty ordinary notifications. (src/infra/heartbeat-dispatch.ts:650, 3c1dce497dfd)
  • Complete captured proof inspected: Fetched and inspected the omitted PR-body ranges, then verified the complete body matches captured SHA-256 ecc4ae4b7071667346975ac48503e2d0b0da8f81025ecf416396f261e0d64369 and 20,244 UTF-16 units. Historical dd2406b Telegram Test Server runs used a built Gateway and released 2026.9.4 Linux node: injected completion-send rejection produced an error final in the originating topic, and later unrelated wakes did not regenerate it. The body also records allowed physical POSTs and zero POSTs for forbidden account/chat and revoked or reassigned writer authority, including queued recovery. (dd2406b27461)
  • Proof limits and current integration validation: The matching captured body reports 191 passing resolver and sibling tests on the current integration, including the stale-topic regression, and fresh production/test types and lint. These are contributor-recorded results, not executions by this reviewer. The Telegram runs remain historical, and their injected 400 was a definite pre-upstream rejection rather than a genuine Telegram thread-not-found response. (src/infra/outbound/targets.exec-route-authority.test.ts:55, 3c1dce497dfd)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (27 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-02T16:30:34.718Z sha b040d3c :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-02T17:44:48.653Z sha b040d3c :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-03T13:14:42.456Z sha c1c7f16 :: needs changes before merge. :: none
  • reviewed 2026-10-05T18:40:06.488Z sha 7c21bf8 :: blocked before merge. :: [P2] [P2] Retire completion events after confirmed permanent rejection
  • reviewed 2026-10-05T19:05:07.740Z sha fde8d5b :: needs maintainer review before merge. :: none
  • reviewed 2026-10-05T20:38:45.252Z sha 617b0ed :: needs maintainer review before merge. :: none
  • reviewed 2026-10-05T21:22:38.186Z sha f6e47a1 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-07T16:53:44.316Z sha cf7fe6d :: needs changes before merge. :: none

@clawsweeper clawsweeper Bot added merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 28, 2026
roboclaw-bot and others added 2 commits September 29, 2026 00:53
Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: 4ed07160-e6a0-4b80-a0ed-3a4d718dc7f3
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: L and removed size: XS labels Sep 29, 2026
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 29, 2026
roboclaw-bot and others added 2 commits September 29, 2026 02:33
Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: 9fa11be9-0cf2-4b54-bed6-b324861a9731
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. label Sep 29, 2026
@openclaw-barnacle openclaw-barnacle Bot removed app: web-ui App: web-ui agents Agent runtime and tooling labels Oct 5, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 5, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 5, 2026
roboclaw-bot and others added 4 commits October 5, 2026 19:35
Integrate pinned main a38b64b to resolve the conversation identity conflict.
Keep main's single normalized merge while retaining synthetic route pairing.

Co-authored-by: brokemac79 <[email protected]>
Integrate pinned main947b35844d17 and preserve captured node-event results.
Keep shared conversation completion classification bound to its exec producer.
Retain typed no-send and released-custody rollback assertions.

Co-authored-by: brokemac79 <[email protected]>
Resolve the native-observed main conflict without restoring removed helpers.
Keep captured account/thread facts paired through consolidated resolution.
Regress stale-topic inheritance through the real channel plugin.

Co-authored-by: brokemac79 <[email protected]>
@roboclaw-bot
roboclaw-bot merged commit 630e969 into main Oct 7, 2026
147 of 149 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/fix-telegram-topic-completion-routing branch October 7, 2026 17:41
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Oct 7, 2026
11 upstream commits. Two conflicts, both from openclaw#160675 (630e969, node
completion follow-ups stay in their originating conversation):
- src/infra/system-events.ts: kept both sides' fields (the feature's
  delivery-ack, recipient authority and traceparent, plus upstream's
  deliveryHeld).
- src/auto-reply/reply/session-system-events.ts: upstream changed only the
  exec-completion filter, isExecCompletionEvent(event.text) to
  isExecCompletionSystemEvent(event), so that only the exec producer takes
  the dedicated completion route. The feature's prepare path replaced that
  inline filter with selectGenericSystemEvents, so the consume hunk keeps
  ours and the selector now calls isExecCompletionSystemEvent(event). The
  import follows the rename. Upstream's other change (deliveryHeld,
  peekDeliverableSystemEventEntries, holdSystemEventDelivery) lives in
  system-events.ts and merged cleanly.

Checks, all on the canonical runner:
- Typecheck: core, plus test shards messaging-auto-reply, infra, agents-tools
  and gateway-methods, all clean.
- Tests: session-system-events (+ack-formatted, recipient-authority) 8+2+13;
  system-events 60 + capacity 2 + queue-drain-span 3; heartbeat-events-filter
  46; heartbeat-runner event-ownership 11 / event-routing 34 /
  exec-delivery-custody 12; server-node-events 48 + system-event-owner 4;
  node-invoke-plugin-policy 28; nodes.invoke-abort 8; session-row-changes 3;
  deliver.enqueue-worker 4.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jhynq2GVpzuVQQieebEubg
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 8, 2026
openclaw#160675)

* fix(exec): suppress duplicate foreground node completions

Co-authored-by: brokemac79 <[email protected]>

* fix(exec): prevent duplicate foreground node completions

Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: 3e0ac4d1-fe43-4607-bfe2-67fb6bf957ef

* fix(nodes): recover missed foreground results

Co-authored-by: brokemac79 <[email protected]>

* fix(exec): prevent duplicate foreground node completions

Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: 4ed07160-e6a0-4b80-a0ed-3a4d718dc7f3

* fix(nodes): preserve completion recovery route

Co-authored-by: brokemac79 <[email protected]>

* Publish openclaw/fix-telegram-topic-completion-routing

Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: 9fa11be9-0cf2-4b54-bed6-b324861a9731

* fix(nodes): harden Telegram completion recovery

Co-authored-by: brokemac79 <[email protected]>

* Publish openclaw/fix-telegram-topic-completion-routing

Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: 75bde6b7-fc9d-4562-8bf1-a559a2b1137e

* fix(heartbeat): preserve exec completion route

Co-authored-by: brokemac79 <[email protected]>

* Publish openclaw/fix-telegram-topic-completion-routing

Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: 13a6b76b-bfa1-417c-9b03-245ef28de773

* fix(telegram): bind completion routes to account

Co-authored-by: brokemac79 <[email protected]>

* Publish openclaw/fix-telegram-topic-completion-routing

Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: 11975fca-d536-4e31-9621-136bf68a231a

* fix(exec): suppress duplicate foreground node completions

Co-authored-by: brokemac79 <[email protected]>

* fix(exec): prevent duplicate foreground node completions

Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: 3e0ac4d1-fe43-4607-bfe2-67fb6bf957ef

* fix(nodes): recover missed foreground results

Co-authored-by: brokemac79 <[email protected]>

* fix(exec): prevent duplicate foreground node completions

Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: 4ed07160-e6a0-4b80-a0ed-3a4d718dc7f3

* fix(nodes): preserve completion recovery route

Co-authored-by: brokemac79 <[email protected]>

* Publish openclaw/fix-telegram-topic-completion-routing

Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: 9fa11be9-0cf2-4b54-bed6-b324861a9731

* fix(nodes): harden Telegram completion recovery

Co-authored-by: brokemac79 <[email protected]>

* Publish openclaw/fix-telegram-topic-completion-routing

Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: 75bde6b7-fc9d-4562-8bf1-a559a2b1137e

* fix(heartbeat): preserve exec completion route

Co-authored-by: brokemac79 <[email protected]>

* Publish openclaw/fix-telegram-topic-completion-routing

Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: 13a6b76b-bfa1-417c-9b03-245ef28de773

* fix(telegram): bind completion routes to account

Co-authored-by: brokemac79 <[email protected]>

* Publish openclaw/fix-telegram-topic-completion-routing

Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: 11975fca-d536-4e31-9621-136bf68a231a

* fix(telegram): bind forum completion account

Co-authored-by: brokemac79 <[email protected]>

* fix(exec): prevent duplicate Telegram topic completions

Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: 00bdcd92-8173-40ef-89f5-8a4b05b9a6d8

* fix(gateway): diagnose withheld exec routes

Co-authored-by: brokemac79 <[email protected]>

* Publish openclaw/fix-telegram-topic-completion-routing

Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: fbacbf1b-56f2-4da3-88f4-8831587d8be5

* fix(heartbeat): drain queued exec routes

Co-authored-by: brokemac79 <[email protected]>

* Publish openclaw/fix-telegram-topic-completion-routing

Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: a70b58c9-509d-42d9-ae0d-84cfa27e0022

* fix(node): gate result-first completion support

Co-authored-by: brokemac79 <[email protected]>

* Publish openclaw/fix-telegram-topic-completion-routing

Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: 6eb400c3-8420-4958-a885-a1ece94abab3

* fix(exec): keep Telegram completion turns on their own routes

Gate negotiated foreground suppression on the captured Telegram turn source
and preserve the non-Telegram terminal fallback. Partition queued work before
model admission and retain exact unconfirmed occurrences without regenerating
them on unrelated wakes.

Advance deferred routes only after the selected group is no longer deliverable,
preserve cron retry ownership, and settle generic notices only when their queue
was admitted. Keep legacy isolated base bindings for deferred follow-ups and
process surviving coalesced work after stale exec wakes.

Co-authored-by: brokemac79 <[email protected]>

* fix(exec): prevent duplicate Telegram topic completions

Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: a10cf6e8-7bed-4865-9956-adfb8e670520

* fix(heartbeat): keep topic command completions out of owner DMs

Worked on by:

- @brokemac79

Co-authored-by: brokemac79 <[email protected]>

* Publish openclaw/fix-telegram-topic-completion-routing

Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: 99cee306-6411-464c-a87e-44b896d658a7

* fix: legacy exec completion status spills into Telegram DMs

Co-authored-by: brokemac79 <[email protected]>

* fix: keep node completion follow-ups on their originating route

Reduce the candidate to authenticated source capture, per-exec route isolation and safe final delivery custody. Remove the proposed result-first protocol and generalized generic/cron settlement changes. Preserve native no-publication failure facts so original-route wake retries remain possible without replaying queued or ambiguous sends.

Co-authored-by: brokemac79 <[email protected]>

* fix: keep scheduled heartbeats off uninspected exec routes

Require selected completion admission before captured source can own delivery. Preserve the configured monitor route and leave uninspected completion work queued.

Co-authored-by: brokemac79 <[email protected]>

* fix: isolate invalid completion routes from unbound events

A missing route and a rejected route are not the same selection. Retain legacy unbound grouping but isolate each invalid captured occurrence before model input.

Co-authored-by: brokemac79 <[email protected]>

* fix: require producer provenance for captured exec delivery

Keep untagged legacy text handling but do not let it grant an override of configured delivery. Qualify route tests with the real exec producer context and cover untagged look-alike events.

Co-authored-by: brokemac79 <[email protected]>

* fix: keep untagged notices out of captured completion batches

Separate legacy text-only occurrences even when their route hints match a tagged completion. Cover both queue orders through the native heartbeat delivery flow.

Co-authored-by: brokemac79 <[email protected]>

* test: expect scoped route rejection before refinement

The canonical channel grammar rejects conflicting scoped identities before the asynchronous target refinement boundary. Keep the no-delivery assertion and expect its actual no-route diagnostic.

Co-authored-by: brokemac79 <[email protected]>

* fix: retire terminally rejected completion events

Co-authored-by: brokemac79 <[email protected]>

* fix: retain exec work when completion turns fail

Co-authored-by: brokemac79 <[email protected]>

---------

Co-authored-by: brokemac79 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation gateway Gateway runtime P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Telegram topic node-exec completion sends error final to owner DM after thread-not-found failure

2 participants