Skip to content

fix: auto-reply gateway stalls in a zero-work drain loop after a queue drop policy change - #119331

Merged
steipete merged 3 commits into
openclaw:mainfrom
ml12580:fix/issue-119312
Aug 5, 2026
Merged

steipete merged 3 commits into
openclaw:mainfrom
ml12580:fix/issue-119312

Conversation

@ml12580

@ml12580 ml12580 commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

[AI-assisted] This PR was investigated and implemented with coding-agent assistance, source-blind behavior validation, and the repository autoreview workflow.

Closes #119312

What Problem This Solves

Fixes an issue where a session queue that overflowed under the default summarize policy could stop the entire gateway after the operator changed future drops to old or new. The pending overflow summary became unrenderable, so the drain repeatedly scheduled zero-work passes without yielding to timers, channel ingress, typing keepalives, or transport watchdogs.

The same investigation found three connected outcome gaps in the queue owner: context-isolated summarize deliveries could become count-only prompts, drop: old evictions had no recorded intentional non-outcome, and drop: new incorrectly surfaced the generic temporary-model-failure message.

Reported with a production-path reproduction by @yetval. This PR preserves @ml12580's contributor credit while replacing the earlier transition-reconciliation implementation with a single queue-owner repair.

Why This Change Was Made

A queue's current drop policy controls future admission. Positive dropped counts, source identities, and summary lines describe already-produced overflow work and must remain deliverable until consumed. The old implementation mixed those two responsibilities and stored summary source/content in parallel structures that could lose their association.

This change:

  • renders pending overflow state independently of later admission-policy changes;
  • moves bounded summary content with its exact source identity through context isolation, trimming, abort, retry, and consumption;
  • resolves retained summary lines by source identity rather than queue position;
  • records queue-cap disposition at the enqueue/drop producer and carries it through an internal-only owner callback;
  • reports drop: new as a skipped queue-full outcome with accurate visible text;
  • records later Gateway drop: old eviction as an intentional skipped outcome while preserving durable channel-ingress abandonment/retry behavior.

No config, stored-data schema, protocol, plugin SDK, or public reply API changes.

User Impact

Operators can change queue drop policy after an overflow without wedging the gateway. Pending summaries are delivered once with correctly scoped content, retained queue work continues under the new policy, the queue is deleted, and normal event-loop timers continue running.

A newest-message queue-cap rejection now says the session queue is full instead of blaming a temporary model failure. A previously acknowledged Gateway turn later evicted by drop: old is recorded as an intentional skipped queue outcome rather than disappearing behind an earlier generic completed diagnostic.

Release-note context: prevent process-wide message stalls and misleading or silent queue-drop outcomes after follow-up queue overflow. Reported by @yetval.

Evidence

Before the fix, the issue's production-runtime harness observed 5,001 drain passes in 29 ms, only one real followup call, and a zero-delay timer that never fired.

Source-blind validation of the first repair confirmed responsiveness and policy-transition draining, then found the connected summarize-content, drop: old, and drop: new outcome gaps described above. This exact head addresses each at the queue/admission owner. The exact-head production queue transcript is posted at #119331 (comment).

Focused proof on exact head 095cb4d1158c6b954c1c60a6732d2f88ad33ace3 after rebasing onto current main:

  • Exact-head production queue run: five context-isolated overflow deliveries all included content; the old and new transitions emitted queue-cap-old/queue-cap-new, delivered the retained work, deleted the queue, and let an armed timer fire.
  • node scripts/run-vitest.mjs over queue helpers, collect/dedupe/drain/state, agent-runner admission, dispatch finalization, Gateway chat/session, and embedded TUI suites — 24 unit-fast, 121 Gateway, 90 TUI, 448 auto-reply, and 130 E2E tests passed.
  • The summarize pressure regression queues nine marked messages at cap 3 across five delivery contexts and proves every one of the five overflow deliveries includes correctly scoped content; the shared C-context delivery contains both C sources.
  • The policy-transition regression covers both old and new, exact original order, lifecycle settlement, queue deletion, bounded drain calls, and real timer progress without forced cleanup.
  • Admission/finalization coverage proves drop: new emits the queue-full text, never the temporary-model-failure text, and records outcome=skipped reason=queue-cap.
  • Queue/Gateway coverage proves drop: old emits the source-owned queue-cap-old disposition, retains durable ingress retry behavior, and records the acknowledged Gateway turn as intentionally skipped.
  • node scripts/check-changed.mjs -- <changed files> could not use the configured remote route because Crabbox had no ready provider. The required trusted-source local fallback passed conflict/ratchet, formatting, API, boundary, dead-export, typecheck, lint, state-schema, database-first, sidecar, webhook, auth, and import-cycle checks on the current-main rebase.
  • git diff --check passed.
  • Final Codex-backed branch autoreview at P1: clean, no accepted/actionable findings; overall correctness 0.84. A prior review finding about retained-line positional selection was fixed by resolving each line from its exact source identity, then re-reviewed clean at 0.95.

