Skip to content

fix: stabilize chat interactions and async tests - #153277

Merged
steipete merged 26 commits into
mainfrom
codex/deflake-async-tests
Sep 20, 2026
Merged

steipete merged 26 commits into
mainfrom
codex/deflake-async-tests

Conversation

@steipete

@steipete steipete commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes chat-rail markers lost during simultaneous navigation and resize, prevents retired task-publication owners from being marked settled, and removes scheduler-dependent waits from asynchronous regression tests. Related: #153184.

User Impact

The chat rail keeps the current message visible during navigation and composer resizing. Task reads preserve valid terminal results while rejecting superseded publication owners. Tests wait for real readiness and settlement without longer deadlines, assertion-weakening retries, or removed coverage.

Why This Change Was Made

Main owns ordinary task-publication supersession through #153371. This PR rechecks the current publication and both registry owners before terminal work and after awaited cancellation settlement. Registered-reader coverage preserves native completion, replacement/ABA, retired-owner, and genuine-error cases. The paged-read fixture arms its yield hook after creation and joins outstanding operations during cleanup.

The rail processes scroll movement independently of resize handling and replaces a stale startup target when measured content reaches the end. This prevents a five-message rail from moving by 13 pixels during composer growth.

Readiness and cleanup fixtures now join accepted work across task, plugin, process, and realtime tests. Contention tests release their real lock after the responsiveness assertion instead of waiting for the worker's fallback deadline; the fallback and final joins remain. All 34 task-read cases are retained across two registered sibling suites.

