Skip to content

fix(ui): isolate chat fixtures after cleanup - #201781

Merged
vincentkoc merged 1 commit into
mainfrom
fix/ui-chat-fixture-retirement
Nov 19, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/ui-chat-fixture-retirement

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Related: #200486

What Problem This Solves

A completed chat test could leave a history request attached to a host that still looked connected. Releasing that response in the next test let the retired host send the next fixture’s queued message and delete its stored row. This made fixture lifetime cross test boundaries.

User Impact

No user-visible behavior changes. Chat test fixtures now retire their connection and history ownership before cleanup can release asynchronous work. Shared clients and session capabilities keep their existing owners.

Why This Change Was Made

One cleanup sequence invalidates the host’s connection identity, cancels its effects, and retires its history read before joining lazy imports. Copied page hosts register their own cleanup after overrides; redundant session disposal is removed. A two-case regression exercises the old history response against a different fixture’s queue while the original seventeen deadline cases remain unchanged.

This test-only repair is a scoped prerequisite for validating the change in the related PR. It does not establish the cause of the earlier CI deadline failure. Production code, assertions in the existing cases, and timeouts are unchanged; the diff is six test files, +149/−15.

Evidence

  • Controlled base experiment: https://github.com/openclaw/openclaw/actions/runs/44510069091. Eighteen cases passed and the added isolation case failed with an identity-linked old-host send and canonical-row deletion. This is negative diagnostic evidence, not a passing CI claim.
  • Candidate 26b971ee932f87974cd0a69748ab6dbb94916889: 80 Node and 19 Bun cases passed with no skips, including the held-history regression on both runtimes. Targeted formatting, type-aware lint, and the UI-chat type graph passed. Source remained unchanged. Run: https://github.com/openclaw/openclaw/actions/runs/44512910753. The delegated workload exited successfully and its lease closed; the carrier Actions run is cancelled by normal lease cleanup, not a required-CI success. Independent workload and custody reviews accepted these results.
  • Separate M996-derived source 0e369a37117866134ec9fe3fb99c0b96ebe33da0: 44 cases passed with no skips (browser 3 + deadline 19 on each Node/Bun), including both original UI regression files and the held-history pair. Run: https://github.com/openclaw/openclaw/actions/runs/44514086897. Source and all 931 workflow inputs matched; the delegated workload and lease closed successfully. Independent workload and custody reviews accepted this scoped proof. The cancelled carrier is normal lease cleanup, and this result is not attributed to the ordinary PR head or the whole parent validation.
  • Complete committed-range autoreview of 26b971ee932f87974cd0a69748ab6dbb94916889: one P0-only pass, zero findings, final source verification passed. Independent owner/sibling source reviews separately accepted the six-file repair. Hosted CI, security, and exact-head hosted review are pending.

Named follow-ups from the passing fixture logs: theme fixture cleanup does not restore bootstrap styles; pane-retirement mock responses omit the model/session arrays expected by their consumers. Both defects are unchanged from the parent and M996. They are outside this connection/history lifetime repair; no warnings were suppressed.

The private UI run also retained 104 STRICT_READ_UNTRACKED warnings, matching the baseline sequence, messages, locations, and per-case distribution. Named follow-up: file-view untracked reactive reads (solid-bridge-view.tsx:20, chat-sidebar-file-view.tsx:311). These are existing diagnostics, not intentional negative cases or proof of harmlessness; no warning was suppressed.

@vincentkoc vincentkoc self-assigned this Nov 19, 2026
@clawsweeper

clawsweeper Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@vincentkoc
vincentkoc marked this pull request as ready for review November 19, 2026 11:27
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper review

Please review exact head 26b971ee932f87974cd0a69748ab6dbb94916889, especially fixture connection/history retirement ordering, copied-host cleanup, and preservation of shared client/session ownership. The PR body records accepted focused proof and the three unchanged fixture follow-ups.

@clawsweeper

clawsweeper Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 19, 2026
@clawsweeper

clawsweeper Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR retires chat fixture connections and history reads before asynchronous cleanup can affect another test.

Example: A held history response finishes after the next test queues “Next fixture owns this row”.

  • Before: The retired fixture can send the next fixture’s queued message and remove its stored row.
  • After: The retired fixture cannot send the message, and the next fixture’s queue and stored row remain intact.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-consistent, with meaningful in-process regression coverage and no identified defect.
Proof confidence 🦐 gold shrimp (3/6) This repair changes test infrastructure only, so shipped-product proof is not required.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-authored repair addresses a concrete fixture isolation defect without changing product contracts or broadening scope.

Merge readiness

✅ Ready for maintainer review

This PR provides a focused fixture-lifetime repair that preserves shared ownership; no actionable correctness findings were identified at the reviewed head.

Priority: P2
Reviewed head: 26b971ee932f87974cd0a69748ab6dbb94916889

Before merge

None.

Findings

None.

Agent review details

How this fits together

Chat test helpers construct hosts around production history and outbox code; cleanup must retire each host before browser storage and globals are replaced.

flowchart TD
A[Chat test] --> B[Fixture host]
B --> C[History and outbox owners]
D[Test completion] --> E[Invalidate connection]
E --> F[Cancel effects and retire history]
F --> G[Join lazy imports]
G --> H[Release browser fixtures]
Loading

Technical review

Best possible solution:

Keep the shared host cleanup sequence and its cross-test regression while completing the existing exact-head CI gates.

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

Source establishes the history-to-outbox continuation and missing host retirement; the supplied regression targets that path, but this read-only review ran no tests.

Is this the best way to solve the issue?

The patch repairs fixture lifetime at existing owners, handles copied hosts, preserves shared clients and sessions, and retains the original deadline assertions.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 8a23d7c11d37.

Provenance checked

  • Host effect cleanup keeps the original intent (da70355: Retire dependent hosts and queued render effects before browser storage and globals disappear.)
  • Copied page-host fixtures keeps the original intent (b07bb23: Exercise real page-state ownership while preserving existing request mocks and behavioral assertions.)
  • Inflight session fixture keeps the original intent (1ad9fe2: Exercise concurrent history/session updates; removing local disposal preserves cleanup through the capability fixture’s existing disposal owner.)
  • Deadline regression suite keeps the original intent (719b2cf: Consolidate repetitive test setup while retaining behavioral contracts; the existing cases and assertions remain unchanged.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit da70355 adds ui/src/pages/chat/chat-host.test-support.ts:338 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: da703550e819; files: ui/src/pages/chat/chat-host.test-support.ts)

PR surface

Tests +134. Total +134 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 6 149 15 +134
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 149 15 +134

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: A concrete cross-test lifetime leak can invalidate chat regression results, with no production behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: A concrete cross-test lifetime leak can invalidate chat regression results, with no production behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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.

Reviewed November 19, 2026, 6:32 AM ET / 11:32 UTC.

@vincentkoc
vincentkoc merged commit 35181e6 into main Nov 19, 2026
165 of 166 checks passed
@vincentkoc
vincentkoc deleted the fix/ui-chat-fixture-retirement branch November 19, 2026 11:40
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 20, 2026
tideclaw-bot pushed a commit that referenced this pull request Nov 23, 2026
(cherry picked from commit 35181e6)

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 7e8eec5de0ea59e9bdf23bbd81241ed44f8f8e46)
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 P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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