Production delta is net +81 lines; tests are net +300 lines. The production growth establishes the missing queue ownership boundary: paired source/content state, source-owned terminal queue dispositions, centralized accurate presentation, and Gateway recording. No live operator gateway or user-owned channel was touched.

@openclaw-barnacle openclaw-barnacle Bot added size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Aug 4, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P1 High-priority user-facing bug, regression, or broken workflow. labels Aug 4, 2026
@clawsweeper

clawsweeper Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 5, 2026, 1:13 AM ET / 05:13 UTC.

ClawSweeper review

What this changes

This PR makes auto-reply overflow summaries remain deliverable after later queue drop-policy changes and records queue-cap rejections or evictions accurately.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open. Current main still has the policy-gated summary rendering that can reschedule zero-work queue drains; this PR moves that boundary to the queue owner and has no blocking correctness finding in this review.

Priority: P0
Reviewed head: 095cb4d1158c6b954c1c60a6732d2f88ad33ace3

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent owner-boundary repair with focused regression coverage and direct runtime evidence; refresh it on the rebased merge head.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The PR includes inspectable exact-head runtime output showing corrected summary content, settled old/new transitions, queue retirement, and timer progress.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR includes inspectable exact-head runtime output showing corrected summary content, settled old/new transitions, queue retirement, and timer progress.
Evidence reviewed 5 items Current-main defect remains: Current main refuses to render a positive overflow summary when the live queue policy is no longer summarize; the drain retains that count and schedules again while work remains.
Owner-boundary repair: The PR makes overflow summary state independent of future admission policy and resolves summary text by its retained source identity, avoiding policy-dependent zero-work rendering and cross-context line mismatch.
Boundary regressions: The exact-head tests cover summarize-to-old and summarize-to-new transitions, retained delivery, terminal dispositions, queue removal, and timer progress.
Findings None None.
Security None None.

How this fits together

Auto-reply queues serialize follow-up agent work for a session. Queue admission and overflow-summary draining feed reply dispatch and Gateway chat state, which must either deliver a result or record an intentional skipped outcome.

flowchart LR
  Turn[Incoming turn] --> Queue[Session follow-up queue]
  Queue --> Policy[Admission and drop policy]
  Policy --> Summary[Overflow summary state]
  Summary --> Drain[Queue drain]
  Drain --> Dispatch[Reply and Gateway dispatch]
  Dispatch --> Outcome[Delivered or recorded outcome]
Loading

Before merge

  • Resolve merge risk (P1) - The branch is behind current main; refresh the focused queue, Gateway, and embedded-TUI proof on the rebased merge head before landing.
  • Complete next step (P2) - This active PR already owns the repair; the remaining action is an exact-merge-head proof refresh, not an automated replacement fix.
Agent review details

Security

None.

PR surface

Source +123, Tests +258. Total +381 across 22 files.

View PR surface stats
Area Files Added Removed Net
Source 13 150 27 +123
Tests 9 269 11 +258
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 22 419 38 +381

Review metrics

Metric Value Why it matters
Production versus regression coverage production +81, tests +300 The production growth establishes a queue-owner boundary for source-aligned summaries and terminal queue-cap facts, with substantial regression coverage for the connected delivery paths.

Stored data model

Persistent data-model change detected: serialized state: src/auto-reply/reply/queue/state.test.ts, serialized state: src/auto-reply/reply/queue/state.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Rebase and refresh queue proof (recommended)
    Rebase onto current main, rerun focused queue, Gateway, and embedded-TUI coverage on that head, then request one exact-head review.

Technical review

Best possible solution:

Land the shared queue-owner repair after rebasing onto current main and confirming the exact merge head preserves bounded draining, source-aligned summaries, and producer-owned queue-cap outcomes.

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

Yes, at source level: current main has the policy-gated renderer and unconditional pending-work reschedule, while the PR provides an exact-head queue-runtime transcript for the same overflow then policy-transition sequence.

Is this the best way to solve the issue?

