Repository navigation
fix: stop replaying messages discarded by queue caps - #193313
Merged
Merged
Conversation
Merge current main and preserve policy-drop custody through the queue, durable ingress, and channel lifecycle wrappers. Keep cancellation, protected-capacity backpressure, ambient shedding, and summary ownership. Fixes #182246. Co-authored-by: Emeric Dandelion Cult <[email protected]>
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
marked this pull request as ready for review
November 5, 2026 08:21
Contributor
Author
|
@clawsweeper re-review |
Contributor
|
🦞👀 Re-review progress:
|
Contributor
Codex Review SummaryThis 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. |
Contributor
Author
|
@clawsweeper re-review |
Contributor
|
🦞👀 Re-review progress:
|
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 6, 2026
…openclaw#193423) * fix(channels): preserve ingress custody across plugin reloads Keep queue and maintenance work under monitor-owned plugin custody through quiescence. Gate new delivery callbacks until resume, wake the existing monitor after a failed reload, and preserve caller authority for permitted late admissions and settlements. Retire failed drains without exposing completed side effects to replay: retain unresolved terminal claim identities in memory while allowing never-adopted peer claims to recover. Stop reports failed writes and still finishes disposal. Durable schemas and restart recovery remain unchanged. This is the lifecycle prerequisite for openclaw#193313; queue policy and notice changes remain with that draft. * fix(channels): close ingress reload lifecycle gaps Honor retained starts during quiescence, retire aborted monitors through their joined stop path, retain failed dead-letter claims, and clear rejected pumps for later wakes. Forward Discord account aborts to its ingress monitor. Preserve claim-token fences, failed-completion protection, and the existing split between admitted queue maintenance and fresh delivery authority. * test(channels): simplify failed terminal write fixture
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 6, 2026
Closes openclaw#182246. Maintainer continuation of openclaw#182252, preserving the contributor commits. Thanks @emeric-dandelion-cult for the original repair. ## What Problem This Solves Messages intentionally discarded by the session queue's `old`/`new` cap policies could re-enter durable ingress, replay, and delay surviving messages. ## User Impact Policy-discarded messages receive a terminal queue-policy outcome without retry-failure notices or resend invitations. Surviving messages retain FIFO ordering. Protected-only capacity rejection remains retryable; surfaces without durable ingress keep visible queue-full feedback, and a refused `/followup` reports that it was not queued. Policy drops do not count as dead letters in health or Doctor. Retention bounds their replay guards separately from actual failures under the existing TTL. No config option, schema migration, dependency, or manual action is added. Old dropped content can still appear in Discord's independently recovered room history; it does not execute as a separate turn. ## Why This Change Was Made The existing queue, source-custody, and ingress owners carry a distinct dropped outcome through debounce and channel wrappers. The ingress monitor forwards it through its existing settlement wrapper. Failure reporting and bounded pruning remain with their existing owners. Feishu settles dropped session lanes independently, and summary eviction unbinds a source before awaiting its receipt. Reload and claim ownership come from merged main, including openclaw#193564. The monitor change only forwards `onDropped` through `settleLifecycle`; this PR adds no competing custody or fence mechanism. SDK docs describe forwarding and cleanup. Wrappers without durable terminal-drop custody retain their existing abandonment fallback. Redelivery while a drop callback's receipt is still pending receives the existing bounded pending refusal; this is accepted, and no eager commit or `onDropped` wrapper is added. ## Evidence Three dispatch/real-ingress/real-followup composition regressions cover old eviction, new rejection, and summarized eviction. Each verifies a terminal row with attempts 0 and its policy reason, then settled-source same-ID redelivery returns `skipped:duplicate`, makes no second resolver call, and sends no final reply. All three already passed on the merged head before this continuation; they protect composition with openclaw#193564 rather than establish a newly fixed post-settlement leak. Real local-model proof used an isolated Gateway through `pnpm openclaw`, synthetic Discord transport, real shared Ollama `qwen2.5:7b`, and the real queue, ingress ledger, model request and delivery path. These are macOS arm64 results, not live Discord-service or Linux/Windows proof. - Node 26.12.1 and pinned Bun 1.4.4 each passed reload plus old/new policy survival. Reload produced exactly RUNNER/B/C/D requests and replies in order; A ended `queue-cap-old` with attempts 0. Each surviving source completed with attempts 0. Each runtime logged one recovered unavailable-instance event; generation advanced 2 to 3, health/status answered, and no uncaught exception or unhandled rejection occurred. Old/new produced exactly RUNNER+B and RUNNER+A respectively, with the discarded source terminal at attempts 0 and no retry/resend notice. Combined command wall times: 114.03s Node, 69.73s Bun. - Both runtimes passed real Gateway non-durable overflow and refused `/followup`: each refusal produced exactly one neutral queue-full terminal outcome, while RUNNER and queued A each received a real model answer. Command wall times: 58.48s Node, 22.59s Bun. All eight scenarios passed; no input was lost, duplicated or left unanswered. All 22 retained runtime/launcher logs were scanned without an uncaught exception or unhandled rejection. `pnpm build` passed in 279.90s. The focused consumer set passed 895 tests across 37 files with one PostgreSQL-only capability skip in 508.51s. It covers queue/summary, ingress monitor/drain/claim ownership, channel wrappers, SDK fan-in/debounce, plugin replacement, Gateway outcomes, and prompt-prefix stability. All eight scoped production/test typechecks now pass; the first run caught a test-only lifecycle narrowing error. Scoped production/test/script lint and formatting pass after removing an unused import left by main integration. The corrected two-file Node rerun passed all 105 tests in 61.11s. The build, live runs and full consumer set preceded the final test-only type/import correction; production bytes are unchanged. No production wrapper or eager dedupe commit was added. All ten final-head baseline ratchets pass (53.79s), including assertion safety, line caps, timeout races, mock exports, test lines, database boundaries, configuration docs and plugin inventory. Current candidate: `7ddd944b651faf57bd935977235a69715768cb7c`. ClawSweeper completed its exact-head review at 2026-11-05 20:15 UTC with no findings, no security findings and no Before merge items. [Exact-head CI](https://github.com/openclaw/openclaw/actions/runs/42100431795) passed on attempt 2 at 2026-11-05 21:24 UTC. Attempt 1 failed only the Bun restart/resume test with `AgentDatabaseAdmissionError` during startup. The affected owner code is identical to main; ten full-file local runs passed on main and this head, and the separate restart/resume admission lane owns that race. Only the failed shard was rerun once. The maintainer lead accepted this evidence and authorized landing; the previously reported CI blocker is resolved. Local Codex branch autoreview from `bd8cac762efe00978ab5174974ff0f7bc146db2e` to `7ddd944b651faf57bd935977235a69715768cb7c` through P2 is scoped-clean, with no accepted/actionable findings. The reviewer assessed source; runtime proof is reported separately. The earlier main comparison reproduced old/new discarded rows remaining claimed rather than reaching a terminal policy outcome, despite a real RUNNER answer; the candidate passed those invariants. That baseline reproduction is retained prior-lane evidence, not a new run here. Rename-aware delta against merged main `bd8cac762efe00978ab5174974ff0f7bc146db2e`: production/scripts +527/-185 (net +342); tests/support +1362/-1196 (net +166); docs +40/-3 (net +37). This continuation adds 0 production lines and a net 108 test lines (109 composition lines minus one unused import). Production growth carries terminal outcomes through existing wrappers and separates bounded retention classes. A dedicated 166-line test allocation covers the 58 existing net regression lines after main integration plus this continuation’s net 108 test lines; the shared baseline is unchanged. The composition uses existing fixtures and no real timers or extra Gateway boot. Co-authored-by: Emeric Dandelion Cult <[email protected]>
wangmiao0668000666
pushed a commit
to wangmiao0668000666/openclaw
that referenced
this pull request
Nov 6, 2026
Closes openclaw#182246. Maintainer continuation of openclaw#182252, preserving the contributor commits. Thanks @emeric-dandelion-cult for the original repair. ## What Problem This Solves Messages intentionally discarded by the session queue's `old`/`new` cap policies could re-enter durable ingress, replay, and delay surviving messages. ## User Impact Policy-discarded messages receive a terminal queue-policy outcome without retry-failure notices or resend invitations. Surviving messages retain FIFO ordering. Protected-only capacity rejection remains retryable; surfaces without durable ingress keep visible queue-full feedback, and a refused `/followup` reports that it was not queued. Policy drops do not count as dead letters in health or Doctor. Retention bounds their replay guards separately from actual failures under the existing TTL. No config option, schema migration, dependency, or manual action is added. Old dropped content can still appear in Discord's independently recovered room history; it does not execute as a separate turn. ## Why This Change Was Made The existing queue, source-custody, and ingress owners carry a distinct dropped outcome through debounce and channel wrappers. The ingress monitor forwards it through its existing settlement wrapper. Failure reporting and bounded pruning remain with their existing owners. Feishu settles dropped session lanes independently, and summary eviction unbinds a source before awaiting its receipt. Reload and claim ownership come from merged main, including openclaw#193564. The monitor change only forwards `onDropped` through `settleLifecycle`; this PR adds no competing custody or fence mechanism. SDK docs describe forwarding and cleanup. Wrappers without durable terminal-drop custody retain their existing abandonment fallback. Redelivery while a drop callback's receipt is still pending receives the existing bounded pending refusal; this is accepted, and no eager commit or `onDropped` wrapper is added. ## Evidence Three dispatch/real-ingress/real-followup composition regressions cover old eviction, new rejection, and summarized eviction. Each verifies a terminal row with attempts 0 and its policy reason, then settled-source same-ID redelivery returns `skipped:duplicate`, makes no second resolver call, and sends no final reply. All three already passed on the merged head before this continuation; they protect composition with openclaw#193564 rather than establish a newly fixed post-settlement leak. Real local-model proof used an isolated Gateway through `pnpm openclaw`, synthetic Discord transport, real shared Ollama `qwen2.5:7b`, and the real queue, ingress ledger, model request and delivery path. These are macOS arm64 results, not live Discord-service or Linux/Windows proof. - Node 26.12.1 and pinned Bun 1.4.4 each passed reload plus old/new policy survival. Reload produced exactly RUNNER/B/C/D requests and replies in order; A ended `queue-cap-old` with attempts 0. Each surviving source completed with attempts 0. Each runtime logged one recovered unavailable-instance event; generation advanced 2 to 3, health/status answered, and no uncaught exception or unhandled rejection occurred. Old/new produced exactly RUNNER+B and RUNNER+A respectively, with the discarded source terminal at attempts 0 and no retry/resend notice. Combined command wall times: 114.03s Node, 69.73s Bun. - Both runtimes passed real Gateway non-durable overflow and refused `/followup`: each refusal produced exactly one neutral queue-full terminal outcome, while RUNNER and queued A each received a real model answer. Command wall times: 58.48s Node, 22.59s Bun. All eight scenarios passed; no input was lost, duplicated or left unanswered. All 22 retained runtime/launcher logs were scanned without an uncaught exception or unhandled rejection. `pnpm build` passed in 279.90s. The focused consumer set passed 895 tests across 37 files with one PostgreSQL-only capability skip in 508.51s. It covers queue/summary, ingress monitor/drain/claim ownership, channel wrappers, SDK fan-in/debounce, plugin replacement, Gateway outcomes, and prompt-prefix stability. All eight scoped production/test typechecks now pass; the first run caught a test-only lifecycle narrowing error. Scoped production/test/script lint and formatting pass after removing an unused import left by main integration. The corrected two-file Node rerun passed all 105 tests in 61.11s. The build, live runs and full consumer set preceded the final test-only type/import correction; production bytes are unchanged. No production wrapper or eager dedupe commit was added. All ten final-head baseline ratchets pass (53.79s), including assertion safety, line caps, timeout races, mock exports, test lines, database boundaries, configuration docs and plugin inventory. Current candidate: `7ddd944b651faf57bd935977235a69715768cb7c`. ClawSweeper completed its exact-head review at 2026-11-05 20:15 UTC with no findings, no security findings and no Before merge items. [Exact-head CI](https://github.com/openclaw/openclaw/actions/runs/42100431795) passed on attempt 2 at 2026-11-05 21:24 UTC. Attempt 1 failed only the Bun restart/resume test with `AgentDatabaseAdmissionError` during startup. The affected owner code is identical to main; ten full-file local runs passed on main and this head, and the separate restart/resume admission lane owns that race. Only the failed shard was rerun once. The maintainer lead accepted this evidence and authorized landing; the previously reported CI blocker is resolved. Local Codex branch autoreview from `54ed2bcc74b746085ddebe28ee59d268cd302fb6` to `7ddd944b651faf57bd935977235a69715768cb7c` through P2 is scoped-clean, with no accepted/actionable findings. The reviewer assessed source; runtime proof is reported separately. The earlier main comparison reproduced old/new discarded rows remaining claimed rather than reaching a terminal policy outcome, despite a real RUNNER answer; the candidate passed those invariants. That baseline reproduction is retained prior-lane evidence, not a new run here. Rename-aware delta against merged main `54ed2bcc74b746085ddebe28ee59d268cd302fb6`: production/scripts +527/-185 (net +342); tests/support +1362/-1196 (net +166); docs +40/-3 (net +37). This continuation adds 0 production lines and a net 108 test lines (109 composition lines minus one unused import). Production growth carries terminal outcomes through existing wrappers and separates bounded retention classes. A dedicated 166-line test allocation covers the 58 existing net regression lines after main integration plus this continuation’s net 108 test lines; the shared baseline is unchanged. The composition uses existing fixtures and no real timers or extra Gateway boot. Co-authored-by: Emeric Dandelion Cult <[email protected]>
github-actions Bot
pushed a commit
to clawhaven/openclaw
that referenced
this pull request
Nov 23, 2026
* fix: preserve user requests during ambient queue overflow * fix: settle discarded ambient input without delivery scopes * fix: keep ambient chatter from evicting user requests OpenClaw-Publication: 4ccedf5d-d860-4b15-85e9-251f70601797 * fix: preserve bounded ambient context during queue overflow * Publish openclaw/fast-shell OpenClaw-Publication: 933231df-b944-4a6d-9e8d-becfd2191d99 --------- Co-authored-by: RomneyDa <[email protected]> Source: 69d6eae Release adaptation: Selected queue-only production and regressions applied cleanly atop baseline source custody. Required requests displace ambient only, previews bounded to same route and approved text, attach once. Terminal discard uses existing lifecycle adoption without executable backlog. Excluded QA transport/docs/allocation. Later openclaw#193313 broader ingress policy-drop work not imported; baseline unbound payload/custody retained. Formatting/diff checks pass; runtime unavailable due established setup blocker. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 88dc9f72f0e34b12944e155d90d5c884b7f2bbb7)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #182246. Maintainer continuation of #182252, preserving the contributor commits. Thanks @emeric-dandelion-cult for the original repair.
What Problem This Solves
Messages intentionally discarded by the session queue's
old/newcap policies could re-enter durable ingress, replay, and delay surviving messages.User Impact
Policy-discarded messages receive a terminal queue-policy outcome without retry-failure notices or resend invitations. Surviving messages retain FIFO ordering. Protected-only capacity rejection remains retryable; surfaces without durable ingress keep visible queue-full feedback, and a refused
/followupreports that it was not queued.Policy drops do not count as dead letters in health or Doctor. Retention bounds their replay guards separately from actual failures under the existing TTL. No config option, schema migration, dependency, or manual action is added. Old dropped content can still appear in Discord's independently recovered room history; it does not execute as a separate turn.
Why This Change Was Made
The existing queue, source-custody, and ingress owners carry a distinct dropped outcome through debounce and channel wrappers. The ingress monitor forwards it through its existing settlement wrapper. Failure reporting and bounded pruning remain with their existing owners. Feishu settles dropped session lanes independently, and summary eviction unbinds a source before awaiting its receipt.
Reload and claim ownership come from merged main, including #193564. The monitor change only forwards
onDroppedthroughsettleLifecycle; this PR adds no competing custody or fence mechanism. SDK docs describe forwarding and cleanup. Wrappers without durable terminal-drop custody retain their existing abandonment fallback.Redelivery while a drop callback's receipt is still pending receives the existing bounded pending refusal; this is accepted, and no eager commit or
onDroppedwrapper is added.Evidence
Three dispatch/real-ingress/real-followup composition regressions cover old eviction, new rejection, and summarized eviction. Each verifies a terminal row with attempts 0 and its policy reason, then settled-source same-ID redelivery returns
skipped:duplicate, makes no second resolver call, and sends no final reply. All three already passed on the merged head before this continuation; they protect composition with #193564 rather than establish a newly fixed post-settlement leak.Real local-model proof used an isolated Gateway through
pnpm openclaw, synthetic Discord transport, real shared Ollamaqwen2.5:7b, and the real queue, ingress ledger, model request and delivery path. These are macOS arm64 results, not live Discord-service or Linux/Windows proof.queue-cap-oldwith attempts 0. Each surviving source completed with attempts 0. Each runtime logged one recovered unavailable-instance event; generation advanced 2 to 3, health/status answered, and no uncaught exception or unhandled rejection occurred. Old/new produced exactly RUNNER+B and RUNNER+A respectively, with the discarded source terminal at attempts 0 and no retry/resend notice. Combined command wall times: 114.03s Node, 69.73s Bun./followup: each refusal produced exactly one neutral queue-full terminal outcome, while RUNNER and queued A each received a real model answer. Command wall times: 58.48s Node, 22.59s Bun. All eight scenarios passed; no input was lost, duplicated or left unanswered. All 22 retained runtime/launcher logs were scanned without an uncaught exception or unhandled rejection.pnpm buildpassed in 279.90s. The focused consumer set passed 895 tests across 37 files with one PostgreSQL-only capability skip in 508.51s. It covers queue/summary, ingress monitor/drain/claim ownership, channel wrappers, SDK fan-in/debounce, plugin replacement, Gateway outcomes, and prompt-prefix stability. All eight scoped production/test typechecks now pass; the first run caught a test-only lifecycle narrowing error. Scoped production/test/script lint and formatting pass after removing an unused import left by main integration. The corrected two-file Node rerun passed all 105 tests in 61.11s.The build, live runs and full consumer set preceded the final test-only type/import correction; production bytes are unchanged. No production wrapper or eager dedupe commit was added. All ten final-head baseline ratchets pass (53.79s), including assertion safety, line caps, timeout races, mock exports, test lines, database boundaries, configuration docs and plugin inventory.
Current candidate:
7ddd944b651faf57bd935977235a69715768cb7c. ClawSweeper completed its exact-head review at 2026-11-05 20:15 UTC with no findings, no security findings and no Before merge items. Exact-head CI passed on attempt 2 at 2026-11-05 21:24 UTC. Attempt 1 failed only the Bun restart/resume test withAgentDatabaseAdmissionErrorduring startup. The affected owner code is identical to main; ten full-file local runs passed on main and this head, and the separate restart/resume admission lane owns that race. Only the failed shard was rerun once. The maintainer lead accepted this evidence and authorized landing; the previously reported CI blocker is resolved.Local Codex branch autoreview from
54ed2bcc74b746085ddebe28ee59d268cd302fb6to7ddd944b651faf57bd935977235a69715768cb7cthrough P2 is scoped-clean, with no accepted/actionable findings. The reviewer assessed source; runtime proof is reported separately.The earlier main comparison reproduced old/new discarded rows remaining claimed rather than reaching a terminal policy outcome, despite a real RUNNER answer; the candidate passed those invariants. That baseline reproduction is retained prior-lane evidence, not a new run here.
Rename-aware delta against merged main
54ed2bcc74b746085ddebe28ee59d268cd302fb6: production/scripts +527/-185 (net +342); tests/support +1362/-1196 (net +166); docs +40/-3 (net +37). This continuation adds 0 production lines and a net 108 test lines (109 composition lines minus one unused import). Production growth carries terminal outcomes through existing wrappers and separates bounded retention classes. A dedicated 166-line test allocation covers the 58 existing net regression lines after main integration plus this continuation’s net 108 test lines; the shared baseline is unchanged. The composition uses existing fixtures and no real timers or extra Gateway boot.