Skip to content

fix: chat turns fail when session state is briefly busy - #156067

Merged
roboclaw-bot merged 11 commits into
mainfrom
openclaw/fix-155975-chat-contention-recovery
Sep 23, 2026
Merged

roboclaw-bot merged 11 commits into
mainfrom
openclaw/fix-155975-chat-contention-recovery

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #155975

What Problem This Solves

Fixes: a chat turn can fail with a raw storage error when opening a cold session database overlaps state-lifecycle contention.

User Impact

User impact: brief contention can clear while the original turn waits, without sending another message; longer contention produces a calm warning with Check status and expandable, redacted details. Stop remains available.

This does not automatically replay an interrupted turn. The historical incident's exact holder and acquisition callsite remain unknown; the reproduction below establishes a specific reachable cold-admission defect, not that historical cause.

Why This Change Was Made

Cold reply admission used a synchronous native acquisition that could prevent the host from servicing the work needed to release contention. Admission now waits asynchronously at the physical database owner's acquisition boundary. Each request retains one bounded five-second acquisition budget, independent cancellation, and request/storage authority checks, even when physical preparation is shared. The operation itself and cleanup are not retried. The host-side native acquisition waits share that retry policy. Their retained worker cleanup does not require new-read admission; the request owners still validate new operations. The executing worker’s newer checked late-custody delegate handoff from main is preserved unchanged.

Reported by and implemented at the request of @jalehman.

Work sessions

Evidence

Before

Before: raw contention failure during cold admission

After

After: the original turn resumes exactly once

Behavior videos

The refreshed recording uses the integrated runtime at bcf8fc40375 plus the fresh, lockfile-built Workboard manifest subsequently committed in 09172c28033—the only source-tree difference. It covers the final runtime behavior, including lifecycle-owned read cancellation, the native monotonic acquisition clock, and current-main Stop intent ownership. Recording and full-resolution states were inspected; the published player decodes/seeks and all three images render.

Before — pinned baseline, 22.6 seconds

155975-before.mp4

After — integrated runtime recovery, exhaustion, refresh and Stop, 41.960 seconds

155975-native-clock-after.mp4

Real Gateway/Control UI checks passed:

Scenario Observed outcome
Before, cold admission + short host-timed holder Raw red contention error; no inference request. The host release timer was starved until the holder's 15-second safety release.
After, same trigger Holder released at 2.021 seconds; one original send reached inference once and produced one answer.
Longer, independently released holder Bounded admission failure; calm typed warning survived refresh; Details showed only fixed redacted diagnostics.
Check status No additional send or inference; unsent draft preserved.
Stop during wait One abort; no inference or final answer after holder rollback/exit. A failed Stop acknowledgement is explicitly uncertain and warning-styled, not a claim that cancellation failed.

Every accepted request had exactly one persisted user message and one terminal event. All holder workers rolled back and exited successfully; isolated Gateways were stopped. These execution-count assertions come from real requests/history, not rendered text alone.

Real proof uses an isolated built Gateway and its built Control UI, with a separate native SQLite holder. Inference is a credential-free, deterministic loopback Responses fixture, not an external provider. The memory slot is disabled through supported configuration so the database can become idle/cold; native borrower and eviction guards are unchanged. Scheduling instrumentation is a synthetic trigger, not a reconstruction of the historical holder. The short case schedules the foreign holder’s release on the host to expose synchronous event-loop starvation; the long/Stop cases release independently. Existing broker grant pumping remains unchanged.

An earlier monolithic check:changed attempt ended with Testbox exit 255 during broad lint and has no complete result; the scoped checks below passed separately. That incomplete attempt is not used as evidence. External-provider inference was not run; hosted native-app CI is reported separately below.