Yes. Separating already-produced summary state from future admission policy at the shared queue owner is better than discarding it later in the drain or adding a retry cap, both of which would either lose valid work or mask the producer-state defect.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 75ef5aebecb8.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR includes inspectable exact-head runtime output showing corrected summary content, settled old/new transitions, queue retirement, and timer progress.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR includes inspectable exact-head runtime output showing corrected summary content, settled old/new transitions, queue retirement, and timer progress.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P0: The pre-fix path can starve the Gateway event loop and stop process-wide message handling until restart.
  • merge-risk: 🚨 message-delivery: The patch changes overflow delivery and user-visible outcomes for rejected or evicted queued messages.
  • merge-risk: 🚨 availability: The queue drain controls timer and ingress progress, so a regression could again stall the Gateway runtime.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR includes inspectable exact-head runtime output showing corrected summary content, settled old/new transitions, queue retirement, and timer progress.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR includes inspectable exact-head runtime output showing corrected summary content, settled old/new transitions, queue retirement, and timer progress.

Evidence

What I checked:

  • Current-main defect remains: Current main refuses to render a positive overflow summary when the live queue policy is no longer summarize; the drain retains that count and schedules again while work remains. (src/utils/queue-helpers.ts:310, 75ef5aebecb8)
  • Owner-boundary repair: The PR makes overflow summary state independent of future admission policy and resolves summary text by its retained source identity, avoiding policy-dependent zero-work rendering and cross-context line mismatch. (src/utils/queue-helpers.ts:11, 095cb4d1158c)
  • Boundary regressions: The exact-head tests cover summarize-to-old and summarize-to-new transitions, retained delivery, terminal dispositions, queue removal, and timer progress. (src/auto-reply/reply/queue.drain-restart.test.ts:569, 095cb4d1158c)
  • Regression provenance: Blame ties the current-main policy gate to commit 8f2850d; the PR branch replaces that gate with a count-only summary contract. (src/utils/queue-helpers.ts:310, 8f2850d83e90)
  • Exact-head behavior proof: The posted runtime transcript for the reviewed head shows five context-isolated summaries with content, both old/new transitions settling, queue cleanup, and an armed timer firing. (095cb4d1158c)

