Skip to content

fix(ui): let operators dismiss retired pending inputs - #180871

Merged
steipete merged 7 commits into
openclaw:mainfrom
ceckert:ceckert/pending-input-discard
Oct 25, 2026
Merged

steipete merged 7 commits into
openclaw:mainfrom
ceckert:ceckert/pending-input-discard

Conversation

@ceckert

@ceckert ceckert commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Closes #134887

What Problem This Solves

Interrupted and cancelled inputs stay in the chat indefinitely, with no shared way to dismiss them.

User Impact

Writers can dismiss one retired input or all retired inputs on the displayed page. Dismissal persists across viewers, reloads, and restarts. Queued or still-settling inputs cannot be dismissed. Content and attachments remain stored; the retained cancelled receipt prevents another client from replaying the input as a new turn.

Why This Change Was Made

Both queued-input withdrawal and retired-input dismissal now use the existing withdrawal host, worker operation, and tombstone transaction. This removes the proposed second storage path and worker registration. The RPC uses the existing own-session write authority, rechecked at commit; view-only and incognito callers are refused. UI updates remain scoped to the original connection, while conversation switches on that connection still settle the correct outbox copies.

No database migration or new configuration is required. Thanks to @ceckert (Chris Eckert) for the implementation and original behavior evidence; the contributor commits are preserved.

Evidence

Current-main regression: the registered dismissal request returned FORBIDDEN/MISSING_SCOPE because the method was absent. The same test now succeeds and verifies hidden history, retained content, cancelled receipts, and the change event. Focused tests also cover queued/settling refusal, stale sessions, revoked authority, lost worker-result recovery, and outbox reconciliation.

Focused validation passed: 7 store cases, 7 withdrawal cases, 5 registered-RPC cases, 5 incognito cases, 40 send-recovery cases, 2 memory-continuation cases, 4 attachment-authority cases, and 74 UI cases. The reconnect regression failed before the connection-owner repair and passed afterward. Targeted core/UI lint, stylelint, formatting, i18n checks, and protocol generation passed. After integrating current main, the 5 registered-RPC cases and both lost-result recovery cases passed again. Independent review found no actionable P0–P2 findings, including the CI fixture repair. CI found an obsolete test-only send state; the fixture now uses the current reconnect state and all 13 dismissal cases pass (5.86 seconds wall). Local broad typechecks were unavailable because shared-install declaration inputs escape this checkout; exact-head CI supplies broad proof. Current-head real-provider/restart testing was not repeated: this operation does not invoke a model, and the current proof uses the registered RPC with the real database worker plus the existing synthetic Gateway browser harness. Earlier contributor live artifacts are prior-head evidence.

Size: production +655/−111 (net +544), tests +1059/−61 (net +998), docs net +1, plus regenerated protocol predicates and worker inventory. Production growth is 216 lines smaller than the original proposal after removing the duplicate worker. The remaining growth implements the RPC, live authority checks, and controls.

Before:

Retired inputs without dismissal controls

After:

Retired inputs with individual and bulk dismissal controls

After Dismiss all:

Conversation after the retired inputs have been dismissed

Final-head CI investigation: the prior streaming-Markdown failure matches scheduled main run 40165856223 (job 121086751738): the same deferred-formatting assertion observes two DOM mutations instead of zero. The terminal-delivery notice mismatch also reproduces through the real QA Gateway and mock model on main 4dfd92b (244.33s Vitest; 668.07s wrapper), at agent-terminal-delivery.e2e.test.ts:337. Neither failure is claimed fixed by this PR.

On the final head, CI run 40169292853 also reports an unhandled Configuration temporarily unavailable rejection in skill-workshop-page.test.tsx:125 (job 121097055792). The unchanged test reproduces identically on main 4dfd92b: 12 assertions pass, but the wrapper correctly fails on the unhandled rejection (17.37s). Final-head terminal-delivery job 121097056619 has the identical main-reproduced notice mismatch described above. These unrelated failures remain visible; neither is claimed fixed here.

Final CI run 40169292853 completed with those two main-reproduced test failures; PostgreSQL conformance passed. The aggregate CI gate remains red. The security-sensitive descriptor gate also awaits its required maintainer approval; this PR does not claim that approval.

@clawsweeper

clawsweeper Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

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

View the workflow run.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

✅ Maintainer security changes approved