Regression, verification commands, and additional captured states
  • The native cold-admission regression failed on the pinned baseline before the repair and passed afterward.
  • Shared physical bootstrap preserves independent caller deadlines and cancellation; stopping one coalesced caller does not poison another.
  • Authority/inode changes, cleanup failure, cancellation of worker reads, and existing broker grant pumping/alias behavior are covered.
  • No whole-dispatch retry of state contention, no synthetic continuation, and no Retry action.
  • Live and restored history share a typed, fixed diagnostic allowlist; arbitrary error text and private details are not projected.
  • Fresh independent autoreview found no actionable P0–P2 findings after cleanup, cancellation, and late-coalesced deadline fixes and their regressions.
  • Stop failure handling preserves the original authorization and captured-run fences. Direct typed contention is classified; spoofed text and cleanup aggregates are not.
  • The duplicate host-side native wait loop was removed; main’s distinct checked-delegate worker owner remains untouched.

Published-head verification

Current candidate: 09172c28033bb8fe53691358a25a80ce8a261e2d. Exact-head CI checked out merge d539b7c9b85935b94a546da1f78cbd352aa8ab96 against actual main parent aa9b92a12d87f7c2326c2862114553344afb9154. CI completed successfully on this exact head: 170 jobs passed and 11 were skipped; none failed or remained pending. This includes the corrected build-artifacts job and completed iOS smoke. The full PR check rollup was also re-read with no failing or pending checks; skipped and neutral reports are not counted as executed passes.

The measured clock-domain defect (start 0 ms, subsequent read 25,093 ms, deadline 5,000 ms) is repaired by using the native monotonic clock throughout acquisition. Cleanup-certainty/authorization guards and the original conversation-capture fixture remain unchanged. Focused proofs passed: original capture 22, acquisition 9, dreaming 11, waiter budgets 7, recovery/ACP 83, and admission claims 14. Fresh independent P0–P2 reviews found no actionable defects.

All seven original failed CI plan groups passed on the integrated runtime using their original configuration/include selections and worker limits. Current main’s upstream Telegram fixture refactor is retained and its actual HTTP tests passed; this is not a claim that the historical file’s case layout is unchanged. Additional integrated checks passed: 87 UI tests in 8 files, core/UI types, messaging/agents-sessions test-type graphs, scoped typed lint including SDK declaration preparation, and protocol generation/checks. The original batch’s sole failure was its old Workboard manifest; after applying official generator output from a fresh locked-dependency install, all bundled asset checks passed on exact head 09172c2 (wrapper exit 0, 61.07 s).

Original plan group Measured isolated wall
Admission/state routing 90.422 s
Signal 112.441 s
Dreaming cleanup 76.771 s
Process/diagnostics 103.780 s
Cron service 225.733 s
Telegram 138.789 s
Dispatch lifecycle / ACP 93.885 s

Historical b118 CI failed seven groups. The subsequent bcf8 build-artifacts failure was traced to a stale local dependency install (TypeBox 1.3.30 versus locked 1.3.32); the official fresh generator—not a hand-edited hash—produced the two corrected asset paths. No assertions, cleanup guards, test pools, or timeout budgets were weakened to conceal failures.

Published-driver × candidate compatibility — passed