Likely related people:

  • steipete: Authored all three repair commits and has the strongest history footprint in follow-up queue draining and enqueue logic. (role: recent queue-area contributor; confidence: high; commits: 1d570d3f1ff3, 5a1aad89acb6, 095cb4d1158c; files: src/auto-reply/reply/queue/drain.ts, src/auto-reply/reply/queue/enqueue.ts, src/utils/queue-helpers.ts)
  • vincentkoc: Blame attributes the current policy-gated summary condition and surrounding queue admission logic to commit 8f2850d. (role: current-main behavior author; confidence: high; commits: 8f2850d83e90; files: src/utils/queue-helpers.ts, src/auto-reply/reply/queue/enqueue.ts)
  • Ayaan Zaidi: Recent history on the reply finalization path includes delivery-fallback and terminal-outcome work that this patch extends for queue-cap outcomes. (role: adjacent dispatch contributor; confidence: medium; commits: 7c4291040c, fae44d949c, e6e0f52aa8; files: src/auto-reply/reply/dispatch-from-config.finalize.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Rebase onto current main and rerun the posted focused queue, Gateway, and embedded-TUI proof against the resulting exact head.

Rating scale

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

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

Workflow

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

History

Review history (12 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-04T23:06:21.900Z sha 14526f88c1d0e582d14f07511972a6c85791113e :: needs changes before merge. :: [P1] Propagate deferred-retry state to compact summary sources
  • reviewed 2026-08-04T23:13:33.269Z sha 14526f88c1d0e582d14f07511972a6c85791113e :: needs changes before merge. :: [P1] Propagate deferred-retry state to compact summary sources
  • reviewed 2026-08-05T00:04:04.194Z sha b0b4abe03e69720761f1b5d5401229b06bf32673 :: needs changes before merge. :: [P1] Reconcile retained summaries after their delivery settles | [P2] Reconcile every surviving local queue on policy changes
  • reviewed 2026-08-05T00:11:08.290Z sha b0b4abe03e69720761f1b5d5401229b06bf32673 :: needs changes before merge. :: [P1] Reconcile retained summaries after an active attempt settles | [P2] Apply TUI policy changes before rejecting a new message
  • reviewed 2026-08-05T02:06:23.698Z sha 1e280cc4e3c5725a8f25ac771fd67de989536000 :: needs changes before merge. :: [P1] Propagate deferred state to compacted sources
  • reviewed 2026-08-05T03:18:15.577Z sha 13110081850da0e43b6c9e32f30d08a6c68698d6 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-05T03:25:06.277Z sha 13110081850da0e43b6c9e32f30d08a6c68698d6 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-05T04:30:54.989Z sha 095cb4d :: needs real behavior proof before merge. :: none

@ml12580

ml12580 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Addressed the P2 finding: moved orphaned summary accounting cleanup from the drain guard into the policy-transition owner (getFollowupQueue in src/auto-reply/reply/queue/state.ts), so a non-summarize queue never advertises undeliverable pending work to any reader (drain, hasPendingFollowupQueueWork, session compaction). The drain is now focused on valid, renderable pending work. Added owner-level regression coverage in state.orphaned-summary.test.ts; retained the bounded-drain end-to-end test. Real-runtime proof after the move: droppedCount is cleared at the flip (afterFlip droppedCount=1 -> 0), drainCycles 5001 -> 3.

@clawsweeper

clawsweeper Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Aug 4, 2026
@ml12580

ml12580 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Both findings addressed:

  1. [P1] Active summary sources preserved: discardOrphanedFollowupQueueSummary now retains sources in activeSummarySources (in-flight runQueueSummaryDelivery) and only completes orphaned non-active sources; droppedCount is reduced by the discarded count, leaving the active delivery's count as legitimate pending work that the delivery itself decrements when it settles. Added regression state.orphaned-summary.test.ts > preserves summary sources whose async delivery is in flight during a policy flip (gates the summary delivery, flips policy mid-flight, asserts the active source is retained and the queue settles after delivery completes without admission throwing).

  2. [P2] TUI sibling reconciled: enqueuePendingLocalMessage in src/tui/embedded-backend.ts discards inherited droppedCount/summaryLines at the overflow-queue owner when the resolved dropPolicy is non-summarize, so a later switch back to summarize cannot render stale drops. TUI queue has no summarySources/activeSummarySources and no drain loop, so no active-delivery concern there. pnpm test -- src/tui/embedded-backend 88/88 passed.

@clawsweeper

clawsweeper Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 4, 2026
@ml12580

ml12580 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Both remaining findings addressed:

  1. [P1] Deferred-retry distinguished from in-flight delivery: runQueueSummaryDelivery now marks sources it carries over in activeSummarySources after a deferred-before-admission failure into a new deferredRetrySummarySources WeakSet (drain.ts finally). discardOrphanedFollowupQueueSummary (state.ts) preserves only sources that are in activeSummarySources AND NOT in deferredRetrySummarySources (genuinely in-flight); deferred-retry carryover is discarded so a policy flip during a deferred retry cannot resume the zero-work loop. Regression: state.orphaned-summary.test.ts > discards deferred-retry carryover (not in-flight) when the policy flips (verified to fail when the distinction is disabled). The existing in-flight-delivery test still passes (preserve genuinely in-flight sources).

  2. [P2] Surviving TUI collect target reconciled: enqueuePendingLocalMessage now also clears an existing collect target queue's droppedCount/summaryLines when its dropPolicy is set to non-summarize (not just the temporary overflowQueue). pnpm test -- src/tui/embedded-backend 88/88 passed.

All local checks green: tsgo:core, tsgo:core:test, format, lint, 46 queue+helpers tests, 88 TUI tests, 6 orphaned-summary regression tests. Real-runtime proof unchanged: drainCycles 5001 -> 3, droppedCount 1 -> 0 at the flip.

@clawsweeper

clawsweeper Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@ml12580

ml12580 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

P1 finding addressed: elision compaction now propagates deferred-retry state to compact clones.

enqueueFollowupRun (enqueue.ts) creates a compact clone via createOverflowSummaryRetrySource when summary sources overflow the summary-lines cap. It previously copied only activeSummarySources membership to the clone; it now also copies deferredRetrySummarySources membership, so a deferred-retry carryover clone stays discardable (the transition cleanup no longer misclassifies it as a genuinely in-flight delivery).

Regression: state.orphaned-summary.test.ts > propagates deferred-retry state to compact summary sources during elision compaction (triggers compaction with a deferred-retry-marked source, flips policy, asserts the compact clone is cleared; verified to fail when propagation is disabled).

All local checks green: tsgo:core, tsgo:core:test, format, lint, 7 orphaned-summary regression tests, 46 queue+helpers tests, 88 TUI tests. Real-runtime proof unchanged: drainCycles 5001 -> 3.

@clawsweeper

clawsweeper Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 5, 2026
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: M and removed size: S labels Aug 5, 2026
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

Please review exact head 095cb4d1158c6b954c1c60a6732d2f88ad33ace3. The branch is rebased on current main and now covers the original zero-work drain plus the source-blind follow-up findings: context-scoped summary content, source-identity line alignment, recorded drop: old non-outcomes, accurate drop: new queue-full presentation, lifecycle cleanup, timer progress, and Gateway/TUI siblings. Final P1 autoreview is clean; the PR body contains the focused proof and production/test LOC.

@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P1 High-priority user-facing bug, regression, or broken workflow. labels Aug 5, 2026
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Exact-head production queue proof for 095cb4d1158c6b954c1c60a6732d2f88ad33ace3.

I ran the real queue producer, runtime policy mutation, detached drain, summary renderer, queue cleanup, and timer scheduling from the exact PR checkout. The harness used synthetic messages and a recording follow-up callback; it did not touch an operator Gateway, live channel, credentials, or user state.

Command:

OPENCLAW_TEST_FAST=1 node --import tsx /tmp/openclaw-queue-proof.mts

Observed output:

{
  "exactHead": "095cb4d1158c6b954c1c60a6732d2f88ad33ace3",
  "summarize": {
    "overflowCount": 5,
    "everyOverflowHasContent": true,
    "overflow": [
      "[Queue overflow] Dropped 1 message due to cap.\nSummary:\n- dropped A",
      "[Queue overflow] Dropped 1 message due to cap.\nSummary:\n- dropped B",
      "[Queue overflow] Dropped 2 messages due to cap.\nSummary:\n- dropped C1\n- dropped C2",
      "[Queue overflow] Dropped 1 message due to cap.\nSummary:\n- dropped D",
      "[Queue overflow] Dropped 1 message due to cap.\nSummary:\n- dropped E"
    ],
    "survivorsDelivered": true,
    "queueSettled": true
  },
  "transitions": [
    {
      "dropPolicy": "old",
      "accepted": true,
      "dispositions": ["second:queue-cap-old"],
      "delivered": [
        "[Queue overflow] Dropped 1 message due to cap.\nSummary:\n- first overflowed message",
        "third queued message"
      ],
      "queueSettled": true,
      "timerFired": true
    },
    {
      "dropPolicy": "new",
      "accepted": false,
      "dispositions": ["third:queue-cap-new"],
      "delivered": [
        "[Queue overflow] Dropped 1 message due to cap.\nSummary:\n- first overflowed message",
        "second queued message"
      ],
      "queueSettled": true,
      "timerFired": true
    }
  ]
}

This exact-head run proves the previously bare context-isolated overflow deliveries now carry content, both policy transitions settle without forced cleanup, the retained item is delivered, the dropped/rejected item receives its producer-owned disposition, and an armed timer progresses.

@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

Exact head remains 095cb4d1158c6b954c1c60a6732d2f88ad33ace3. The requested inspectable production-path proof is now posted at #119331 (comment) and linked from the PR body. It shows all five context-isolated summaries carrying content, old/new queue-cap dispositions, retained delivery, queue retirement, and timer progress on the exact head.

@clawsweeper

clawsweeper Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

@clawsweeper review

Please refresh the durable verdict for exact head 095cb4d1158c6b954c1c60a6732d2f88ad33ace3 against the new production-path proof at #119331 (comment). The previous verdict's sole rank-up move requested this exact artifact; the PR body now links it.

@clawsweeper

clawsweeper Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 5, 2026
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Skipping the optional rebase rank-up move. Exact head 095cb4d1158c6b954c1c60a6732d2f88ad33ace3 is mergeable, exact-head CI and the posted production proof are green, and the five commits by which main advanced are unrelated to the queue invariant. Rebasing solely for moving-main drift would invalidate the immutable exact-head review and proof without improving this fix.

@steipete
steipete merged commit ae41dce into openclaw:main Aug 5, 2026
153 of 172 checks passed
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 5, 2026
…e drop policy change (openclaw#119331)

* fix(auto-reply): preserve pending overflow summaries

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

* fix(auto-reply): record queue cap outcomes

* fix(auto-reply): align summary lines with sources

---------

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

Labels

gateway Gateway runtime merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] auto-reply queue: gateway stops sending and receiving in an endless zero-work drain loop after a queue drop policy change

2 participants