A maintainer approved this revision with an explicit security approval comment.

A later push requires a fresh approval comment for an external contributor's PR.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime size: XL labels Oct 22, 2026
@clawsweeper clawsweeper Bot added the clawsweeper:intake:feature Preliminary submission classification; full source review pending. label Oct 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

Adds individual and page-wide dismissal of interrupted or cancelled chat inputs while preserving stored content and cancellation receipts.

Example: A conversation retains interrupted “Draft the release notes” and cancelled “Rename the staging bucket” inputs.

  • Before: Both inputs remain visible without dismissal controls.
  • After: A writer can dismiss either input or both displayed inputs; their stored content and replay protection remain.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation is coherent and the earlier defects are addressed, but supplied production-entry proof does not exercise the current storage owner.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Retired inputs accumulate in conversations without an in-product dismissal action.
Reason: Multiple release reports establish user value, and the feature-history owner's repair explicitly adopts the existing tombstone mechanism while preserving contributor work.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep open: this PR addresses a reported, still-unfixed chat problem, preserves the existing storage owner, and resolves the earlier findings; no new actionable code defect was found.

Priority: P2
Reviewed head: b624a81a1c988a6aeb6366d7bda937451ab4c295

Before merge

  • Add real behavior proof - Inspected screenshots demonstrate the controls, and current registered-RPC/real-worker tests exercise dismissal and authorization, but the supplied live Gateway evidence predates the replacement storage owner. The PR owner should attach redacted current-implementation output showing dismissal, persistence after reload/restart, retained content and cancellation receipts, and forbidden-caller refusal. Latest-stable upgrade compatibility remains unproven; current fixtures are created by current code despite the unchanged stored format. Redact credentials, personal data, IPs, and non-public endpoints. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Await maintainer action - A maintainer must review and approve the security-sensitive changes for revision b624a81.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

None.

Tests

  • Missing end-to-end proof: Provide a current served-Gateway dismissal trace covering reload/restart persistence, retained content and receipts, forbidden-caller refusal, and an upgrade from the latest stable release.
Agent review details

How this fits together

The Control UI sends selected pending-input IDs to a session-authorized Gateway RPC, which uses the existing withdrawal worker to hide retired records and returns receipts for browser reconciliation.

flowchart LR
  A[Chat dismissal controls] --> B[Gateway RPC]
  B --> C[Live session authority]
  C --> D[Existing withdrawal worker]
  D --> E[Retained SQLite records]
  D --> F[Dismissal receipts]
  F --> G[Browser outbox reconciliation]
Loading

Technical review

Best possible solution:

Complete shared dismissal through the existing withdrawal owner, retaining content, replay receipts, active-input protection, and connection-scoped reconciliation.

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

Release reports and current-main source establish that interrupted and cancelled inputs remain visible without general dismissal; no target code was executed during this review.

Is this the best way to solve the issue?

Reusing withdrawal is the smallest coherent implementation: one transaction owns tombstones and receipts, while existing session authority and browser owners retain their responsibilities.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Pending-input withdrawal and replay protection keeps the original intent (366d2c5: Explicit queued-message removal hides content without deleting custody or losing replay protection.)
  • Worker receipt settlement keeps the original intent (c4e496e: Consolidate worker preparation and native receipt settlement while preserving accepted-write outcomes.)
  • Pending-input presentation and recovery notices keeps the original intent (fix: preserve steering across reconnects and show queued input #157135: Separate queued inputs from ordinary transcript messages and retain recovery behavior across reconnects.)
  • Solid chat rendering keeps the original intent (93e4b56: Render chat notices directly in Solid while preserving existing presentation owners and callbacks.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 366d2c5 adds src/config/sessions/session-pending-input-withdrawal.worker.ts:27 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 366d2c59b069; files: src/config/sessions/session-pending-input-withdrawal.worker.ts)
  • RoboClaw: Raw commit 0d4037e adds ui/src/pages/chat/chat-system-notice.ts:49 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 0d4037eea541; files: ui/src/pages/chat/chat-system-notice.ts)

PR surface

Source +575, Tests +998, Docs +19. Total +1592 across 37 files. Added test files: 4.

View PR surface stats
Area Files Added Removed Net
Source 27 6428 5853 +575
Tests 7 1059 61 +998
Docs 3 155 136 +19
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 37 7642 6050 +1592