The maintained recovery-cleanup cell passed on isolated Blacksmith Testbox tbx_01m37tjm7cb5xyy80y04508c86 (provider run). It used the actual published [email protected] updater, not package replacement, against existing synthetic operator fixture state. No live Team state or live provider credentials were used.

  • Wrapper verified source 09172c28033bb8fe53691358a25a80ce8a261e2d, tree 65bc9bd37cfc07b4a2bfda0e81d367d50397b698; carrier b14d3ffee88713ad57f2e43e43a3890863ea51a2. Baseline release build ec9c1a13db89 was replaced by candidate build b14d3ffee887; both retain nominal version 2026.9.5, so the distinct build IDs and tarball digest—not a version bump—identify the tested update.
  • Candidate tarball SHA-256: 38385067deb0c98b7080b2f3db7c3c75bd08ad64629cd5849948438662a46803.
  • First updater invocation: ok/succeeded, 18 steps exit 0, including automatic migration Doctor and post-install checks. Automatic-migration assertions passed before standalone Doctor; no separate recovery update was needed.
  • 49 phases passed, including preservation, custom restore, live/offline cleanup, Gateway restart and restarted survival. Cleanup removed 9 stale files / 64,323 bytes, retained 1,866 protected bytes, and left 10 SQLite entries and database bytes unchanged. Retry removed zero; a replacement at a disposed path was protected. Live-apply, wrong-profile and no-consent safety refusals passed.
  • Gateway startup 14 s; restarted health/readiness/status probes each 1 s. Wrapper exit 0, command 872.651 s; scenario 282.737 s. Both task-owned Testboxes were stopped after evidence retrieval. Lease-cleanup Actions status is not the command outcome.

Evidence limitation: this published driver did not provide an independent firstHopPostCore exit snapshot. The first invocation’s update result and pre-standalone-Doctor migration assertions supply the convergence evidence; an unavailable capture is not claimed. Expected malformed/protected-fixture warnings, deferred plugin convergence, a DM-collision advisory and noncanonical-state service-management skip were recorded without failing the cell.

Reproduction command:

OPENCLAW_UPGRADE_SURVIVOR_PUBLISHED_BASELINE=1 \
[email protected] \
OPENCLAW_UPGRADE_SURVIVOR_SCENARIO=recovery-cleanup \
bash scripts/e2e/upgrade-survivor-docker.sh

No merge, auto-merge, or deployment is requested.

Earlier implementation checks (before the final compatibility follow-up and generated-asset refresh):

  • Current-main ownership integration: 48 tests passed across six files, covering native cold admission, independent coalesced waiters, late parent custody, worker paths and registration.
  • Current-main cancellation, authorization/currentness, no-replay, dispatch errors, projection redaction and live/history notices: 189 tests passed across ten files. Other focused protocol/startup/UI suites also passed.
  • pnpm build, pnpm ui:build, pnpm protocol:check: passed on isolated Blacksmith Testbox (Node 24.19.0).
  • pnpm tsgo:core, pnpm tsgo:ui, and node scripts/run-tsgo-core-test-shards.mjs --changed-paths-json <changed-tests>: passed across all eight selected canonical test graphs. Four graphs were rechecked after mechanical test lint fixes.
  • Focused run-oxlint.mjs on every changed TypeScript file, run-stylelint.mts on touched UI files, ui:i18n:verify, formatting, line-cap/max-lines/assertion-safety ratchets, and git diff --check: passed.
  • Inspected real-flow recording on 1a99a7c1a869: 42.08 seconds, with counted original requests, inference calls, persisted user turns, terminal outcomes, and native holder cleanup. Baseline recording: 22.6 seconds. Full captures and representative frames were inspected; no Team data or production Gateway was used.

Hosted CI follow-up

The first ready-head run exposed two task-related defects, not unrelated main failures. The exact CI merge reproduced 20 subagent-resume failures, while its exact base passed the same ordered shard. A newly added read guard wrongly refused retained worker cleanup after read admission had been revoked. Removing that guard at the custody owner restores cleanup; new chat admission keeps its existing authority checks. A new canonical-close regression failed before the correction and passed afterward (93 ms test body); independent P0–P2 review of the correction is clean.

The repaired exact-merge replay passed the original first CI plan (agentic-gateway-core-2-hosted-1), preserving both configs and all 83 include patterns/order: 83 files, 1,229 passed / 1 skipped, 161.13 s. Exact-base control: 159.61 s. Both used isolated Blacksmith Testbox, Node 24.19.0 and the original CI plan runner; this is not a full-workflow green claim.

Workboard imports the additive chat protocol states into its browser bundle. The official generator leaves the exact CI base unchanged but changes the candidate manifest hash; regenerated output matches between the isolated candidate and this checkout.

