Repository navigation
fix(channels): keep deeper queued messages alive through long turns - #133248
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. |
bc8a51f to
969bfac
Compare
|
Codex review: needs maintainer review before merge. Reviewed September 14, 2026, 1:19 AM ET / 05:19 UTC (Revision 10). ClawSweeper reviewWhat this changesAdds queue-owned lifecycle heartbeats and forwards their cadence through channel plugins so deeper queued messages retain their ingress claims during long replies. Merge readiness✅ Ready for maintainer review This remains a useful fix for unnecessary claim expiry behind long turns. No blocking defect was found. The documented SDK acceptance and compatibility evidence resolve the previous review concern; the closed replacement does not supersede this branch. Priority: P2 Review scores
Verification
How this fits togetherDurable channel ingress holds accepted messages until the reply pipeline adopts them. The follow-up queue reports continued ownership so ingress can distinguish a healthy wait from abandoned processing. flowchart LR
A[Incoming channel message] --> B[Durable ingress claim]
B --> C[Follow-up queue]
C --> D{Lifecycle still waiting?}
D -->|Yes| E[Renew adoption watchdog]
E --> B
D -->|Adopted| F[Run reply]
D -->|Abandoned| G[Existing retry recovery]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +40, Tests +107, Docs +14. Total +161 across 22 files. 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. Technical reviewBest possible solution: Keep renewal with the queue lifecycle and recovery with ingress, preserving the accepted optional SDK forwarding contract. Do we have a high-confidence way to reproduce the issue? Yes: hold an earlier follow-up delivery beyond five minutes while another ingress-backed message waits deeper in the queue. Current source and retained Discord observations support claim expiry and retry; this review did not execute the scenario. Is this the best way to solve the issue? Yes: extending the existing lifecycle owner avoids a competing queue scanner or channel-specific timer and preserves canonical timeout recovery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9d5d33201aad. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (9 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
969bfac to
f41b11c
Compare
f41b11c to
57c4faf
Compare
|
@clawsweeper re-review Head 76097fe adds the requested SDK heartbeat-forwarding documentation. Runtime code and the existing production-boundary proof are unchanged. The PR body records the docs checks and remaining maintainer-owned SDK contract decision; fresh hosted CI is running. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
landpr-approve-admin-merge |
|
Thanks @PollyBot13! Proof: Three real Discord messages shared one route while a queued reply was held for 330 seconds. The third retained its claim past 322 seconds with zero attempts; all three replies arrived once and in order.
|
…penclaw#133248) ## Contributor description — original implementation The contributor’s original description follows. Historical heads, scope and open decisions in this section refer to that implementation; the reviewed current implementation, compatibility decision and proof are recorded in the maintainer update below. Closes openclaw#133245. Related: openclaw#127950. This supersedes the current-main-incompatible queue-owned approach in openclaw#125385 while preserving today's canonical timeout retry disposition. ## What Problem This Solves A durably claimed channel message can wait behind another follow-up turn for longer than the five-minute claim-to-adoption watchdog. Existing liveness renewal covers queue-head active-run admission checks, but not an ingress-backed lifecycle waiting deeper in the follow-up queue. The claim can therefore be retired before the message reaches the model. ## Why This Change Was Made The follow-up queue now owns periodic deferred heartbeats for the exact ingress lifecycle while it remains in pending items, in-flight delivery, summary sources, or compacted summary elisions. Ingress supplies a cadence derived from one third of its adoption-stall timeout. Debounce, Plugin SDK fan-in, and channel lifecycle wrappers preserve the shortest applicable cadence. Queue ownership triggers an immediate renewal, then periodic renewal; it stops after successful adoption, completion, ownership loss, or callback failure. A rejected adoption callback keeps renewal alive for the supported retry path. The existing watchdog and canonical timeout retry policy remain unchanged, so silent handlers and orphaned claims still recover normally. ## User Impact Messages accepted by durable channel ingress remain adoptable while they wait behind long-running work instead of silently disappearing before model execution. No setting or migration is required. ## Evidence SDK documentation polish (2026-09-10, head `76097fef9397a04c10637e06dfaf64ebb6ca104a`): the public channel SDK guide now documents forwarding both heartbeat fields, the shortest-positive-finite fan-in cadence, renewal termination, and compatibility when older wrappers omit the optional cadence. The documentation-only addition passed changed-page formatting, MDX sanity, and `git diff --check`; production code and the previously tested runtime head below are unchanged. Current-head hosted CI has completed successfully; the final exact-head ClawSweeper review accepts the implementation and proof, leaving only SDK-owner acceptance of the documented contract. Refreshed on 2026-09-08 for exact head `57c4faff0ed7bb2d9b4fd308aa46b19ae4095e61`, rebased onto `5d7a53b6aad`. - Preserved upstream's ingress-monitor type extraction and gateway-suspension repair; the optional cadence field follows its new type owner. - Repaired the retry integration fixture: after real enqueue and initial renewal, only the abandoned message's heartbeat callback fails. The real watchdog then recovers it. Retry delivery, healthy sibling cleanup, and true duplicate assertions remain intact; no production behavior or timeout changed for this repair. - 102 focused tests pass: dispatch ingress retry, queue in-flight/dedupe, ingress lifecycle/watchdog, Plugin SDK fan-in, Discord queue handling, and Slack handler. - Changed-file gates pass: core/core-test/extension typechecks, formatting, changed core/extension lint, SDK boundaries/exports, dead-export scans, and repository guards. - Fresh independent source review found no actionable P0–P2 defects. The standalone autoreview CLI failed at startup without a verdict and is not counted as review coverage. - Current-head CI run [34520397963](https://github.com/openclaw/openclaw/actions/runs/34520397963) completed successfully. The earlier startup subprocess timeout is historical, not a current failing gate. Exact-head ClawSweeper review (September 10, 20:00 UTC) reports no actionable correctness or proof findings; explicit SDK-owner acceptance remains required before merge. - Existing regressions cover immediate renewal after late handoff, periodic deeper-queue renewal, stopping after owner loss, and continuing across a rejected adoption callback. Exact-head durable-ingress boundary proof used isolated SQLite with the production ingress drain/lifecycle binder, follow-up queue, and canonical adoption helper. The model callback was synthetic; this is not live Telegram or Discord transport proof. No production Gateway, channel state, or configuration was touched. Temporary state and queue ownership were cleaned up. ```json { "schema": "openclaw.pr133248.durable-ingress-proof.v1", "exactHead": "57c4faff0ed7bb2d9b4fd308aa46b19ae4095e61", "setup": { "durableStore": "isolated OpenClaw SQLite state", "executor": "production follow-up queue with synthetic model callback", "transportLifecycle": "production ingress drain lifecycle", "adoptionStallTimeoutMs": 180 }, "queuedBehindLongTurn": { "heldMs": 620, "formerDeadlineCrossed": true, "heartbeatCount": 11, "claimStillOwnedAtCheckpoint": [ "queued-event" ], "retryRowsAtCheckpoint": 0, "failedRowsAtCheckpoint": 0, "executionCount": 1, "duplicateAfterAdoption": "completed" }, "orphanRecovery": { "status": "released-for-retry", "attempts": 1, "lastErrorContainsHandlerTimeout": true }, "productionTouched": false } ``` Owner acceptance: - Intended behavior: accepted messages remain adoptable while their exact lifecycle is owned by the queue; ownerless claims retain canonical timeout recovery. - Boundary: one optional cadence field propagated through existing shared lifecycle and channel wrappers; no configuration, schema, or migration change. - Maintainer decision remains open: accept the additive public Plugin SDK lifecycle field and its queue-owned cadence semantics. Bot review is not that acceptance. - Rollback: revert the renewal fix and its companion retry-fixture adjustment. - Scope: 23 files, +273/-2. The width is required lifecycle forwarding; renewal policy stays in the queue and ingress drain. AI-assisted. --- ## Maintainer update — reviewed head `9325ad501aa4` ## What Problem This Solves Messages accepted while a long reply is running can expire in the follow-up queue and consume a retry. The reproduction confirmed expiry and retry; all three messages eventually arrived. It did not reproduce the older permanent-loss report in openclaw#133245. ## Fix and impact The queue starts one heartbeat when it accepts a lifecycle and stops it on adoption, completion, cancellation, or callback failure. Heartbeats no longer scan queue collections or copy the in-flight set. Ingress remains responsible for the watchdog and retry settlement, and a heartbeat cannot undo the watchdog pause during adoption finalization. Ingress derives the cadence from its adoption timeout. The optional lifecycle metadata remains necessary because wrappers rebuild callbacks and combine abort signals, losing the original timeout. No channel setting, schema, migration, dependency, or protocol change is added. The simplification removes 110 lines net from the initial implementation plus main merge. Total production growth is 40 lines. Existing lifecycle types are reused, and the queue cases share the existing lifecycle test fixtures. ## Evidence - Real Gateway and Discord: three marked messages on one route, with a queued reply held for 330 seconds. Main expired the third claim after 300.004 seconds. This head retained the same claim at 322.257 seconds with zero attempts; replies arrived once, in order, at 17.804, 349.201, and 350.223 seconds. - Real SQLite/drain/binder/queue controls: explicit abandonment releases the claim; callback failure stops renewal and lets the watchdog retry without model execution. - 191 core owner/sibling tests and 190 channel tests passed. All five new regression cases failed on plain main for the intended reasons. - The local preflight passed core/extension type-aware lint, production and test types, script types, and protocol checks in an isolated checkout of this head. - External consumers compiled and ran against published 2026.9.4 and this head, including omitted metadata, forwarding, optional return fields, and asynchronous abandonment. ## Consumers Shared ingress binding, batching, reply dispatch, and the Feishu, Slack, Telegram, and Twitch wrappers preserve the source cadence. The fan-in uses the shortest valid cadence. Legacy wrappers that omit the optional field retain their existing head-only heartbeat behavior. Adoption, queue clearing, overflow, cancellation, summaries, and drain replacement retain or finish the same lifecycle owner. Closes openclaw#133245. Original implementation and report by @PollyBot13 (openclaw#133245). The contributor's commits and authorship are retained. AI-assisted. Co-authored-by: Ayaan Zaidi <[email protected]>
…ranch (#150472) * fix(channels): hide intermediate tool failures in quiet progress (#145345) * fix(channels): hide intermediate tool failures in quiet progress Keep authored plans, progress text, approvals, and terminal task errors visible while quiet/default progress omits individual failed-tool and nonzero-exit rows. Preserve explicit tool-log diagnostics and remove obsolete quiet failure recovery handling. Fixes #140037. Reported by @stemkat100 and @joncursi. Validated with 359 focused tests, changed checks, and independent review. * test(channels): align quiet failure visibility coverage Keep explicit diagnostic, approval, plan, and terminal-error coverage while requiring quiet progress to omit intermediate failures across downstream adapters. Assert Mattermost observations after monitor shutdown so a failure cannot be swallowed until timeout. (cherry picked from commit 3bfac2f) * fix(channels): keep deeper queued messages alive through long turns (#133248) The contributor’s original description follows. Historical heads, scope and open decisions in this section refer to that implementation; the reviewed current implementation, compatibility decision and proof are recorded in the maintainer update below. Closes #133245. Related: #127950. This supersedes the current-main-incompatible queue-owned approach in #125385 while preserving today's canonical timeout retry disposition. A durably claimed channel message can wait behind another follow-up turn for longer than the five-minute claim-to-adoption watchdog. Existing liveness renewal covers queue-head active-run admission checks, but not an ingress-backed lifecycle waiting deeper in the follow-up queue. The claim can therefore be retired before the message reaches the model. The follow-up queue now owns periodic deferred heartbeats for the exact ingress lifecycle while it remains in pending items, in-flight delivery, summary sources, or compacted summary elisions. Ingress supplies a cadence derived from one third of its adoption-stall timeout. Debounce, Plugin SDK fan-in, and channel lifecycle wrappers preserve the shortest applicable cadence. Queue ownership triggers an immediate renewal, then periodic renewal; it stops after successful adoption, completion, ownership loss, or callback failure. A rejected adoption callback keeps renewal alive for the supported retry path. The existing watchdog and canonical timeout retry policy remain unchanged, so silent handlers and orphaned claims still recover normally. Messages accepted by durable channel ingress remain adoptable while they wait behind long-running work instead of silently disappearing before model execution. No setting or migration is required. SDK documentation polish (2026-09-10, head `76097fef9397a04c10637e06dfaf64ebb6ca104a`): the public channel SDK guide now documents forwarding both heartbeat fields, the shortest-positive-finite fan-in cadence, renewal termination, and compatibility when older wrappers omit the optional cadence. The documentation-only addition passed changed-page formatting, MDX sanity, and `git diff --check`; production code and the previously tested runtime head below are unchanged. Current-head hosted CI has completed successfully; the final exact-head ClawSweeper review accepts the implementation and proof, leaving only SDK-owner acceptance of the documented contract. Refreshed on 2026-09-08 for exact head `57c4faff0ed7bb2d9b4fd308aa46b19ae4095e61`, rebased onto `1ff45cad5ae`. - Preserved upstream's ingress-monitor type extraction and gateway-suspension repair; the optional cadence field follows its new type owner. - Repaired the retry integration fixture: after real enqueue and initial renewal, only the abandoned message's heartbeat callback fails. The real watchdog then recovers it. Retry delivery, healthy sibling cleanup, and true duplicate assertions remain intact; no production behavior or timeout changed for this repair. - 102 focused tests pass: dispatch ingress retry, queue in-flight/dedupe, ingress lifecycle/watchdog, Plugin SDK fan-in, Discord queue handling, and Slack handler. - Changed-file gates pass: core/core-test/extension typechecks, formatting, changed core/extension lint, SDK boundaries/exports, dead-export scans, and repository guards. - Fresh independent source review found no actionable P0–P2 defects. The standalone autoreview CLI failed at startup without a verdict and is not counted as review coverage. - Current-head CI run [34520397963](https://github.com/openclaw/openclaw/actions/runs/34520397963) completed successfully. The earlier startup subprocess timeout is historical, not a current failing gate. Exact-head ClawSweeper review (September 10, 20:00 UTC) reports no actionable correctness or proof findings; explicit SDK-owner acceptance remains required before merge. - Existing regressions cover immediate renewal after late handoff, periodic deeper-queue renewal, stopping after owner loss, and continuing across a rejected adoption callback. Exact-head durable-ingress boundary proof used isolated SQLite with the production ingress drain/lifecycle binder, follow-up queue, and canonical adoption helper. The model callback was synthetic; this is not live Telegram or Discord transport proof. No production Gateway, channel state, or configuration was touched. Temporary state and queue ownership were cleaned up. ```json { "schema": "openclaw.pr133248.durable-ingress-proof.v1", "exactHead": "57c4faff0ed7bb2d9b4fd308aa46b19ae4095e61", "setup": { "durableStore": "isolated OpenClaw SQLite state", "executor": "production follow-up queue with synthetic model callback", "transportLifecycle": "production ingress drain lifecycle", "adoptionStallTimeoutMs": 180 }, "queuedBehindLongTurn": { "heldMs": 620, "formerDeadlineCrossed": true, "heartbeatCount": 11, "claimStillOwnedAtCheckpoint": [ "queued-event" ], "retryRowsAtCheckpoint": 0, "failedRowsAtCheckpoint": 0, "executionCount": 1, "duplicateAfterAdoption": "completed" }, "orphanRecovery": { "status": "released-for-retry", "attempts": 1, "lastErrorContainsHandlerTimeout": true }, "productionTouched": false } ``` Owner acceptance: - Intended behavior: accepted messages remain adoptable while their exact lifecycle is owned by the queue; ownerless claims retain canonical timeout recovery. - Boundary: one optional cadence field propagated through existing shared lifecycle and channel wrappers; no configuration, schema, or migration change. - Maintainer decision remains open: accept the additive public Plugin SDK lifecycle field and its queue-owned cadence semantics. Bot review is not that acceptance. - Rollback: revert the renewal fix and its companion retry-fixture adjustment. - Scope: 23 files, +273/-2. The width is required lifecycle forwarding; renewal policy stays in the queue and ingress drain. AI-assisted. --- Messages accepted while a long reply is running can expire in the follow-up queue and consume a retry. The reproduction confirmed expiry and retry; all three messages eventually arrived. It did not reproduce the older permanent-loss report in #133245. The queue starts one heartbeat when it accepts a lifecycle and stops it on adoption, completion, cancellation, or callback failure. Heartbeats no longer scan queue collections or copy the in-flight set. Ingress remains responsible for the watchdog and retry settlement, and a heartbeat cannot undo the watchdog pause during adoption finalization. Ingress derives the cadence from its adoption timeout. The optional lifecycle metadata remains necessary because wrappers rebuild callbacks and combine abort signals, losing the original timeout. No channel setting, schema, migration, dependency, or protocol change is added. The simplification removes 110 lines net from the initial implementation plus main merge. Total production growth is 40 lines. Existing lifecycle types are reused, and the queue cases share the existing lifecycle test fixtures. - Real Gateway and Discord: three marked messages on one route, with a queued reply held for 330 seconds. Main expired the third claim after 300.004 seconds. This head retained the same claim at 322.257 seconds with zero attempts; replies arrived once, in order, at 17.804, 349.201, and 350.223 seconds. - Real SQLite/drain/binder/queue controls: explicit abandonment releases the claim; callback failure stops renewal and lets the watchdog retry without model execution. - 191 core owner/sibling tests and 190 channel tests passed. All five new regression cases failed on plain main for the intended reasons. - The local preflight passed core/extension type-aware lint, production and test types, script types, and protocol checks in an isolated checkout of this head. - External consumers compiled and ran against published 2026.9.4 and this head, including omitted metadata, forwarding, optional return fields, and asynchronous abandonment. Shared ingress binding, batching, reply dispatch, and the Feishu, Slack, Telegram, and Twitch wrappers preserve the source cadence. The fan-in uses the shortest valid cadence. Legacy wrappers that omit the optional field retain their existing head-only heartbeat behavior. Adoption, queue clearing, overflow, cancellation, summaries, and drain replacement retain or finish the same lifecycle owner. Closes #133245. Original implementation and report by @PollyBot13 (#133245). The contributor's commits and authorship are retained. AI-assisted. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit dba4da1) * fix(slack): join deferred replay settlement on shutdown (#150073) Recheck cancellation before message preparation after replay claims and lazy pipeline imports, releasing every acquired claim on failure. Keep deferred reply settlement owned through ingress stop and settle failed routed deliveries through the existing failure lifecycle without rejecting successful publication. (cherry picked from commit 82d4d1c) * Restore Slack’s quiet preamble previews (#150407) * Restore Slack’s quiet preamble previews * Keep quiet preambles visible without admitting tool telemetry (cherry picked from commit a90b969) * fix(slack): retry temporary authorization failures (#150457) (cherry picked from commit edc1fa8) * Regenerate release metadata with its pinned schema generator --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: PollyBot13 <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
…penclaw#133248) The contributor’s original description follows. Historical heads, scope and open decisions in this section refer to that implementation; the reviewed current implementation, compatibility decision and proof are recorded in the maintainer update below. Closes openclaw#133245. Related: openclaw#127950. This supersedes the current-main-incompatible queue-owned approach in openclaw#125385 while preserving today's canonical timeout retry disposition. A durably claimed channel message can wait behind another follow-up turn for longer than the five-minute claim-to-adoption watchdog. Existing liveness renewal covers queue-head active-run admission checks, but not an ingress-backed lifecycle waiting deeper in the follow-up queue. The claim can therefore be retired before the message reaches the model. The follow-up queue now owns periodic deferred heartbeats for the exact ingress lifecycle while it remains in pending items, in-flight delivery, summary sources, or compacted summary elisions. Ingress supplies a cadence derived from one third of its adoption-stall timeout. Debounce, Plugin SDK fan-in, and channel lifecycle wrappers preserve the shortest applicable cadence. Queue ownership triggers an immediate renewal, then periodic renewal; it stops after successful adoption, completion, ownership loss, or callback failure. A rejected adoption callback keeps renewal alive for the supported retry path. The existing watchdog and canonical timeout retry policy remain unchanged, so silent handlers and orphaned claims still recover normally. Messages accepted by durable channel ingress remain adoptable while they wait behind long-running work instead of silently disappearing before model execution. No setting or migration is required. SDK documentation polish (2026-09-10, head `76097fef9397a04c10637e06dfaf64ebb6ca104a`): the public channel SDK guide now documents forwarding both heartbeat fields, the shortest-positive-finite fan-in cadence, renewal termination, and compatibility when older wrappers omit the optional cadence. The documentation-only addition passed changed-page formatting, MDX sanity, and `git diff --check`; production code and the previously tested runtime head below are unchanged. Current-head hosted CI has completed successfully; the final exact-head ClawSweeper review accepts the implementation and proof, leaving only SDK-owner acceptance of the documented contract. Refreshed on 2026-09-08 for exact head `57c4faff0ed7bb2d9b4fd308aa46b19ae4095e61`, rebased onto `1ff45cad5ae`. - Preserved upstream's ingress-monitor type extraction and gateway-suspension repair; the optional cadence field follows its new type owner. - Repaired the retry integration fixture: after real enqueue and initial renewal, only the abandoned message's heartbeat callback fails. The real watchdog then recovers it. Retry delivery, healthy sibling cleanup, and true duplicate assertions remain intact; no production behavior or timeout changed for this repair. - 102 focused tests pass: dispatch ingress retry, queue in-flight/dedupe, ingress lifecycle/watchdog, Plugin SDK fan-in, Discord queue handling, and Slack handler. - Changed-file gates pass: core/core-test/extension typechecks, formatting, changed core/extension lint, SDK boundaries/exports, dead-export scans, and repository guards. - Fresh independent source review found no actionable P0–P2 defects. The standalone autoreview CLI failed at startup without a verdict and is not counted as review coverage. - Current-head CI run [34520397963](https://github.com/openclaw/openclaw/actions/runs/34520397963) completed successfully. The earlier startup subprocess timeout is historical, not a current failing gate. Exact-head ClawSweeper review (September 10, 20:00 UTC) reports no actionable correctness or proof findings; explicit SDK-owner acceptance remains required before merge. - Existing regressions cover immediate renewal after late handoff, periodic deeper-queue renewal, stopping after owner loss, and continuing across a rejected adoption callback. Exact-head durable-ingress boundary proof used isolated SQLite with the production ingress drain/lifecycle binder, follow-up queue, and canonical adoption helper. The model callback was synthetic; this is not live Telegram or Discord transport proof. No production Gateway, channel state, or configuration was touched. Temporary state and queue ownership were cleaned up. ```json { "schema": "openclaw.pr133248.durable-ingress-proof.v1", "exactHead": "57c4faff0ed7bb2d9b4fd308aa46b19ae4095e61", "setup": { "durableStore": "isolated OpenClaw SQLite state", "executor": "production follow-up queue with synthetic model callback", "transportLifecycle": "production ingress drain lifecycle", "adoptionStallTimeoutMs": 180 }, "queuedBehindLongTurn": { "heldMs": 620, "formerDeadlineCrossed": true, "heartbeatCount": 11, "claimStillOwnedAtCheckpoint": [ "queued-event" ], "retryRowsAtCheckpoint": 0, "failedRowsAtCheckpoint": 0, "executionCount": 1, "duplicateAfterAdoption": "completed" }, "orphanRecovery": { "status": "released-for-retry", "attempts": 1, "lastErrorContainsHandlerTimeout": true }, "productionTouched": false } ``` Owner acceptance: - Intended behavior: accepted messages remain adoptable while their exact lifecycle is owned by the queue; ownerless claims retain canonical timeout recovery. - Boundary: one optional cadence field propagated through existing shared lifecycle and channel wrappers; no configuration, schema, or migration change. - Maintainer decision remains open: accept the additive public Plugin SDK lifecycle field and its queue-owned cadence semantics. Bot review is not that acceptance. - Rollback: revert the renewal fix and its companion retry-fixture adjustment. - Scope: 23 files, +273/-2. The width is required lifecycle forwarding; renewal policy stays in the queue and ingress drain. AI-assisted. --- Messages accepted while a long reply is running can expire in the follow-up queue and consume a retry. The reproduction confirmed expiry and retry; all three messages eventually arrived. It did not reproduce the older permanent-loss report in openclaw#133245. The queue starts one heartbeat when it accepts a lifecycle and stops it on adoption, completion, cancellation, or callback failure. Heartbeats no longer scan queue collections or copy the in-flight set. Ingress remains responsible for the watchdog and retry settlement, and a heartbeat cannot undo the watchdog pause during adoption finalization. Ingress derives the cadence from its adoption timeout. The optional lifecycle metadata remains necessary because wrappers rebuild callbacks and combine abort signals, losing the original timeout. No channel setting, schema, migration, dependency, or protocol change is added. The simplification removes 110 lines net from the initial implementation plus main merge. Total production growth is 40 lines. Existing lifecycle types are reused, and the queue cases share the existing lifecycle test fixtures. - Real Gateway and Discord: three marked messages on one route, with a queued reply held for 330 seconds. Main expired the third claim after 300.004 seconds. This head retained the same claim at 322.257 seconds with zero attempts; replies arrived once, in order, at 17.804, 349.201, and 350.223 seconds. - Real SQLite/drain/binder/queue controls: explicit abandonment releases the claim; callback failure stops renewal and lets the watchdog retry without model execution. - 191 core owner/sibling tests and 190 channel tests passed. All five new regression cases failed on plain main for the intended reasons. - The local preflight passed core/extension type-aware lint, production and test types, script types, and protocol checks in an isolated checkout of this head. - External consumers compiled and ran against published 2026.9.4 and this head, including omitted metadata, forwarding, optional return fields, and asynchronous abandonment. Shared ingress binding, batching, reply dispatch, and the Feishu, Slack, Telegram, and Twitch wrappers preserve the source cadence. The fan-in uses the shortest valid cadence. Legacy wrappers that omit the optional field retain their existing head-only heartbeat behavior. Adoption, queue clearing, overflow, cancellation, summaries, and drain replacement retain or finish the same lifecycle owner. Closes openclaw#133245. Original implementation and report by @PollyBot13 (openclaw#133245). The contributor's commits and authorship are retained. AI-assisted. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit dba4da1)
Contributor description — original implementation
The contributor’s original description follows. Historical heads, scope and open decisions in this section refer to that implementation; the reviewed current implementation, compatibility decision and proof are recorded in the maintainer update below.
Closes #133245.
Related: #127950. This supersedes the current-main-incompatible queue-owned approach in #125385 while preserving today's canonical timeout retry disposition.
What Problem This Solves
A durably claimed channel message can wait behind another follow-up turn for longer than the five-minute claim-to-adoption watchdog. Existing liveness renewal covers queue-head active-run admission checks, but not an ingress-backed lifecycle waiting deeper in the follow-up queue. The claim can therefore be retired before the message reaches the model.
Why This Change Was Made
The follow-up queue now owns periodic deferred heartbeats for the exact ingress lifecycle while it remains in pending items, in-flight delivery, summary sources, or compacted summary elisions.
Ingress supplies a cadence derived from one third of its adoption-stall timeout. Debounce, Plugin SDK fan-in, and channel lifecycle wrappers preserve the shortest applicable cadence. Queue ownership triggers an immediate renewal, then periodic renewal; it stops after successful adoption, completion, ownership loss, or callback failure. A rejected adoption callback keeps renewal alive for the supported retry path.
The existing watchdog and canonical timeout retry policy remain unchanged, so silent handlers and orphaned claims still recover normally.
User Impact
Messages accepted by durable channel ingress remain adoptable while they wait behind long-running work instead of silently disappearing before model execution. No setting or migration is required.
Evidence
SDK documentation polish (2026-09-10, head
76097fef9397a04c10637e06dfaf64ebb6ca104a): the public channel SDK guide now documents forwarding both heartbeat fields, the shortest-positive-finite fan-in cadence, renewal termination, and compatibility when older wrappers omit the optional cadence. The documentation-only addition passed changed-page formatting, MDX sanity, andgit diff --check; production code and the previously tested runtime head below are unchanged. Current-head hosted CI has completed successfully; the final exact-head ClawSweeper review accepts the implementation and proof, leaving only SDK-owner acceptance of the documented contract.Refreshed on 2026-09-08 for exact head
57c4faff0ed7bb2d9b4fd308aa46b19ae4095e61, rebased onto1ff45cad5ae.Exact-head durable-ingress boundary proof used isolated SQLite with the production ingress drain/lifecycle binder, follow-up queue, and canonical adoption helper. The model callback was synthetic; this is not live Telegram or Discord transport proof. No production Gateway, channel state, or configuration was touched. Temporary state and queue ownership were cleaned up.
{ "schema": "openclaw.pr133248.durable-ingress-proof.v1", "exactHead": "57c4faff0ed7bb2d9b4fd308aa46b19ae4095e61", "setup": { "durableStore": "isolated OpenClaw SQLite state", "executor": "production follow-up queue with synthetic model callback", "transportLifecycle": "production ingress drain lifecycle", "adoptionStallTimeoutMs": 180 }, "queuedBehindLongTurn": { "heldMs": 620, "formerDeadlineCrossed": true, "heartbeatCount": 11, "claimStillOwnedAtCheckpoint": [ "queued-event" ], "retryRowsAtCheckpoint": 0, "failedRowsAtCheckpoint": 0, "executionCount": 1, "duplicateAfterAdoption": "completed" }, "orphanRecovery": { "status": "released-for-retry", "attempts": 1, "lastErrorContainsHandlerTimeout": true }, "productionTouched": false }Owner acceptance:
AI-assisted.
Maintainer update — reviewed head
9325ad501aa4What Problem This Solves
Messages accepted while a long reply is running can expire in the follow-up queue and consume a retry. The reproduction confirmed expiry and retry; all three messages eventually arrived. It did not reproduce the older permanent-loss report in #133245.
Fix and impact
The queue starts one heartbeat when it accepts a lifecycle and stops it on adoption, completion, cancellation, or callback failure. Heartbeats no longer scan queue collections or copy the in-flight set. Ingress remains responsible for the watchdog and retry settlement, and a heartbeat cannot undo the watchdog pause during adoption finalization.
Ingress derives the cadence from its adoption timeout. The optional lifecycle metadata remains necessary because wrappers rebuild callbacks and combine abort signals, losing the original timeout. No channel setting, schema, migration, dependency, or protocol change is added.
The simplification removes 110 lines net from the initial implementation plus main merge. Total production growth is 40 lines. Existing lifecycle types are reused, and the queue cases share the existing lifecycle test fixtures.
Evidence
Consumers
Shared ingress binding, batching, reply dispatch, and the Feishu, Slack, Telegram, and Twitch wrappers preserve the source cadence. The fan-in uses the shortest valid cadence. Legacy wrappers that omit the optional field retain their existing head-only heartbeat behavior. Adoption, queue clearing, overflow, cancellation, summaries, and drain replacement retain or finish the same lifecycle owner.
Closes #133245.
Original implementation and report by @PollyBot13 (#133245). The contributor's commits and authorship are retained.
AI-assisted.