Review metrics

Metric Value Why it matters
Production versus test growth Production +655/−111; tests and test support +1059/−61 Excludes regenerated artifacts; growth supplies the RPC, shared withdrawal selection, UI controls, and distinct authorization, settlement, and reconciliation coverage.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #134887
Summary: This PR addresses the canonical missing-dismissal report; the older queue-presentation proposal overlaps but has different persistence semantics.

Members:

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

Labels

Label changes:

  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Label justifications:

  • P2: Persistent retired-input clutter affects normal chat use without establishing blocked messaging or an unusable first-run workflow.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rank-up moves

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

  • Attach a redacted served-Gateway trace through the current withdrawal owner, including persistence, forbidden-caller refusal, and latest-stable upgrade preservation.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (3 earlier review cycles)
  • reviewed 2026-10-22T18:37:49.452Z sha 47cecefb0fce228da9695cd8c012f91052c4cd4e :: needs real behavior proof before merge. :: [P2] Retire browser copies for every input discarded by the bulk request | [P2] Gate both discard controls on session-write access
  • reviewed 2026-10-22T21:38:27.542Z sha 8b4d800 :: blocked before merge. :: none
  • reviewed 2026-10-25T06:25:10.108Z sha e8f3773 :: needs real behavior proof before merge. :: none

Reviewed October 25, 2026, 2:37 AM ET / 06:37 UTC (Revision 4).

@ceckert
ceckert force-pushed the ceckert/pending-input-discard branch from 47cecef to f39609d Compare October 22, 2026 20:30
@ceckert ceckert changed the title fix(ui): let operators discard retired pending inputs fix(ui): let operators dismiss retired pending inputs Oct 22, 2026
@ceckert
ceckert force-pushed the ceckert/pending-input-discard branch 2 times, most recently from f39609d to 666904f Compare October 22, 2026 21:23
@ceckert
ceckert force-pushed the ceckert/pending-input-discard branch from 666904f to 8b4d800 Compare October 22, 2026 21:28
@ceckert