The subsequent main integration preserves b6340c7947b’s worker-backed runtime transcript reports, live write assertion, and startup-only native settlement. Its affected seven-file test set and full build passed. A fresh review then identified a missing lifecycle cancellation signal on the new asynchronous admission read. A deterministic regression failed before the fix; the existing admission owner now supplies its composed signal to the read. 57 tests across the reply-admission and lifecycle-owner/diagnostic suites passed, including cancellation, independent upstream signal, and lifecycle-lock drainage. Fresh P0–P2 review of that correction is clean.

CI on 1a99a7c1a869 also exposed TS2322 at the existing Gateway agent-admission caller: its custom final-validation callback accepts an optional boolean, not an AbortSignal. The final correction preserves that callback’s original zero-argument contract and supplies the composed signal only to asynchronous validation. It uses no cast or type widening; fresh P0–P2 review is clean. 48 tests across lifecycle admission, the real Gateway late-admission caller, and reply admission passed after that correction.

The final fixture-only lint correction rejects with an Error while retaining the same cancellation and lock-drain assertions. The last rebase resolved only generated Workboard hash conflicts and preserved main’s cold-metadata reader and descendant-abort changes.

Measured test cost

Initial implementation per-file measurements (historical): files passed individually via node scripts/run-vitest.mjs <file> --maxWorkers=1 (the repository test runner), with ready dependencies and a shared module-cache path. These are measured wrapper wall times, not CI durations; the integrated plan-group costs above are reported separately.

File Wall
src/config/sessions/session-accessor.sqlite-worker-coordination.test.ts 42.94 s (34.07 s compiler preparation; new assertion 0.093 s)
packages/gateway-protocol/src/schema/logs-chat.test.ts 2.42 s
src/auto-reply/reply/reply-turn-admission.database-claim.test.ts 15.31 s (14 tests; added cancellation assertion 0.003 s)
src/gateway/chat-display-projection.state-contention.test.ts 8.04 s
src/gateway/server-chat-state.test.ts 3.52 s
src/gateway/server-chat.agent-events.test.ts 16.95 s
src/gateway/server-methods/chat-send-dispatch-errors.test.ts 17.96 s
src/gateway/server-methods/chat-send-retry.test.ts 6.14 s
src/gateway/server-methods/chat.abort-contention.test.ts 10.51 s
src/infra/state-database-coordinator-acquisition.test.ts 2.33 s
src/state/openclaw-agent-db-write.env-capture.test.ts 2.38 s
ui/src/pages/chat/chat-gateway.contention.test.ts 3.21 s
ui/src/pages/chat/chat-history.contention.test.ts 2.13 s
ui/src/pages/chat/chat-history.run-error.test.ts 2.14 s
ui/src/pages/chat/chat-view-notices.test.ts 2.56 s
ui/src/pages/chat/chat-view.contention.test.ts 4.43 s
ui/src/pages/chat/components/chat-message.startup.test.ts 2.69 s
ui/src/pages/chat/components/chat-message.test.ts 4.80 s
ui/src/pages/chat/run-lifecycle.contention.test.ts 1.96 s

The final 15.31s native admission file used ready compiled-worker artifacts and includes about 8s of actual tests. The earlier cold run took 39.08s, including 21.38s of compiled-subprocess preparation. Its real SQLite holder, physical-file identity changes, queue ownership and cancellation cannot be proven by a cheaper mocked layer. The manual Gateway/video composition is not committed into per-PR CI. Other longer entries are existing suites plus the focused regressions, not added wall-clock sleeps.

Refreshed warning and redacted details:

After refresh: calm warning and fixed technical details

Stop acknowledgement after cancellation:

Stop: uncertain acknowledgement stays warning-styled


View the OpenClaw team session

@clawsweeper

clawsweeper Bot commented Sep 23, 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.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime scripts Repository scripts size: XL maintainer Maintainer-authored PR labels Sep 23, 2026
@roboclaw-bot