Main already owns the Doctor teardown, shared reset settlement, parent/child acknowledgment join (#153249), containment repair (#153260), and disclosure padding (#153231). Their integration and regression evidence remain relevant; they are not additional production changes in this PR.

Evidence

  • Exact-head CI run 35499119937 passed on 1ca41bb7a7595252376df7688a3a20d02d41f38f.
  • Final main integration passed 79 backend cases (34 task-read, 23 Doctor, 22 reset) and 11 rail/Swarm browser cases. The final fixture split and earlier lock release passed all 34 task-read cases.
  • Focused preceding campaigns passed 77 plugin, 30 tooling, 68 process/realtime, and 30 rail cases. Controlled regressions fail on the original ownership, scan-barrier, acknowledgment, close-settlement, deadline, and geometry defects.
  • Four affected type graphs, scoped lint, formatting, diff checks, and the changed-file line-cap check passed. Fresh independent final-candidate review found no actionable P0–P2 finding.
  • A deliberately held, genuinely stale Swarm RPC was consumed after terminal state: the parent stayed done/inactive, and the final outcome remained visible after a subsequent refresh. The unchanged mobile case passed in 1.441 seconds.
  • Earlier local Chromium traps were traced to EDQUOT in temporary-memory storage. The same browser and unchanged tests pass using task-owned disk-backed temporary storage.

Remaining QA Investigation

Earlier Linux CI run 35492615791 failed the Swarm final-parent-outcome visibility assertion in the desktop-many case. The retained job log shows the mobile cases passed. The failure did not reproduce in the isolated case, the full seven-case lifecycle file, the exact tested merge probe, or the final exact-head CI run. Its root cause remains unexplained. A controlled stale-response probe preserved the final outcome, but does not establish the cause of the historical failure. The independently verified fixes in this PR should not be taken as proof that this Swarm flake is repaired.

Bounded, read-only failure diagnostics remain in the lifecycle test to capture parent, disclosure, connection, and RPC facts if it recurs. Fixtures, events, assertions, and deadlines are unchanged. Passing CI and the stale-response probe are current evidence, not a claim that this historical flake is repaired. Investigation continues separately.

Visual Proof

The inspected rail screenshots below use synthetic data. Disclosure-focus images document the integrated main repair, not a remaining production delta.

Before: current marker remains outside the rail After: current marker is visible
Rail before: active marker outside view Rail after: active marker revealed
Before: five-message rail moves after composer growth After: measured end keeps the rail steady
Five-message rail before: stale startup resize target Five-message rail after: measured end refreshes the resize target

Additional desktop and mobile keyboard-focus proof is retained. The fresh pair below uses the current 4px shared padding and the dense-summary correction. All four collapsed/expanded states passed at 1440px and 390px, with unchanged height and keyboard behavior; the inset focus ring clears both icon and text.

Before After
Keyboard focus before Keyboard focus after

@steipete steipete self-assigned this Sep 20, 2026
@clawsweeper

clawsweeper Bot commented Sep 20, 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 channel: matrix Channel integration: matrix app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling channel: feishu Channel integration: feishu size: L maintainer Maintainer-authored PR labels Sep 20, 2026
@steipete
steipete marked this pull request as ready for review September 20, 2026 00:09
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 20, 2026
@clawsweeper

clawsweeper Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 20, 2026, 4:24 AM ET / 08:24 UTC (Revision 22).

ClawSweeper review

What this changes

The branch fixes chat navigation markers during resizing, rechecks task ownership after cancellation cleanup, and replaces timing-sensitive test coordination with explicit synchronization.

Merge readiness

⛔ Blocked before merge - 2 items remain

The PR retains useful fixes absent from current main and is protected maintainer-owned work. No actionable introduced defect was found.

Priority: P2
Reviewed head: 1ca41bb7a7595252376df7688a3a20d02d41f38f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Narrow production repairs have strong visual and regression evidence, with no supported introduced defect.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected Chromium before/after rail captures show the changed production rail's visible correction, supported by reported controlled browser regressions. Task-owner coverage exercises registered readers; ordinary external-contributor proof requirements do not apply to this maintainer-owned PR. The independent Swarm investigation remains a landing blocker.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected Chromium before/after rail captures show the changed production rail's visible correction, supported by reported controlled browser regressions. Task-owner coverage exercises registered readers; ordinary external-contributor proof requirements do not apply to this maintainer-owned PR. The independent Swarm investigation remains a landing blocker.
Evidence reviewed 8 items Introduced production changes remain necessary: The pinned base-to-head diff and fetched-main comparison retain both the rail correction and task-owner recheck. Related merged work does not cover these remaining changes.
Task settlement owner: The publication callback checks current owners before follow-up and again after finishTaskMutation returns. Its existing cancellation helper can catch a retirement error; the final check prevents incorrectly recording those effects as settled. Already-consumed native work remains excluded.
Registered-reader regression coverage: Added cases exercise receipt supersession, flow follow-up failure, retired task and flow owners, cancellation-time replacement, and native consumption through the registered tasks.list request helper. Terminal replacement and ABA coverage is retained in the extracted test file.
Findings None None.
Security None None.

How this fits together

The chat position rail converts transcript visibility and scrolling into navigation markers. Separately, the task registry publishes agent events to task readers after persistence and cancellation work settle.

flowchart TD
  A[Transcript navigation and resize] --> B[Chat position rail]
  B --> C[Visible current marker]
  D[Agent task events] --> E[Persistence and cancellation cleanup]
  E --> F{Registry owners still current?}
  F -->|Yes| G[Task readers and observers]
  F -->|No| H[Reject retired publication]
Loading

Before merge

  • Resolve merge risk (P1) - The disclosed intermittent Swarm visibility failure remains unexplained; passing subsequent runs do not distinguish product behavior, fixture timing, and environment.
  • Complete next step (P2) - Resolve the disclosed Swarm visibility investigation, document the outcome, and remove its temporary diagnostics before landing.
Agent review details

Security

None.

PR surface

Source +3, Tests +778. Total +781 across 19 files.

View PR surface stats
Area Files Added Removed Net
Source 2 14 11 +3
Tests 17 1414 636 +778
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 19 1428 647 +781

Review metrics

Metric Value Why it matters
Production versus validation growth Production net +3 lines; tests/support net +777; test routing net +1 Nearly all growth strengthens synchronization and regression coverage; production growth supports the two stated repairs.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the existing rail and task-publication owners, with deterministic regression coverage and a landing candidate free of temporary investigation diagnostics.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the existing rail and task-publication owners, with deterministic regression coverage and a landing candidate free of temporary investigation diagnostics.

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

Yes for the targeted defects: source and controlled regression evidence identify simultaneous navigation/resize and flow-owner replacement during cancellation. Tests were not executed in this read-only review; the separate intermittent Swarm failure remains unreproduced reliably.

Is this the best way to solve the issue?

Yes: the remaining production edits repair existing owners without adding configuration, parallel APIs, or a stored-data migration.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 85270990eb97.

Labels

Label justifications:

  • P2: This addresses bounded chat-navigation and task-settlement defects without evidence of an urgent widespread outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected Chromium before/after rail captures show the changed production rail's visible correction, supported by reported controlled browser regressions. Task-owner coverage exercises registered readers; ordinary external-contributor proof requirements do not apply to this maintainer-owned PR. The independent Swarm investigation remains a landing blocker.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected Chromium before/after rail captures show the changed production rail's visible correction, supported by reported controlled browser regressions. Task-owner coverage exercises registered readers; ordinary external-contributor proof requirements do not apply to this maintainer-owned PR. The independent Swarm investigation remains a landing blocker.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected Chromium before/after rail captures show the changed production rail's visible correction, supported by reported controlled browser regressions. Task-owner coverage exercises registered readers; ordinary external-contributor proof requirements do not apply to this maintainer-owned PR. The independent Swarm investigation remains a landing blocker.

Evidence

What I checked:

  • Introduced production changes remain necessary: The pinned base-to-head diff and fetched-main comparison retain both the rail correction and task-owner recheck. Related merged work does not cover these remaining changes. (ui/src/pages/chat/components/chat-position-rail.ts:340, 1ca41bb7a759)
  • Task settlement owner: The publication callback checks current owners before follow-up and again after finishTaskMutation returns. Its existing cancellation helper can catch a retirement error; the final check prevents incorrectly recording those effects as settled. Already-consumed native work remains excluded. (src/tasks/task-registry-agent-events.ts:401, 1ca41bb7a759)
  • Registered-reader regression coverage: Added cases exercise receipt supersession, flow follow-up failure, retired task and flow owners, cancellation-time replacement, and native consumption through the registered tasks.list request helper. Terminal replacement and ABA coverage is retained in the extracted test file. (src/tasks/task-registry-read.test.ts:137, 1ca41bb7a759)
  • Inspected visual proof: Inspected all four prepared rail screenshots. The first pair shows previously hidden markers revealed; the second shows the five-message rail position corrected after composer growth. The captured body connects these images to Chromium regressions and controlled before/after failures. Screenshots establish visible layout, while reported browser assertions support the interaction claims. (ui/src/e2e/chat-position-rail-layout.e2e.test.ts:81, 1ca41bb7a759)
  • Prior blocker remains explicitly acknowledged: The captured body and author discussion still describe the Swarm final-parent-outcome failure as unexplained despite passing runs. Current source retains temporary diagnostics around the unchanged visibility assertion. The previous review's investigation-and-removal request therefore remains applicable; this is not evidence that the patch caused the failure. (ui/src/e2e/chat-swarm-lifecycle.e2e.test.ts:187, 1ca41bb7a759)
  • Current PR identity: The live REST response confirms the reviewed head remains current, the PR is open and mergeable, and steipete is assigned. The supplied maintainer label independently prevents automated cleanup. Mergeability does not validate the stale supplied test-merge object. (1ca41bb7a759)

Likely related people:

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

Rank-up moves

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

  • Complete the disclosed Swarm investigation, record its outcome, and remove temporary diagnostics while preserving the original assertions and deadlines.

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 (21 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-20T05:24:20.551Z sha 760e75e :: needs maintainer review before merge. :: none
  • reviewed 2026-09-20T05:39:53.131Z sha 760e75e :: needs maintainer review before merge. :: none
  • reviewed 2026-09-20T05:57:05.484Z sha 5350f64 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-20T07:02:01.023Z sha 27cc1bb :: blocked before merge. :: none
  • reviewed 2026-09-20T07:12:40.273Z sha ba09ecf :: blocked before merge. :: none
  • reviewed 2026-09-20T07:41:47.052Z sha 96e0b0e :: blocked before merge. :: none
  • reviewed 2026-09-20T07:52:45.802Z sha 524152c :: blocked before merge. :: none
  • reviewed 2026-09-20T08:05:23.903Z sha 42c69a7 :: blocked before merge. :: none

@steipete steipete changed the title fix: stabilize task reads, chat navigation, and async tests fix: stabilize task reads, chat interactions, and async tests Sep 20, 2026
Treat verified publication supersession as an intentional nonpublication while preserving genuine errors and replacement guards. Handle rail navigation and resize in the same observation. Replace scheduler-sensitive test assertions with explicit readiness, controlled deadlines, and cleanup that joins accepted work.
Reserve inline space for the existing inset focus ring and let dense tool summaries inherit it while retaining their block padding. Preserve the renderer-containment repair now on main.
@steipete
steipete force-pushed the codex/deflake-async-tests branch from 15e263a to c1080b1 Compare September 20, 2026 01:36
Treat verified publication supersession as an intentional nonpublication while preserving genuine errors and replacement guards. Handle rail navigation and resize in the same observation. Replace scheduler-sensitive test assertions with explicit readiness, controlled deadlines, and cleanup that joins accepted work.
Reserve inline space for the existing inset focus ring and let dense tool summaries inherit it while retaining their block padding. Preserve the renderer-containment repair now on main.
Merge main while preserving virtualized rail markers and the same-frame navigation fix. Replace the redundant delayed reset fixture with the deterministic accepted-event ordering from PR #153302.
Keep task and flow owner retirement distinct from a superseded row. Settle publication and retire pending mutations synchronously before observer microtasks wake readers.
Preserve the updated reset fixture and main integration while keeping publication settlement synchronous before observer readers resume.
Wait for the parent acknowledgment in the terminal fallback scenario and preserve exact-count failure coverage. Supply the acquired send claim during delivery-worker fixture cleanup. Integrate current main and preserve the reviewed publication settlement owner.
Preserve current main and the cancellation owner repair, limit its check to unfinished publication work, and retain successful native completion. Include the measured-end rail repair with deterministic regression coverage.
Preserve the reviewed async and chat fixes while incorporating main. Await the canonical SQLite worker shutdown before Doctor captures its non-mutation baseline, and update the prepared-model factory test import to its lifecycle owner. All original assertions remain.
Reuse main’s canonical Doctor baseline shutdown and model-runtime test import repairs. Register temp cleanup before the awaited database hook so Vitest’s reverse hook order drains SQLite workers before deleting their files. Controlled hook-order proof fails with ENOENT before the repair and passes afterward; all 23 Doctor cases retain their assertions and pass.
Integrate current main and preserve its canonical parent acknowledgment fix. Add bounded synthetic browser diagnostics around the unchanged Swarm final-outcome assertion to diagnose the observed Linux CI failure.
Retain the reviewed remote integration and its SQLite-before-directory cleanup order alongside the bounded Swarm CI diagnostics. All 23 Doctor tests and the combined independent review passed.
@steipete

Copy link
Copy Markdown
Contributor Author

Updated keyboard-focus proof against main 757581aa0f9452624fde06abc42b26cd193703bf: preserve main's 4 px horizontal disclosure padding while setting the tool-summary vertical padding. Previously the shorthand reset the horizontal padding to zero, placing the focus outline against the text.

These synthetic before/after captures use the registered tool-turn-outcome browser test, keyboard Tab focus, and desktop (1200 × 800) and mobile (390 × 844) viewports. Both runs retained and passed the existing assertions. Captures were inspected for sensitive content before upload.

The merged candidate also passes all 89 settlement/persistence cases and all 15 rail/Swarm browser cases. Independent review found no actionable P0–P2 issue. Swarm diagnostics improve failure evidence; they do not establish a fix for the historical intermittent failure.

Before: mobile keyboard focus

After: mobile keyboard focus

Before: desktop keyboard focus

After: desktop keyboard focus

Retain the canonical shared settlement helper and preserve horizontal disclosure padding while applying the vertical summary inset. Keep the reviewed Swarm diagnostics for CI investigation.
@openclaw-barnacle openclaw-barnacle Bot removed gateway Gateway runtime agents Agent runtime and tooling labels Sep 20, 2026
Reuse main’s shared settlement helper and post-registration fixture while retaining early accepted-event fences. Preserve main’s wider disclosure padding in dense summaries. The reset suite, scoped lint, styles, and independent review passed.
Preserve the concurrent branch ancestry without changing the reviewed and validated candidate tree. Retain the early event fences before broader asynchronous cleanup.
@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Sep 20, 2026
Establish the rail clipping geometry through real wheel input before composer growth, preserving all navigation and recovery assertions. Read bounded Gateway event history instead of overriding WebSocket dispatch or adding a lint suppression.
@openclaw-barnacle openclaw-barnacle Bot removed the gateway Gateway runtime label Sep 20, 2026
@steipete
steipete merged commit b56478b into main Sep 20, 2026
252 checks passed
@steipete
steipete deleted the codex/deflake-async-tests branch September 20, 2026 08:44
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 21, 2026
* fix: stabilize task reads, chat navigation, and async tests

Treat verified publication supersession as an intentional nonpublication while preserving genuine errors and replacement guards. Handle rail navigation and resize in the same observation. Replace scheduler-sensitive test assertions with explicit readiness, controlled deadlines, and cleanup that joins accepted work.

* fix(ui): keep inset focus rings clear of disclosure labels

Reserve inline space for the existing inset focus ring and let dense tool summaries inherit it while retaining their block padding. Preserve the renderer-containment repair now on main.

* fix(tasks): retain publication ownership across supersession

* fix: stabilize task reads, chat navigation, and async tests

Treat verified publication supersession as an intentional nonpublication while preserving genuine errors and replacement guards. Handle rail navigation and resize in the same observation. Replace scheduler-sensitive test assertions with explicit readiness, controlled deadlines, and cleanup that joins accepted work.

* fix(ui): keep inset focus rings clear of disclosure labels

Reserve inline space for the existing inset focus ring and let dense tool summaries inherit it while retaining their block padding. Preserve the renderer-containment repair now on main.

* fix(tasks): retain publication ownership across supersession

Keep task and flow owner retirement distinct from a superseded row. Settle publication and retire pending mutations synchronously before observer microtasks wake readers.

* fix(tasks): recheck flow owner after cancellation cleanup

* fix(ui): refresh stale rail resize targets at the measured end

* test: stabilize rail resize setup and simplify Swarm diagnostics

Establish the rail clipping geometry through real wheel input before composer growth, preserving all navigation and recovery assertions. Read bounded Gateway event history instead of overriding WebSocket dispatch or adding a lint suppression.
leilei3167 added a commit to leilei3167/openclaw that referenced this pull request Sep 23, 2026
Rebase onto current main: drop the Feishu hunk (main already has the
socket-close wait from openclaw#153277) and keep the Google Chat timing fixes.

- await responseClosedPromise instead of racing a 100ms timer
- await stream cancel via canceledPromise instead of setTimeout(0)
steipete pushed a commit that referenced this pull request Sep 27, 2026
Rebase onto current main: drop the Feishu hunk (main already has the
socket-close wait from #153277) and keep the Google Chat timing fixes.

- await responseClosedPromise instead of racing a 100ms timer
- await stream cancel via canceledPromise instead of setTimeout(0)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 27, 2026
…nclaw#136768)

Rebase onto current main: drop the Feishu hunk (main already has the
socket-close wait from openclaw#153277) and keep the Google Chat timing fixes.

- await responseClosedPromise instead of racing a 100ms timer
- await stream cancel via canceledPromise instead of setTimeout(0)
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: feishu Channel integration: feishu channel: matrix Channel integration: matrix extensions: qa-lab maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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