ceckert commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Revised per the owner decision: dismissal is now a tombstone (interrupted/cancelled rows become cancelled + hidden, exactly like the queued-input withdrawal; nothing is deleted, receipts stay, no schema change). Both findings are addressed (outbox copies retired by the Gateway's returned runIds; controls gated on session write access and now also hidden for sharingRole viewer). Real Gateway/worker proof added to the body: persistence across reload and restart, off-page browser copy not resent, and refusals for read-only, sessions-write-not-owner, queued input, revoked and view-only callers with sqlite unchanged. The security-review guard still needs a maintainer's command.

@ceckert

ceckert commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 22, 2026
@roboclaw-bot roboclaw-bot added the clawtributors PR from a clawtributor label Oct 23, 2026
Retain message content and cancelled input receipts while permanently hiding retired inputs. Reuse the existing withdrawal transaction and worker receipt settlement, and keep queued or settling inputs protected.

Repair the Control UI integration against current main and fence late outbox settlement to its original connection. Preserve the contributor history from openclaw#180871 and cover the registered RPC, authority rollback, lost worker results, and connection replacement.
@steipete

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the clawsweeper:intake:feature Preliminary submission classification; full source review pending. label Oct 25, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 25, 2026
@steipete

Copy link
Copy Markdown
Contributor

/allow-security-sensitive-change

@steipete

Copy link
Copy Markdown
Contributor

/allow-security-sensitive-change

@steipete

Copy link
Copy Markdown
Contributor

/allow-security-sensitive-change

steipete added a commit that referenced this pull request Oct 25, 2026
An explicit cron run reads its authorized job definition and private scratch separately inside a SQLite read transaction. Read both in one dialect-layer LEFT JOIN so they share a statement snapshot, removing three SQL statements per SQLite run without another worker request.

The job reader keeps its all-column authorization relation, ordered narrow projection, exact returned-ID check, existing decoder/config revision and legacy creation fallback. Missing scratch still reports revision 0; deletion keeps its revision tombstone. The standalone maintenance reader remains. No schema, cache, write, receipt, claim-before-effect, delivery authority, FIFO or 64-receipt retention change.

PostgreSQL retains the shared reader's outer read-only transaction and rollback: its exact-job read is 4→3 SQL, not 4→1. SQLite exact-job is 4→1, heartbeat 3→1; PostgreSQL heartbeat remains 3→3. Accepted noncontract edges: an absent/malformed job can now require scratch SELECT privilege, and malformed job plus unsafe numeric scratch can reject the numeric data first. These do not remove the existing caller/source/cancellation checks.

The production delta is +3 lines: one joined query replaces the transaction and duplicate read while sharing NULL handling with heartbeat. Existing test files cover read-after-write, tombstones, missing jobs/monitors and both database engines. No new suite or runner is added.

Acceptance was registered before measurement: the committed `scripts/bench-cron-run.mts` drives signed WebSocket `cron.run` against an isolated synthetic Gateway/provider, once cold and twice warm. Each run must produce one start, one finish, one Responses request and exact-run history verification. Compare execution, history verification and settlement separately and together, plus shutdown and the entire invocation. The scratch owner must fall from 4→1 SQL with 1 request and 0 MAIN throughout; no cost may be deferred outside the run. Keep cold/warm separate and report median/p95/range. Three same-platform alternating pairs when calm, or one pair plus source attribution under campaign load. Counts and profiles make no latency/CPU-speed claim; timing claims require the timing lock, load below 24 and ≥5 alternating samples per arm. A 20% user-facing regression stops acceptance. Delivery mode none does not claim an external-send proof.

The same-platform explicit comparison (baseline 814e732, candidate 93a6c4) gives:

| SQL / requests / MAIN | Baseline | Candidate |
| --- | --- | --- |
| Cold execution + verification + settlement | 257 / 80 / 0 | 254 / 78 / 0 |
| Warm 1 | 247 / 64 / 0 | 235 / 60 / 0 |
| Warm 2 | 252 / 61 / 0 | 245 / 65 / 0 |
| Warm median | 249.5 / 62.5 / 0 | 240 / 62.5 / 0 |
| Warm descriptive p95 | 252 / 64 / 0 | 245 / 65 / 0 |
| Warm range | 247–252 / 61–64 / 0 | 235–245 / 60–65 / 0 |
| Shutdown | 22 / 6 / 5 | 40 / 10 / 5 |
| Whole invocation | 1383 / 356 / 58 | 1369 / 352 / 58 |

Each of the three runs completed one start, finish, Responses request and exact history verification. The scratch owner is exactly 4/1/0 → 1/1/0 in every run, all in its execution phase, with no extra or deferred scratch requests. All execution/verification/settlement phases are SQL-error-free and runtime MAIN remains zero. The count comparison is diagnostic, not an error-free full invocation: the frozen analyzer rejects two failed shutdown `state_leases` DELETEs (`database is locked`). Shutdown exceeds the 20% stop threshold; it was stopped and explicitly accepted by the coordinator as inherited after an independent main shutdown-lock reproduction. The separate SHUTDOWNLOCK lane owns that repair. The scratch join changes no lease code or writes. No latency or CPU-speed claim is made.

The frozen 3.1.5 standard workload is a different scheduled `cron.add` flow: three valid baselines gave 06.cron 231/62/0, 235/65/0, 233/63/0 (median 233/63/0), versus ordinary warm 45/12/0. The descriptive excess is 188 SQL/51 requests, not causal subtraction. One extra standard setup aborted before any Gateway; it supplies no performance evidence. The existing scratch source is identical across that baseline and the explicit baseline. Full current-standard delta is deferred to the next census.

Validation: count regression red on baseline (2 SELECTs and BEGIN/COMMIT), all 17 scratch-store tests green on the candidate; two isolated Codex P0–P2 reviews scoped-clean. The existing two-engine conformance test passed on actual SQLite and PostgreSQL 17, with catalog/trigger parity and cleanup verified. Test cost: scratch cases totaled 6.528 s (125.95 s file duration, mostly transform); the two engine cases totaled 1.846 s (260.62 s file duration, mostly transform). The candidate build and official source-freshness check passed at measured runtime head 93a6c4d; the three-sample invocation completed with the shutdown limitation above. Exact-head CI run 40176443806 completed successfully: 39 successful jobs, 26 skipped, no failures, including all three actual PostgreSQL shards, production/test types, lint, source contracts, Madge, and worker/T1/dialect ratchets. The earlier run passed types, lint and source contracts but found a worker-inventory omission: the new direct query was conservatively labeled T1. Head a187ecf corrects only inventory metadata and regenerates its snapshot: the worker snapshot and its private heartbeat helper are W, while the native Doctor reader stays T3. No runtime or SQL change is involved. The generated snapshot also catches up existing main classifications; targeted script lint and formatting pass. The two production reviews remain valid; this tooling-only correction adds no production review round. PG review approved the semantics at 68c24c4, and the coordinator explicitly carried REVIEW-OK to 93a6c4d because only benchmark TypeScript annotations changed. Candidate counts and the inherited-shutdown disposition are recorded; the corrected head’s CI and all three PG shards passed. The test-only import relocation avoids another open PR's adjacent import change; production bytes remain identical to both isolated reviews and database proof. The benchmark annotations fix CI TS7022 without changing emitted behavior.

Final-head overlap at a187ecf: complete shared-index base-versus-candidate merge-tree comparison covers 21 peers (#183410, #183285, #181057, #180871, #180286, #180139, #169241, #168956, #168615, #167546, #167471, #165039, #161997, #157922, #157693, #156613, #141004, #137788, #136476, #129388, #121204). No new source conflict paths, regions or messages. Six peers (#181057, #180871, #180139, #169241, #129388, #121204) have added or changed conflicts confined to the fully generated worker inventory. The coordinator explicitly accepted this class because main's snapshot was stale and generated outputs must be regenerated, not hand-edited. The same exact-head disposition carries PG REVIEW-OK because runtime bytes are unchanged. Exact-head CI and all three PostgreSQL shards passed.

PG checklist: (1) read-only; existing writer transaction/advisory-lock, DML/conflict and cross-store commit ordering unchanged. (2) At most one joined row via the existing composite primary keys, original job fields plus four scratch fields, unchanged 256 KiB scratch write bound. (3) No cache/generation or invalidation change; one statement snapshot, existing outer PG read transaction retained. (4) No schema/admission/identity/retry/probe change. (5) Same worker owner, one request, no MAIN expansion; target 4→1 SQL in all three real Gateway runs, with the inherited shutdown failure disclosed above. (6) Actual PostgreSQL 17 and SQLite owner conformance passed; all three final-head PostgreSQL CI shards and the other selected static checks passed.

Knip was run separately because ordinary PR CI excludes it. The canonical candidate export scan failed with 26 script, 20 production and 16 full-tree findings; none is in a changed file. All 62 occurrences (52 unique file/symbol pairs), scanner/config/compiler inputs and package inputs are unchanged from merge-base dada70f. The only removed imports, runSqliteReadSnapshotSync and loadCronRows, both retain multiple real production consumers. Current-main diagnostic sections reported 14 script and 7 production findings; main has already repaired 40 candidate occurrences in unrelated changes. Its separate full-tree scan was intentionally stopped after the coordinator accepted the source-attributed inherited findings; it is not a passing full-main scan. No ignored exports, baselines or unrelated code were changed. The failed candidate scan is explicitly accepted as inherited; all branch changes and selected CI static checks pass.

Pre-merge shared-index refresh retains 17 open peers from that audit. Only #180871 moved (f140f16); its fresh base-versus-candidate comparison still adds conflicts solely in the generated worker inventory, within the coordinator-accepted class. No new source conflicts.

Co-authored-by: Peter Steinberger <[email protected]>
@steipete

Copy link
Copy Markdown
Contributor

/allow-security-sensitive-change

@steipete
steipete merged commit 67ab984 into openclaw:main Oct 25, 2026
154 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 26, 2026
An explicit cron run reads its authorized job definition and private scratch separately inside a SQLite read transaction. Read both in one dialect-layer LEFT JOIN so they share a statement snapshot, removing three SQL statements per SQLite run without another worker request.

The job reader keeps its all-column authorization relation, ordered narrow projection, exact returned-ID check, existing decoder/config revision and legacy creation fallback. Missing scratch still reports revision 0; deletion keeps its revision tombstone. The standalone maintenance reader remains. No schema, cache, write, receipt, claim-before-effect, delivery authority, FIFO or 64-receipt retention change.

PostgreSQL retains the shared reader's outer read-only transaction and rollback: its exact-job read is 4→3 SQL, not 4→1. SQLite exact-job is 4→1, heartbeat 3→1; PostgreSQL heartbeat remains 3→3. Accepted noncontract edges: an absent/malformed job can now require scratch SELECT privilege, and malformed job plus unsafe numeric scratch can reject the numeric data first. These do not remove the existing caller/source/cancellation checks.

The production delta is +3 lines: one joined query replaces the transaction and duplicate read while sharing NULL handling with heartbeat. Existing test files cover read-after-write, tombstones, missing jobs/monitors and both database engines. No new suite or runner is added.

Acceptance was registered before measurement: the committed `scripts/bench-cron-run.mts` drives signed WebSocket `cron.run` against an isolated synthetic Gateway/provider, once cold and twice warm. Each run must produce one start, one finish, one Responses request and exact-run history verification. Compare execution, history verification and settlement separately and together, plus shutdown and the entire invocation. The scratch owner must fall from 4→1 SQL with 1 request and 0 MAIN throughout; no cost may be deferred outside the run. Keep cold/warm separate and report median/p95/range. Three same-platform alternating pairs when calm, or one pair plus source attribution under campaign load. Counts and profiles make no latency/CPU-speed claim; timing claims require the timing lock, load below 24 and ≥5 alternating samples per arm. A 20% user-facing regression stops acceptance. Delivery mode none does not claim an external-send proof.

The same-platform explicit comparison (baseline 814e732, candidate 93a6c4) gives:

| SQL / requests / MAIN | Baseline | Candidate |
| --- | --- | --- |
| Cold execution + verification + settlement | 257 / 80 / 0 | 254 / 78 / 0 |
| Warm 1 | 247 / 64 / 0 | 235 / 60 / 0 |
| Warm 2 | 252 / 61 / 0 | 245 / 65 / 0 |
| Warm median | 249.5 / 62.5 / 0 | 240 / 62.5 / 0 |
| Warm descriptive p95 | 252 / 64 / 0 | 245 / 65 / 0 |
| Warm range | 247–252 / 61–64 / 0 | 235–245 / 60–65 / 0 |
| Shutdown | 22 / 6 / 5 | 40 / 10 / 5 |
| Whole invocation | 1383 / 356 / 58 | 1369 / 352 / 58 |

Each of the three runs completed one start, finish, Responses request and exact history verification. The scratch owner is exactly 4/1/0 → 1/1/0 in every run, all in its execution phase, with no extra or deferred scratch requests. All execution/verification/settlement phases are SQL-error-free and runtime MAIN remains zero. The count comparison is diagnostic, not an error-free full invocation: the frozen analyzer rejects two failed shutdown `state_leases` DELETEs (`database is locked`). Shutdown exceeds the 20% stop threshold; it was stopped and explicitly accepted by the coordinator as inherited after an independent main shutdown-lock reproduction. The separate SHUTDOWNLOCK lane owns that repair. The scratch join changes no lease code or writes. No latency or CPU-speed claim is made.

The frozen 3.1.5 standard workload is a different scheduled `cron.add` flow: three valid baselines gave 06.cron 231/62/0, 235/65/0, 233/63/0 (median 233/63/0), versus ordinary warm 45/12/0. The descriptive excess is 188 SQL/51 requests, not causal subtraction. One extra standard setup aborted before any Gateway; it supplies no performance evidence. The existing scratch source is identical across that baseline and the explicit baseline. Full current-standard delta is deferred to the next census.

Validation: count regression red on baseline (2 SELECTs and BEGIN/COMMIT), all 17 scratch-store tests green on the candidate; two isolated Codex P0–P2 reviews scoped-clean. The existing two-engine conformance test passed on actual SQLite and PostgreSQL 17, with catalog/trigger parity and cleanup verified. Test cost: scratch cases totaled 6.528 s (125.95 s file duration, mostly transform); the two engine cases totaled 1.846 s (260.62 s file duration, mostly transform). The candidate build and official source-freshness check passed at measured runtime head 93a6c4d; the three-sample invocation completed with the shutdown limitation above. Exact-head CI run 40176443806 completed successfully: 39 successful jobs, 26 skipped, no failures, including all three actual PostgreSQL shards, production/test types, lint, source contracts, Madge, and worker/T1/dialect ratchets. The earlier run passed types, lint and source contracts but found a worker-inventory omission: the new direct query was conservatively labeled T1. Head a187ecf corrects only inventory metadata and regenerates its snapshot: the worker snapshot and its private heartbeat helper are W, while the native Doctor reader stays T3. No runtime or SQL change is involved. The generated snapshot also catches up existing main classifications; targeted script lint and formatting pass. The two production reviews remain valid; this tooling-only correction adds no production review round. PG review approved the semantics at 68c24c4, and the coordinator explicitly carried REVIEW-OK to 93a6c4d because only benchmark TypeScript annotations changed. Candidate counts and the inherited-shutdown disposition are recorded; the corrected head’s CI and all three PG shards passed. The test-only import relocation avoids another open PR's adjacent import change; production bytes remain identical to both isolated reviews and database proof. The benchmark annotations fix CI TS7022 without changing emitted behavior.

Final-head overlap at a187ecf: complete shared-index base-versus-candidate merge-tree comparison covers 21 peers (openclaw#183410, openclaw#183285, openclaw#181057, openclaw#180871, openclaw#180286, openclaw#180139, openclaw#169241, openclaw#168956, openclaw#168615, openclaw#167546, openclaw#167471, openclaw#165039, openclaw#161997, openclaw#157922, openclaw#157693, openclaw#156613, openclaw#141004, openclaw#137788, openclaw#136476, openclaw#129388, openclaw#121204). No new source conflict paths, regions or messages. Six peers (openclaw#181057, openclaw#180871, openclaw#180139, openclaw#169241, openclaw#129388, openclaw#121204) have added or changed conflicts confined to the fully generated worker inventory. The coordinator explicitly accepted this class because main's snapshot was stale and generated outputs must be regenerated, not hand-edited. The same exact-head disposition carries PG REVIEW-OK because runtime bytes are unchanged. Exact-head CI and all three PostgreSQL shards passed.

PG checklist: (1) read-only; existing writer transaction/advisory-lock, DML/conflict and cross-store commit ordering unchanged. (2) At most one joined row via the existing composite primary keys, original job fields plus four scratch fields, unchanged 256 KiB scratch write bound. (3) No cache/generation or invalidation change; one statement snapshot, existing outer PG read transaction retained. (4) No schema/admission/identity/retry/probe change. (5) Same worker owner, one request, no MAIN expansion; target 4→1 SQL in all three real Gateway runs, with the inherited shutdown failure disclosed above. (6) Actual PostgreSQL 17 and SQLite owner conformance passed; all three final-head PostgreSQL CI shards and the other selected static checks passed.

Knip was run separately because ordinary PR CI excludes it. The canonical candidate export scan failed with 26 script, 20 production and 16 full-tree findings; none is in a changed file. All 62 occurrences (52 unique file/symbol pairs), scanner/config/compiler inputs and package inputs are unchanged from merge-base 71bc695. The only removed imports, runSqliteReadSnapshotSync and loadCronRows, both retain multiple real production consumers. Current-main diagnostic sections reported 14 script and 7 production findings; main has already repaired 40 candidate occurrences in unrelated changes. Its separate full-tree scan was intentionally stopped after the coordinator accepted the source-attributed inherited findings; it is not a passing full-main scan. No ignored exports, baselines or unrelated code were changed. The failed candidate scan is explicitly accepted as inherited; all branch changes and selected CI static checks pass.

Pre-merge shared-index refresh retains 17 open peers from that audit. Only openclaw#180871 moved (f140f16); its fresh base-versus-candidate comparison still adds conflicts solely in the generated worker inventory, within the coordinator-accepted class. No new source conflicts.

Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 26, 2026
Add a shared, permanent dismissal for retired pending inputs through the existing withdrawal owner. Preserve retained content, attachments, and receipts, reject live or queued inputs, and revalidate session authority at the effect. Reconnecting clients consume the cancelled receipt instead of resending the dismissed input.

The reviewed implementation is preserved through the main integration; the protocol conflict was resolved by the canonical validator generator and verified deterministic. Focused Gateway/storage and UI regressions and targeted lint/format checks passed. Local typechecking is limited by the shared-install boundary; exact-head PR CI provides broad validation. Fresh Gateway restart proof remains a documented follow-up.

Co-authored-by: Chris Eckert <[email protected]>
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

app: web-ui App: web-ui clawtributors PR from a clawtributor docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. security-sensitive-changed size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: No discard control for interrupted/cancelled pending inputs in webchat (2026.8.1)

3 participants