roboclaw-bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator Author

Inspected real Gateway + Control UI behavior proof captured on 1a99a7c1a869db1dafbe90a5bde5ad3299f94f8f, including main’s worker-backed transcript reports, retained cleanup repair, and lifecycle-owned read cancellation.

The recording covers original-request recovery, bounded exhaustion, refresh/Details/Check status without resend, preserved draft, and Stop with an explicitly uncertain warning. Every accepted request has one persisted user turn and one terminal event. All native holders rolled back and exited; the isolated Gateway stopped. Inference is a deterministic loopback fixture, not an external provider. Raw captures are retained with the implementation work. The capture SHA is explicit; subsequent verification is recorded in the PR body rather than relabeling the video.

Before — pinned baseline b7f616e, 22.6 seconds:

155975-before.mp4

After — integrated recovery, exhaustion, refresh and Stop, 42.08 seconds:

155975-current-behavior-after.mp4

@clawsweeper

clawsweeper Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 23, 2026, 4:24 PM ET / 20:24 UTC (Revision 9).

ClawSweeper review

What this changes

The branch adds an asynchronous wait for busy chat-session database admission and carries typed waiting, failure, and Stop feedback through the Gateway, stored history, native protocol, and Control UI.

Merge readiness

✅ Ready for maintainer review

Current main still has the synchronous cold-admission path, and no merged fix replaces this PR. The refreshed real-flow evidence and reported published-updater check address the prior review’s blockers. The exact cause of the original incident remains unknown.

Priority: P2
Reviewed head: 09172c28033bb8fe53691358a25a80ce8a261e2d

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) The patch is a coherent owner-boundary repair with strong real-flow and upgrade evidence, focused regressions, and successful exact-head CI.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): An isolated built Gateway and Gateway-served Control UI exercised the changed cold-admission path with a native SQLite holder: the original turn answered once after release, while longer contention and Stop produced bounded outcomes without resend. Directly inspected before/after images show the visible improvement, and the PR reports existing-state survival through a published-updater-to-candidate run for the additive optional transcript marker. The prepared videos could not be decoded here because ffprobe was unavailable, and browser playback returned a cache miss; that reviewer limit does not negate the images and recorded real-path observations.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): An isolated built Gateway and Gateway-served Control UI exercised the changed cold-admission path with a native SQLite holder: the original turn answered once after release, while longer contention and Stop produced bounded outcomes without resend. Directly inspected before/after images show the visible improvement, and the PR reports existing-state survival through a published-updater-to-candidate run for the additive optional transcript marker. The prepared videos could not be decoded here because ffprobe was unavailable, and browser playback returned a cache miss; that reviewer limit does not negate the images and recorded real-path observations.
Evidence reviewed 11 items Current-main behavior: Current main still opens the database synchronously when loading a session entry for reply admission, so the central cold-open repair is not already implemented.
Existing retry boundary: Current main retries accepted sends only for typed transcript-projection unavailability; that path does not address cold state-lifecycle acquisition.
Introduced acquisition boundary: The pinned introduced diff retries only typed native state-lifecycle acquisition within a monotonic deadline; validation and the protected operation are outside the retry.
Findings None None.
Security None None.

How this fits together

A chat request passes through Gateway reply admission, which reads the agent’s SQLite session state before an agent run begins. The Gateway then sends progress or a terminal result to chat clients and stores the outcome for history.

flowchart LR
A[Chat request] --> B[Gateway reply admission]
B --> C{State database busy?}
C -->|No| E[One agent run]
C -->|Yes| D[Bounded acquisition wait]
D -->|Clears| E
D -->|Deadline or Stop| F[Status or Stop notice]
E --> G[Answer and history]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +480, Tests +1046, Other +2. Total +1528 across 60 files.

