Repository navigation
refactor(ui): centralize chat outbox projections - #117284
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 5:13 AM ET / 09:13 UTC. ClawSweeper reviewWhat this changesThis PR replaces separate Control UI chat-outbox caches with one browser-tab- and Gateway-scoped owner that projects stored queue rows and live send state to subscribed chat panes. Merge readinessKeep this PR open for Control UI owner review before merge. The branch has strong targeted proof and no concrete patch defect found in this read-only pass, but it changes the authoritative reconciliation of durable, in-flight, and pane-local outbox state across route switches and split panes. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI chat page queues messages in browser session storage while sends and local commands are in progress. Chat panes subscribe to an outbox projection so route changes, split panes, storage events, and send acknowledgements present the correct queued rows. flowchart LR
A[Chat pane] --> B[Outbox projection subscription]
C[Session storage rows] --> D[Tab and Gateway outbox owner]
E[Live send and command state] --> D
D --> F[Route-aware queue projection]
F --> G[Subscribed chat panes]
G --> H[Send drain and transcript updates]
Decision needed
Why: The tests and CI support the refactor, but choosing the durable ownership model for cross-pane session state is an architectural responsibility decision rather than a mechanically provable patch detail. Before merge
Agent review detailsSecurityNone. PR surfaceSource -5, Tests -1. Total -6 across 15 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Adopt one tab- and Gateway-scoped outbox owner if the Control UI owner agrees that durable rows, live sends, and pane-local recovery state belong in that single projection boundary, then merge only after the exact merge head retains the demonstrated route-switch and split-pane behavior. Do we have a high-confidence way to reproduce the issue? Yes. The branch contains focused source-level route-switch, split-pane, volatile-storage, and browser storage-event cases that exercise the reported stale-projection ordering paths; this read-only review did not execute them locally. Is this the best way to solve the issue? Yes, conditionally. Centralizing the projection removes the parallel caches and manual publication paths at the ownership boundary, but Control UI owner approval is still needed for the chosen long-term lifecycle semantics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0d8b70f39e44. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
f5f9ff2 to
c296c46
Compare
c296c46 to
b104a33
Compare
|
Merged via squash.
|
* origin/main: fix(update): keep rolled-back Git installs runnable (openclaw#117294) refactor(ui): centralize chat outbox projections (openclaw#117284) fix(sessions): preserve target rows during legacy migration (openclaw#117272) fix(security): detect multiline skill prompt injection (openclaw#117254) fix(qa): lease credentials for Telegram startup proof (openclaw#116842) refactor(memory): unify session ingestion (openclaw#117293) fix(channels): strip internal tool text in Reef and Zalo Personal (openclaw#112621) fix(ui): keep newer Appearance choices after delayed theme imports [AI-assisted] (openclaw#117292) fix(inference): simplify lifecycle and preserve Codex tool identity (openclaw#117298)
* origin/main: fix(update): keep rolled-back Git installs runnable (openclaw#117294) refactor(ui): centralize chat outbox projections (openclaw#117284) fix(sessions): preserve target rows during legacy migration (openclaw#117272) fix(security): detect multiline skill prompt injection (openclaw#117254) fix(qa): lease credentials for Telegram startup proof (openclaw#116842) refactor(memory): unify session ingestion (openclaw#117293) fix(channels): strip internal tool text in Reef and Zalo Personal (openclaw#112621) fix(ui): keep newer Appearance choices after delayed theme imports [AI-assisted] (openclaw#117292) fix(inference): simplify lifecycle and preserve Codex tool identity (openclaw#117298)
Summary
chatQueueByScope, projection-host, transient-projection, and manual publish pathsRoot cause
Chat outbox state had multiple owners: durable rows lived in session storage, live transport state lived in a process-global map, and each pane maintained its own scoped queue cache. Mutations had to manually update or publish all three representations. That made already-open panes stale, let late acknowledgements leak back into a newly selected route, and forced consumers to infer whether a row was durable, process-live, or an explicit storage-capacity fallback.
The canonical owner is now scoped to the actual browser-tab storage object and Gateway. It reads durable snapshots from the store, overlays only owner-recorded live or pane-local facts, and publishes one projection to subscribed panes. Its lifecycle retains a source pane while live work exists, then defers empty-owner eviction across synchronous send transitions. Foreground route presentation is retained only while that pane remains on the submitted route; restored durable rows use their canonical route.
Operator-visible behavior
chat.sendacknowledgement stays with the submitted session after the operator switches routes.global+ agent routing, while immediate foreground presentation keeps the route the operator used.Removed paths
chatQueueByScopechatOutboxProjectionHoststransientQueueProjectionsProof
tbx_01kyy1c3tne63vsbr424ms6weq(run): 317/317 focused UI tests passed (chat-send,chat-state,outbox-store);pnpm check:changedpassed every selected typecheck, lint, boundary, schema, storage, and import guard;pnpm ui:buildpassed Vite, 688 precompressed-sidecar checks, and Control UI performance budgetsb104a338911a: the focused changed-test router regression passes 1/1, 317/317 affected UI tests pass, and the completepnpm check:architecturechain passes locally, including zero runtime or Madge import cyclessessionStorage, dispatches its storage event, navigates from session B back to session A, and observes the outbox-triggered refresh only after that route flip; all four current-head hosted UI E2E shards passed in CI run 30692862626checks-ui,check-additional-runtime-topology-architecture, compact test shards, and the repaired Memory Core changed-test router regressiongpt-5.6-sol, xhigh): clean, no accepted/actionable findings (0.98 confidence)Scope