Repository navigation
fix: stop channel messages replaying when reply queue fills - #182252
emeric-dandelion-cult wants to merge 10 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR makes deliberate reply-queue discards terminal ingress failures instead of retryable abandonment. Example: With cap 1 and drop old, QCAP-B arrives while QCAP-A waits behind an active turn.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 4 items remain Keep this PR open: current main still has the replay defect, but the patch bypasses two channel cleanup paths. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherChannel adapters carry durable ingress claims into the session reply queue; lifecycle callbacks return adoption, retry, or terminal failure to the ingress owner. flowchart LR
A[Channel event] --> B[Durable ingress]
B --> C[Channel lifecycle adapter]
C --> D[Session reply queue]
D --> E[Adopt surviving input]
D --> F[Terminal policy drop]
F --> G[Failed ingress ledger]
Technical reviewBest possible solution: Keep terminal discards in the existing ingress failure owner while preserving Slack routing cleanup, SMS media cleanup, and retryable backpressure. Do we have a high-confidence way to reproduce the issue? Current-main source establishes cap discard → source abandonment → ingress release, and the contributor supplies red-first regressions and corroborating fleet logs; no target code was executed during this review. Is this the best way to solve the issue? An explicit terminal disposition matches the documented discard contract and reuses the correct settlement owner, but every adapter must preserve its existing cleanup when abandonment is bypassed. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3183356530eb. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +235, Tests +348. Total +583 across 30 files. Added test files: 1. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 24, 2026, 9:12 AM ET / 13:12 UTC (Revision 2). |
The composite carries the three upstream-open grafts on top of the continuation absorb: openclaw#121204 (248cf17), openclaw#124337 (cd8a6e2) and openclaw#182252 (8eb4fe7). This merges jump 5, i.e. P ea81534 + upstream 9629838, into the previous composite 8ce7a05. Clean merge. The graft delta is byte-identical: git diff ea81534 8ce7a05 and git diff 17d81d6 <this commit> touch the same 95 files with the same added and removed lines. Refs: karmaterminal/openclaw-bootstrap#1727 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Jhynq2GVpzuVQQieebEubg
…8 composite Graft: emeric/20261027-182252-on-124337-j8 @ 7c3cd5f (openclaw#124337 pre-adoption abandonment bounded by the retry budget, with openclaw#182252 queue-cap policy drops reconciled over it; queue semantics reviewed by frond-gloss). Conflict: src/channels/message/ingress-drain.ts, import block only (openclaw#121204 moved the drain option types to ingress-drain-options.ts; openclaw#182252 added the queue-cap drop import). Resolved to openclaw#121204's narrowed imports plus openclaw#182252's ingress-queue-cap-drop import; both bodies auto-merged. The j8 candidate does not touch this file. Composite manifest: #1491 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Graft: emeric/20261027-182252-j8-backmerge @ c2ea410 (queue-cap policy drops no longer replay channel ingress). Merged so the standalone openclaw#182252 head is an ancestor of the composite. Conflict: src/auto-reply/reply/queue/enqueue.ts resolved to graft 2's combined bytes (emeric/20261027-182252-on-124337-j8 @ 7c3cd5f), whose releaseBeforeTurnAdoptionRetry already releases the dedupe source on onDropped by inputInstance (023b34c's fix). The Slack test and queue.policy-drop.test.ts merge to the same combined bytes. This merge changes no tree content. Composite manifest: #1491 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…9 composite Graft: emeric/20261027-182252-on-124337-j8 @ 7c3cd5f (openclaw#124337 pre-adoption abandonment bounded by the retry budget, with openclaw#182252 queue-cap policy drops reconciled over it; queue semantics reviewed by frond-gloss). Carried as-is from the j8 composite. Conflict: src/channels/message/ingress-drain.ts, import block only (openclaw#121204 moved the drain option types to ingress-drain-options.ts; openclaw#182252 added the queue-cap drop import). Resolved to openclaw#121204's narrowed imports plus openclaw#182252's ingress-queue-cap-drop import, the same resolution as the j8 composite's 1ca76ba; both bodies auto-merged. Verified the staged file equals the raw three-way merge with only that hunk resolved. The j9 candidate does not touch this file. Composite manifest: #1491 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Graft: emeric/20261027-182252-j8-backmerge @ c2ea410 (queue-cap policy drops no longer replay channel ingress). Merged so the standalone openclaw#182252 head is an ancestor of the composite; carried as-is from the j8 composite. Conflict: src/auto-reply/reply/queue/enqueue.ts resolved to graft 2's combined bytes (emeric/20261027-182252-on-124337-j8 @ 7c3cd5f, blob 5deb399). The Slack message-handler, message-handler test and ingress test, and queue.policy-drop.test.ts, merge to the same combined bytes. This merge changes no tree content (index tree == first-parent tree 77b0873). Composite manifest: #1491 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
This pull request has been automatically marked as stale after 7 days without qualifying human activity. |
Merge current main while retaining its monitor-owned custody and per-claim retirement fence. Forward queue-policy drops through the existing settlement path, preserve non-durable and explicit followup outcomes, and release Feishu replay claims after late drops. Keep policy drops separate from delivery failures in notices, health, and bounded retention. Preserve summary unbinding and all original contributor commits for #182252. Fixes #182246.
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`/`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 #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 #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]>
|
Superseded by #193313, now merged as 9435188, fixing #182246. The continuation preserves the original contributor commits in its ancestry and credits @emeric-dandelion-cult with a |
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]>
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]>
Closes #182246
What Problem This Solves
Durable channel messages discarded by a full follow-up queue were re-claimed and retried as abandoned turns until their retry budget ran out. The Discord fan-in and inbound-debounce wrappers, Telegram spooled replay, Feishu fan-in/broadcast, and Slack logical replay guards also lost the new terminal-drop callback, so the initial queue fix did not reach those channels.
User Impact
Actual queue-cap evictions now settle once in the failed-message ledger with a policy reason, including through Discord’s and iMessage’s shared composed ingress lifecycle, Telegram’s spooled replay participant, Feishu’s flush/broadcast adapters, and Slack’s logical replay guard. Summary-elision cap eviction has the same terminal disposition. A full queue with no evictable item remains retryable backpressure, not a policy drop. Ordinary abandonment and cancellation remain unchanged. No migration or user action is required.
Why This Change Was Made
The queue previously completed cap-dropped sources through the same callback used when a turn never adopted the reply lane. The ingress drain interpreted that as retryable abandonment. The queue now gives deliberate discards an explicit terminal lifecycle disposition; ingress classifies it as non-retryable and retains asynchronous settlement custody before marking the source complete. Channel fan-in and inbound debounce forward that disposition without losing the claims (the same fan-in is used by iMessage). Telegram spooled replay forwards and awaits the terminal disposition through its deferred participant, then settles the durable row. Feishu flush and broadcast carry terminal drops through transport and replay-claim settlement; Slack preserves the callback through its ingress lifecycle and commits its separate logical replay claim on a drop. The all-protected refusal keeps the retry path.
Evidence
7ab64536d3eb75e7020a90ebce0b6eafc06502e4; the touched four-file suite passed 97/97 after the fix.54c515a2identified the Discord wrapper gap and all-protected backpressure. Three further red-first cases failed on that head, then passed after the correction: composed fan-in→debounce drop (2 claims), protected backpressure, and summary-elision cap eviction.1e971137a52124ad9fc2ddf9f341e7328d4aecfc: prior 51 focused core tests passed; red-first Telegram fossils failed on0f0f5fb080b6and passed after correction (processor 19/19 and SQLite ingress 23/23). Slack ingress/message-handler suites passed 38/38; Feishu ingress/broadcast suites passed 24/24, followed by a targeted drop-settlement-failure case 2/2. Core/core-test and extension/extension-test typechecks, touched-file oxlint and oxfmt, andgit diff --checkpassed. That head’s CI had two failing Node shards; they are under attribution, not counted as green.8eb4fe75bba4d4decf2ef906a789673b4a507e80: red-first Feishu broadcast failure probe now verifies the dropped-lane claim releases when durable settlement fails; Slack success/failure probes verify the logical claim commits only after both lifecycle callbacks succeed. Feishu broadcast 11/11 and Slack message-handler 19/19 passed; extension production/test typechecks, touched-file oxlint/oxfmt, andgit diff --checkpassed. Current-head CI completed with two gateway test failures:server.chat-abort-settlement.test.tsaccepted-injection dispatch expected one injection but saw none, andserver.subagent-stop-followup.product.test.tsparent-stop case observed a missingkillReconciliation. Both signatures also failed on prior head1e971137; the failure report marks them unknown because it found no matching main jobs. A focused local Bun rerun of both files passed 17/17, which is not evidence that the CI failures are fixed or inherited. Exact-head independent review remains pending.dropReasonselects terminal drop even when another lane adopted, so the alleged orphan path is not reachable. Neither attempt is presented as a clean whole-PR review. No production deployment was used for this PR; the isolated Gateway proof is below.8eb4fe75is below; the pre-fix fleet evidence remains separate.Live evidence (before fix)
Behavior or issue addressed: #182246 — queue-cap drops replay durable ingress.
Before evidence: #182246 (comment)
Live evidence from a deployed fleet, 2026-10-24 03:30–04:30Z, posted at the reporter's request. Discord IDs, session keys and message text are redacted.
Setup
messages.queue.cap = 10,messages.queue.drop = old.turn-abandonedcounts as an attempt; 8 attempts, then dead-letter). On upstreammainthe abandonment path releases the claim without consulting the dead-letter disposition, so the same messages would re-queue indefinitely rather than exhaust. That is the "eventual retry exhaustion" open point.Observed on two hosts
One message's history (seat A). The same
<msg-A>is re-dispatched and abandoned again about every 1–2 min:Ingress rows that reached terminal state in that hour (
channel_ingress_events, statusfailed):retry-limit-exceededrowsturn-abandonedlog lines (1h)03de0ce5d3)7d8a1a91c6)Each dead-lettered row's
last_erroristurn-abandoned. Each loop iteration re-runs the model. Seat B logged 186 abandons against 12 model calls in 16 min, and the agent stayed mute.Attribution caveats
refusing replay: Session actor version changed…. Seat A logged 2 of those against 160 abandons. Seat B logged 0 of them against 244. So seat B's loop is not that race.queue-cap-old/queue-cap-new, plus the source id) would make this attributable in the field. It might be worth adding alongside fix: stop channel messages replaying when reply queue fills #182252.Related review note on #182252: on the Discord path,
onDroppeddoes not survivefanInChannelIngressLifecyclesandcreateInboundDebounceFlush, so Discord drops still fall back toonAbandoned. Details will go on the PR.🌿 frond-scribe, via Claude Code
https://claude.ai/code/session_01Jhynq2GVpzuVQQieebEubg
Live proof (after fix; isolated Gateway)
Exact PR head:
8eb4fe75bba4d4decf2ef906a789673b4a507e80. This is an isolated local Gateway running the bundled Discord channel adapter against a synthetic local Discord provider (Crabline) and a local mock model provider, not a production deployment or a live Discord account. A one-off, uncommitted QA Lab probe used the existingchannel-progress-presentation.e2e.test.tsfixture, held the first model response, and sent syntheticQCAP-RUNNER,QCAP-A, andQCAP-BDiscord messages through the channel ingress endpoint. Each policy had fresh Gateway/SQLite state,messages.queue = { mode: collect, cap: 1, drop: old|new, debounceMsByChannel.discord: 0 }, and inbound debounce 0. The probe released the held response, then checked the SQLite failed ledger, model requests, and Discord outbound writes after settlement.The failed row was terminal exactly once (
attempts: 0) with the dropped source and policy reason; the dropped source did not become a model request. The survivor did become the next model request and received a distinct model reply. Thedrop:newqueue-full notice is counted separately from model replies.Redacted terminal output (all IDs/markers are synthetic; only status, reason, and counts are printed):
The adapter-propagation note in the historical pre-fix comment above describes the original PR revision; the current head includes those adapter fixes. This proof covers Discord old/new policy behavior through an isolated Gateway. It does not claim a real Discord deployment or independent live proof for the Telegram, Feishu, or Slack adapters, which have separate focused tests described above.