View PR surface stats
Area Files Added Removed Net
Source 34 584 104 +480
Tests 24 1127 81 +1046
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 2 0 +2
Total 60 1713 185 +1528

Review metrics

Metric Value Why it matters
Production versus test growth production/tooling +473 net lines; tests/support +1,055 net lines The production growth implements asynchronous ownership and typed presentation; the larger test growth covers native contention, cancellation, and restored chat state.
Chat protocol vocabulary 2 added values: waiting phase and contention error kind Gateway clients now receive typed busy-state information instead of relying on error text.

Stored data model

Persistent data-model change detected: serialized state: src/gateway/session-lifecycle-state.ts, unknown-data-model-change: src/gateway/session-lifecycle-state.ts. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Technical review

Best possible solution:

Land the bounded acquisition-only repair through normal review, retain the no-replay rule, and resolve the paired report after the PR merges.

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

Yes. A pinned baseline Gateway and Control UI capture shows the raw failure with a native SQLite holder, and current main retains the same synchronous cold-open path; this read-only review did not execute current main.

Is this the best way to solve the issue?

Yes. Waiting at the physical acquisition owner avoids replaying a possibly executed turn, while cancellation and current-owner checks guard the resumed admission.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add merge-risk: 🚨 message-delivery: Resuming an accepted turn after contention could duplicate execution or deliver after Stop; the recorded real flow and cancellation coverage address those paths.
  • add merge-risk: 🚨 session-state: The new asynchronous admission retains a database claim across waits, making stale-session rejection important; current identity checks and native cases address that hazard.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. An isolated built Gateway and Gateway-served Control UI exercised the changed cold-admission path with a native SQLite holder: the original turn answered once after release, while longer contention and Stop produced bounded outcomes without resend. Directly inspected before/after images show the visible improvement, and the PR reports existing-state survival through a published-updater-to-candidate run for the additive optional transcript marker. The prepared videos could not be decoded here because ffprobe was unavailable, and browser playback returned a cache miss; that reviewer limit does not negate the images and recorded real-path observations.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): An isolated built Gateway and Gateway-served Control UI exercised the changed cold-admission path with a native SQLite holder: the original turn answered once after release, while longer contention and Stop produced bounded outcomes without resend. Directly inspected before/after images show the visible improvement, and the PR reports existing-state survival through a published-updater-to-candidate run for the additive optional transcript marker. The prepared videos could not be decoded here because ffprobe was unavailable, and browser playback returned a cache miss; that reviewer limit does not negate the images and recorded real-path observations.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: A demonstrated chat-turn failure has a bounded repair and one confirmed affected conversation, with broader frequency unknown.
  • merge-risk: 🚨 session-state: The new asynchronous admission retains a database claim across waits, making stale-session rejection important; current identity checks and native cases address that hazard.
  • merge-risk: 🚨 message-delivery: Resuming an accepted turn after contention could duplicate execution or deliver after Stop; the recorded real flow and cancellation coverage address those paths.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): An isolated built Gateway and Gateway-served Control UI exercised the changed cold-admission path with a native SQLite holder: the original turn answered once after release, while longer contention and Stop produced bounded outcomes without resend. Directly inspected before/after images show the visible improvement, and the PR reports existing-state survival through a published-updater-to-candidate run for the additive optional transcript marker. The prepared videos could not be decoded here because ffprobe was unavailable, and browser playback returned a cache miss; that reviewer limit does not negate the images and recorded real-path observations.
  • proof: sufficient: Contributor real behavior proof is sufficient. An isolated built Gateway and Gateway-served Control UI exercised the changed cold-admission path with a native SQLite holder: the original turn answered once after release, while longer contention and Stop produced bounded outcomes without resend. Directly inspected before/after images show the visible improvement, and the PR reports existing-state survival through a published-updater-to-candidate run for the additive optional transcript marker. The prepared videos could not be decoded here because ffprobe was unavailable, and browser playback returned a cache miss; that reviewer limit does not negate the images and recorded real-path observations.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. An isolated built Gateway and Gateway-served Control UI exercised the changed cold-admission path with a native SQLite holder: the original turn answered once after release, while longer contention and Stop produced bounded outcomes without resend. Directly inspected before/after images show the visible improvement, and the PR reports existing-state survival through a published-updater-to-candidate run for the additive optional transcript marker. The prepared videos could not be decoded here because ffprobe was unavailable, and browser playback returned a cache miss; that reviewer limit does not negate the images and recorded real-path observations.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • galiniliev: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (8 earlier review cycles)
  • reviewed 2026-09-23T01:44:58.349Z sha d25fe4e :: needs changes before merge. :: none
  • reviewed 2026-09-23T02:20:14.841Z sha d25fe4e :: needs changes before merge. :: none
  • reviewed 2026-09-23T03:02:20.683Z sha 5bc580b :: needs changes before merge. :: none
  • reviewed 2026-09-23T03:10:59.883Z sha 5bc580b :: needs maintainer review before merge. :: none
  • reviewed 2026-09-23T04:32:21.458Z sha 1a99a7c1a869db1dafbe90a5bde5ad3299f94f8f :: needs maintainer review before merge. :: none
  • reviewed 2026-09-23T05:03:29.093Z sha b118609 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-23T09:42:15.725Z sha b118609 :: needs changes before merge. :: [P2] Use one clock source throughout coordinator acquisition | [P2] Keep admission preparation arguments out of the row-read fixture | [P2] Include the required reader runtime in the module-identity fixture | [P2] Observe successor admission instead of assuming timer completion
  • reviewed 2026-09-23T19:11:15.305Z sha bcf8fc4 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Sep 23, 2026
@roboclaw-bot
roboclaw-bot force-pushed the openclaw/fix-155975-chat-contention-recovery branch from d25fe4e to 5bc580b Compare September 23, 2026 02:36
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 23, 2026 03:04
@roboclaw-bot
roboclaw-bot force-pushed the openclaw/fix-155975-chat-contention-recovery branch from 5bc580b to 1a99a7c Compare September 23, 2026 04:24
roboclaw-bot and others added 5 commits September 23, 2026 04:46
Wait at the physical state acquisition owner without replaying the accepted turn. Preserve independent caller deadlines and cancellation, and present certified contention consistently across live chat, restored history, and uncertain Stop acknowledgements.

Co-authored-by: jalehman <[email protected]>
@roboclaw-bot
roboclaw-bot force-pushed the openclaw/fix-155975-chat-contention-recovery branch from d3d7c74 to b118609 Compare September 23, 2026 04:48
@clawsweeper clawsweeper Bot added 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. and removed 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. labels Sep 23, 2026
roboclaw-bot and others added 2 commits September 23, 2026 19:00
Preserve Guest Stop intent ownership alongside structured contention reporting; use officially regenerated Workboard asset references.

Co-authored-by: jalehman <[email protected]>
Keep bounded acquisition deadlines in the existing native monotonic domain through asynchronous validation and cleanup. Preserve original native custody tests and join fixture-owned work without weakening guards or assertions.

Co-authored-by: jalehman <[email protected]>
OpenClaw-Publication: c9920138-e70d-4483-bb02-0716c17f7ebe
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Refreshed real-Gateway proof after the native-clock repair and main integration. The built Gateway and Gateway-served Control UI use a real native SQLite holder; inference uses a credential-free deterministic loopback provider, not an external service.

  • Holder release at 2.021 s: the original turn executes exactly once.
  • Longer contention: finite warning, preserved history/details and draft; Check status does not resend.
  • Stop: one abort, zero inference after holder exit, and a calm warning for the uncertain acknowledgement.

The 41.960-second recording and screenshots were inspected. Its runtime source is bcf8fc40375; the fresh build generated the Workboard asset paths subsequently committed in 09172c28033—the only source-tree difference. No live Team state was used. Exact-head CI is still being verified.

Attached: refreshed recording, successful original turn, persisted warning/details, and Stop warning.

155975-native-clock-after.mp4

The original turn resumes once after native state contention clears

Persisted state contention warning with actionable details

Stop cancels admission while its uncertain acknowledgement remains a warning

@clawsweeper clawsweeper Bot added merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦞 diamond lobster Very strong PR readiness with only minor 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: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 23, 2026
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Native land-ready review is complete for 09172c28033bb8fe53691358a25a80ce8a261e2d. The original implementer personally rechecked current-main ownership, scoped instructions, the exact-head reviews and retained regression/upgrade/media evidence.

  • Native review artifact validated READY FOR /prepare-pr, zero findings.
  • OPENCLAW_TESTBOX=1 scripts/pr prepare-run 156067 passed using completed hosted evidence; no rebase or head rewrite.
  • Exact-head CI passed; ClawSweeper revision9 has no findings or remaining before-merge items.
  • Published2026.9.5-updater recovery/Doctor/restart proof passed49phases, with the disclosed missing independent post-core snapshot; real Gateway/native-holder screenshots and41.96s recording remain linked in the body.
  • The native squash message retains only the verified human coauthor jalehman <[email protected]> and both canonical Work sessions links.

Proceeding through native merge guards under the maintainer’s scoped landing authorization. No deployment or unrelated runtime change.

@roboclaw-bot
roboclaw-bot merged commit 3b2c61d into main Sep 23, 2026
260 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/fix-155975-chat-contention-recovery branch September 23, 2026 21:11
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 24, 2026
)

Fix cold chat admission failing during transient session-state contention.

Wait asynchronously at the physical acquisition owner with one bounded native-monotonic budget, without replaying agent work. Preserve cancellation, current authority, native cleanup certainty, and independent coalesced callers. Carry safe waiting/failure/Stop feedback through live and restored chat.

Verified exact-head CI, original failing CI groups, real Gateway/native-holder UI evidence, and the published2026.9.5-updater recovery/Doctor/restart cell. Historical incident holder remains unknown; no unrelated schema, protocol-version, security-policy, or deployment change.

Reported by and implemented at the request of @jalehman.

## Work sessions

- [Original discussion with @jalehman](https://team.openclaw.ai/chat/roboclaw/dashboard/767cab96-667e-4062-85ef-1639fb0f12c7)
- [Implementation and verification](https://team.openclaw.ai/chat/roboclaw/dashboard/e66496e6-5418-4afa-90d9-3d1a63c3a909)

[View the OpenClaw team session](https://team.openclaw.ai/chat/roboclaw/dashboard/e66496e6-5418-4afa-90d9-3d1a63c3a909)

Co-authored-by: jalehman <[email protected]>
wangmiao0668000666 added a commit to wangmiao0668000666/openclaw that referenced this pull request Oct 12, 2026
…s.abort

chat.abort preserves the typed state-contention outcome at the RPC
boundary (openclaw#156067): when a session read fails while cancellation still
takes effect, Stop answers UNAVAILABLE with the contention errorKind
instead of replaying or claiming it had no effect. sessions.abort calls
the same lifecycle but sat outside that guard, so the same busy-window
read failure surfaced as an untyped internal error from the other Stop
entry point.

Extract the contention response into respondToAbortStateContention and
share it through withAbortStateContentionGuard, then wrap the
sessions.abort handler so both Stop entry points return the identical
typed outcome. The fast dispatch proof covers the guard on both entry
points; the real-lock proof (real Gateway, foreign BEGIN EXCLUSIVE on
the live shared-state database) joins the release-only runtime
inventory.

Co-Authored-By: Claude Code <[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 channel: signal Channel integration: signal gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. plugin: workboard proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. scripts Repository scripts size: XL 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.

1 participant