Repository navigation
fix(chat): prevent retired prompts from reappearing - #134059
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 5:49 PM ET / 21:49 UTC. ClawSweeper reviewWhat this changesThe PR centralizes provisional chat-submission display and retirement under one Control UI projection owner, updates receipt-aware history handling, and migrates an isolated history fixture. Regression provenancePossible regression — suspected (failure trace). No predecessor PR is attributed. Merge readinessNo introduced correctness or security defect was found in the reviewed Control UI ownership path. This maintainer-owned PR remains necessary because the inspected current-main baseline still uses the older handoff/projection design; merge after required exact-head checks are confirmed green. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI combines local prompt submissions, Gateway history, custody state, and exact receipts into one rendered transcript. The changed owner decides when a local prompt remains visible and when authoritative records retire it. flowchart LR
A[Local prompt submission] --> B[Submission display owner]
C[Gateway history and receipts] --> B
D[Custody and queue state] --> B
B --> E[Transcript projection]
E --> F[Control UI chat pane]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +109, Tests +695, Docs +8. Total +812 across 68 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the app-owned submission/projection owner as the sole retirement path, with exact receipts and custody retiring local displays, then merge after required exact-head checks are green. Do we have a high-confidence way to reproduce the issue? Yes: inspected owner and browser tests define a concrete later-history, terminal-replay, and custody-retirement scenario, though this reviewer did not execute it locally. Is this the best way to solve the issue? Yes: one shared projection owner removes competing renderer, cache, and outbox display decisions without introducing persistence, configuration, or a compatibility fallback. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 508858da1d9a. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (10 earlier review cycles; latest 8 shown)
|
2361e6a to
4ea1843
Compare
|
Land-ready on 7cb26f6f67db. Exact-head CI 33442201524 completed successfully: 130 jobs passed, 13 intentionally skipped, zero failures, including real-Gateway UI. All three real main conflicts are integrated: accepted-input chronology, assistant-dock cleanup, and cloud restart/cancellation recovery. Exact pending/consumed receipts enter the single display-retirement owner; startup custody clears its hold without another optimistic prompt or resend. The lightweight identity reader preserves physical-session fencing. Failed history requests pause after ownership revalidation, before receipt lookup. No old consumption-only UI reader or duplicate display owner remains. Current proof is 746 owner/protocol/Gateway tests, 25 browser cases, and 61 isolated history/lifecycle tests, plus complete selected changed checks, UI/core-test types, zero runtime/type-aware cycles, and full build. Startup gzip is 346,909 B under the unchanged 347,353 B cap. Full runtime build/proof ran on The two failed jobs in superseded CI 33441479199 came from that same stale isolated-pane fixture: its retired Final fixture/aggregate commands: node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-isolated.config.ts --configLoader runner ui/src/pages/chat/chat-pane-history.test.ts ui/src/pages/chat/chat-pane-lifecycle.test.tsnode scripts/check-changed.mjspnpm check:architecturepnpm buildThe exact 746-case owner and 25-case browser commands are preserved in the PR Evidence section. Its earlier real-Gateway Testbox run used Final production delta is +671/−566, net +105; tests/support +1,150/−457, generated +7/−1, docs +10/−2. Remaining growth records retirement/local provenance across pane lifetimes and keeps display bytes separate from retry authority after two compression passes. The serialized-state detector is not applicable: the outbox file only adds a transient key helper. No schema, protocol producer, configuration, dependency, timeout, assertion, checker or budget was weakened or changed by this PR. The latest published ClawSweeper review on runtime |
8b05a77 to
719f471
Compare
|
@clawsweeper re-review Please refresh the review for Current proof: 746 owner/protocol/Gateway tests, 25 browser cases, 61 isolated history/lifecycle tests, complete selected checks, full build and zero runtime/type-aware cycles. Fresh complete-candidate and final test-only Codex reviews are P0 scoped-clean. Exact-head CI is running; the PR body records source identities, failures/fixes and proof limits. Review only; no repair branch or autofix is requested. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
Let the existing deferred assistant panel prepare page work context once, using the shell's validated route facts. Keep explicit agent ownership through global/main aliases and refresh the quoted reference when session, agent or Gateway snapshots change. Reuse the frozen refinement from PR #134059: 6e2a8f9550e6e6da957b0352fa674024f198118e. Add source-bound roster-refresh/send proof, extend the existing owner fixture for snapshot updates and cleanup, and regenerate the boot manifest for the pinned dependency graph. Startup gzip is 347243 B under the unchanged 347353 B gate. The UI repair removes two production lines net.
Use the captured main generation-scope contract in lifecycle and source/compiled provider-owner fixtures. Remove its retired config input while preserving provider selection and empty-generation fencing. Integrate captured main 10564e2 with the Home context refinement from PR #134059 and the assistant dock cleanup from PR #134435. Preserve the existing contributor credit and canonical catalog owner already on main. The integrated candidate passes the normal full build, scoped checks, 679 original-order model cases, 400 backend owner cases, both catalog E2Es, 290 UI cases and 18 browser cases. Final grouped startup gzip is 347299 B under the unchanged 347353 B enforcement limit.
Keep the app store responsible for bounded retained bytes and client lifetime. Move receipt adaptation and display retirement into the existing history projection owner, shared by both lazy chat consumers. Preserve missing-store behavior and the retained-prompt, attachment and reconnect contracts. Continue the retained-submission owner from PR #134059 (0f3e17e). Validation: 808 owner tests, 21 Chromium cases, grouped-bundle Home and retired-prompt proof, changed checks and fresh full-candidate autoreview. Startup gzip: 347588 -> 347320 bytes; unchanged limit 347353.
* chore(deps): refresh eligible seven-day npm dependencies * docs(plugins): align embedded TypeBox dependency pins * test(deps): align evidence and Escape ownership * fix(ci): repair native PID imports and cancellation assertions * test(ui): make effort Escape ownership explicit * fix(agents): keep error presentation on prepared policy * fix(agents): preserve loaded provider policy in error presentation * fix(agents): carry prepared provider owners into lifecycle errors Preserve endpoint-owned recovery guidance for custom provider routes in terminal events and callbacks. Reuse the prepared model handle and full-signal classifier, with a real Agent/AgentSession boundary regression. * fix(agents): reconcile explicit diagnostic ownership and structured errors Keep presentation on explicit prepared owners, preserve full assistant error facts ahead of generic request wrappers, and retain raw-schema diagnostics. Carry prepared owners into terminal observations and prove source/compiled scope boundaries. Complete the shared attempt fixture with the real model-handle getter. * fix(agents): carry full classified facts into safe failure copy Share explicit-owner assistant classification between direct formatting and the user-facing wrapper. Preserve structured codes, types and body evidence in safe provider/model/status copy, including message-less failures, while retaining raw-schema diagnostics and ownerless policy boundaries. * fix(ui): keep Home work context lazy and current Let the existing deferred assistant panel prepare page work context once, using the shell's validated route facts. Keep explicit agent ownership through global/main aliases and refresh the quoted reference when session, agent or Gateway snapshots change. Reuse the frozen refinement from PR #134059: 6e2a8f9550e6e6da957b0352fa674024f198118e. Add source-bound roster-refresh/send proof, extend the existing owner fixture for snapshot updates and cleanup, and regenerate the boot manifest for the pinned dependency graph. Startup gzip is 347243 B under the unchanged 347353 B gate. The UI repair removes two production lines net. * test(agents): align generation fixtures with prepared metadata Use the captured main generation-scope contract in lifecycle and source/compiled provider-owner fixtures. Remove its retired config input while preserving provider selection and empty-generation fencing. Integrate captured main 10564e2 with the Home context refinement from PR #134059 and the assistant dock cleanup from PR #134435. Preserve the existing contributor credit and canonical catalog owner already on main. The integrated candidate passes the normal full build, scoped checks, 679 original-order model cases, 400 backend owner cases, both catalog E2Es, 290 UI cases and 18 browser cases. Final grouped startup gzip is 347299 B under the unchanged 347353 B enforcement limit. * refactor(ui): keep submission projection in lazy chat owner Keep the app store responsible for bounded retained bytes and client lifetime. Move receipt adaptation and display retirement into the existing history projection owner, shared by both lazy chat consumers. Preserve missing-store behavior and the retained-prompt, attachment and reconnect contracts. Continue the retained-submission owner from PR #134059 (0f3e17e). Validation: 808 owner tests, 21 Chromium cases, grouped-bundle Home and retired-prompt proof, changed checks and fresh full-candidate autoreview. Startup gzip: 347588 -> 347320 bytes; unchanged limit 347353.
* fix(chat): prevent retired prompts from reappearing Centralize retained submission display and pane projection publication while keeping outbox retry authority separate. Record receipt retirement, preserve initial provenance across cache remounts, and remove duplicate handoff and identity paths. * refactor(chat): narrow custody projection owner type * test(ui): make replay proof capture opt-in * fix(ui): keep Home work context lazy and current * test(ui): migrate background-submit fixture to retained owner * refactor(ui): separate failed history from receipt lookup * test(ui): migrate paginated history receipt fixture
…3772) * chore(deps): refresh eligible seven-day npm dependencies * docs(plugins): align embedded TypeBox dependency pins * test(deps): align evidence and Escape ownership * fix(ci): repair native PID imports and cancellation assertions * test(ui): make effort Escape ownership explicit * fix(agents): keep error presentation on prepared policy * fix(agents): preserve loaded provider policy in error presentation * fix(agents): carry prepared provider owners into lifecycle errors Preserve endpoint-owned recovery guidance for custom provider routes in terminal events and callbacks. Reuse the prepared model handle and full-signal classifier, with a real Agent/AgentSession boundary regression. * fix(agents): reconcile explicit diagnostic ownership and structured errors Keep presentation on explicit prepared owners, preserve full assistant error facts ahead of generic request wrappers, and retain raw-schema diagnostics. Carry prepared owners into terminal observations and prove source/compiled scope boundaries. Complete the shared attempt fixture with the real model-handle getter. * fix(agents): carry full classified facts into safe failure copy Share explicit-owner assistant classification between direct formatting and the user-facing wrapper. Preserve structured codes, types and body evidence in safe provider/model/status copy, including message-less failures, while retaining raw-schema diagnostics and ownerless policy boundaries. * fix(ui): keep Home work context lazy and current Let the existing deferred assistant panel prepare page work context once, using the shell's validated route facts. Keep explicit agent ownership through global/main aliases and refresh the quoted reference when session, agent or Gateway snapshots change. Reuse the frozen refinement from PR openclaw#134059: 6e2a8f9550e6e6da957b0352fa674024f198118e. Add source-bound roster-refresh/send proof, extend the existing owner fixture for snapshot updates and cleanup, and regenerate the boot manifest for the pinned dependency graph. Startup gzip is 347243 B under the unchanged 347353 B gate. The UI repair removes two production lines net. * test(agents): align generation fixtures with prepared metadata Use the captured main generation-scope contract in lifecycle and source/compiled provider-owner fixtures. Remove its retired config input while preserving provider selection and empty-generation fencing. Integrate captured main a3310c7 with the Home context refinement from PR openclaw#134059 and the assistant dock cleanup from PR openclaw#134435. Preserve the existing contributor credit and canonical catalog owner already on main. The integrated candidate passes the normal full build, scoped checks, 679 original-order model cases, 400 backend owner cases, both catalog E2Es, 290 UI cases and 18 browser cases. Final grouped startup gzip is 347299 B under the unchanged 347353 B enforcement limit. * refactor(ui): keep submission projection in lazy chat owner Keep the app store responsible for bounded retained bytes and client lifetime. Move receipt adaptation and display retirement into the existing history projection owner, shared by both lazy chat consumers. Preserve missing-store behavior and the retained-prompt, attachment and reconnect contracts. Continue the retained-submission owner from PR openclaw#134059 (1ae5ba2). Validation: 808 owner tests, 21 Chromium cases, grouped-bundle Home and retired-prompt proof, changed checks and fresh full-candidate autoreview. Startup gzip: 347588 -> 347320 bytes; unchanged limit 347353.
Related: initial-image duplication repair and the original worktree-preparation report, both resolved. This is the explicitly maintainer-requested cleanup of the same chat ownership neighborhood.
What Problem This Solves
Retired chat prompts could reappear after a later history page omitted them and a terminal event replayed. Restoring an attributed initial prompt from the browser's stored snapshot could also leave two visible user sources. Renderer arrays, retained handoffs, delivered queue items and custody loading made overlapping ownership decisions.
Integration also exposed a Home-context startup/invalidation problem: the eager shell and deferred panel both prepared context, but moving preparation alone left the open reference stale after session renames. Global aliases could select another agent's row. Main independently removed the eager calculation while this PR was under validation; this PR preserves that cleanup and completes explicit page identity and model subscriptions.
Why This Change Was Made
The application owns retained submission display bytes and recorded retirement. One pane boundary owns transcript publication and custody reconciliation. The outbox still owns retry authority, attachment hydration, client/attempt fencing, durable removal and Blob release. Retained display bytes cannot trigger another send. Gateway admission remains separate from canonical persistence.
Removed reverse-importing renderer arrays, the full-queue-item display cache, initial-only wrappers, duplicate identity/key/classifier policy and quadratic entry matching. Presentation uses the existing shared classifier with linear occurrence-preserving reuse. Run-only updates skip unchanged transcript arrays. Message construction remains lazy.
The deferred Home panel owns both context preparation and subscriptions to the models it reads, with existing lifecycle cleanup. The shell supplies one typed route and explicit page session/agent facts. Raw global aliases retain their agent when matching a session row. The boot manifest was regenerated with its canonical generator.
Three real main conflicts were integrated rather than discarded: accepted-input chronology, assistant-dock rename/helper cleanup, and cloud restart/cancellation recovery. Transient custody rows use main's timestamp insertion without reordering canonical history. Main's exact
inputReceiptsnow enter the canonical retirement owner, including pending custody outside the displayed page. Startup receipt checks remain observational: accepted custody clears the hold without another optimistic source, resend or provisioning request.The exact receipt reader lives beside submission identity matching in the existing lightweight identity module, not the heavy send-support module. Failed history requests exit through the existing paused/unconfirmed outcome after ownership revalidation, rather than masquerading as an empty history array. Main's consumed-only v4 compatibility projection remains untouched; current UI code uses
inputReceiptsonly.User Impact
Retired prompts stay retired through terminal replay, later history pages and pane remount. Images and authoritative sender attribution survive canonical adoption. Intentionally identical sends remain distinct. Home references follow the viewed session's owner and update after roster-only changes. Cloud recovery respects retained/consumed custody without creating a duplicate local prompt.
No configuration, dependency, protocol producer or persistent-store schema change is introduced by this PR. The shared browser/TUI reducer's public sequence and identity semantics are unchanged.
outbox-store.tsonly gains a transient display-key helper; no serialized representation, database or migration changes.Evidence
Final head:
7cb26f6f67db808feb475f95858c5645f4f7bf96, based on mainbcf8e986c19d2850fbefa7bef50d8156fea62783. Exact-head CI 33442201524 completed successfully on this exact head: 130 jobs passed, 13 intentionally skipped, zero failures, including real-Gateway UI. Current native review artifacts recommendREADY FOR /prepare-pr; no accepted actionable findings remain.Current proof
check:changedgraph passed afterward, including core-test/UI types, lint and guards. Runtime and type-aware architecture checks report zero cycles.pnpm buildpassed on runtime head719f471a18e8bd08e6e83be08fb95f9a9dc51de0: 346,909 B startup gzip, eight requests, under the unchanged 347,353 B cap. Final head differs only by one test-fixture line; no runtime source changed afterward.Earlier proof and failure disposition
The original cleanup passed 1,021 tests across 20 files, complete selected checks, full build and independent review. Baseline consumed/canonical/canonical-first retirement replay, browser replay and stored-remount regressions fail for the intended reasons. The Home repair passed 167 owner/sibling tests and 18 browser cases; three global-owner cases failed before repair. Its browser regression passed the original shell, failed the lazy-only candidate when the sidebar renamed but Home stayed stale, then passed after model subscriptions were added, including the next send's quoted title.
The accepted-input integration passed 842 owner/sibling tests and 22 browser cases. The dock integration passed 91 focused tests and six browser cases, then CI 33437152932 passed on
8b05a77e3e5682e21f3549b6b8ade0d9ca34184b: 130 jobs passed, 13 skipped, zero failures, including real-Gateway UI. Native preparation passed too; the cloud recovery change landed before merge, requiring the subsequent receipt integration rather than reuse of stale preparation.CI 33441479199 on
719f471a18eexposed the remaining isolated-pane fixture in bothcheck-test-types-core-3andchecks-node-compact-large-22. The fetched logs identify the same retiredconsumptionsoption and older-page custody assertion reproduced locally. The one-line migration toreceiptswithstate: "consumed"fixes both; the superseded run was cancelled after the new push. Its failures are not classified as infrastructure noise.Earlier failures are retained: a type-aware import cycle fixed by narrowing the existing pane owner (emitted JavaScript unchanged); a pre-test GitHub checkout failure; an agent fixture timeout addressed by main's prepared-provider fix, dropping our redundant attempt; cold-worker setup timeouts and a diagnostic 105/104-file inventory mismatch; initial fixture-type errors and a rejected nonexistent selector. Receipt narrowing exposed a history/error union, fixed with an explicit error exit rather than a cast. An interrupted local build retained its ownership lock; its owner, child/process groups, worktree command lines and working-directory users were checked before removing only the abandoned task-owned claims. No timeout, assertion, mock boundary, checker or budget was weakened.
Startup budget
CI 33424828845 stopped three lanes at the same startup-size limit before tests, on merge
9e9eba1d5c52bad0bf7bf36d6c86731a29b64324.No dependency, threshold, baseline or variance allowance changed. The original before/after Home comparison independently summed actual HTML startup gzip files and verified 1,535 first-party source-map contents with zero mismatches. Later required integrations have their own builds; they are not claimed byte-identical to that earlier source.
Real-Gateway proof and limits
Managed Testbox run 33385316113, provider
blacksmith-testbox, leasetbx_01m1bqx4nx76mq7a0bpxw3hmwt, passed on834957b8e4188677831bf633d90c7783655438b3with frozen install/full build. Actual New Session, project registration, managed worktree setup, custody, canonical promotion, completion, hard reload/remount and a deliberate identical second send were exercised. All 247 observed initial-transition frames retained one prompt and one decoded image; the HTTP fixture received the 68-byte PNG. Reload retained one canonical user; the second send produced a distinct canonical user ID. There were zero page errors, external requests or served-asset mismatches; 66 JavaScript assets were checked.Only external OpenAI HTTP was mocked: this is real isolated Gateway/browser proof, not authenticated provider/Codex-backend proof. It is evidence for that recorded source, not every later hash. Later browser cases use bundled UI with mocked Gateway transport; the receipt producer also has real history-handler/store boundary tests. The Testbox was independently verified completed; owned processes exited and synthetic state was removed. A post-success portal-sync timeout warning remains recorded, with cleanup verified separately.
Replay screenshots/video are opt-in through existing
OPENCLAW_UI_E2E_ARTIFACT_DIR. All three handoff/replay cases passed in both modes; default retained-directory inventories stayed unchanged. Enabled capture uses the existing exclusive allocator and produced four PNGs plus one video, inspected across all 134 frames. No capture setting was added.Current validation commands
Scope and review disposition
Production: +671/−566, net +105. Tests/support: +1,150/−457. Generated manifest: +7/−1. Docs: +10/−2. Two compression passes removed avoidable growth. The app-owned retirement/provenance record and lightweight receipt-reader boundary account for remaining growth: retaining retry-capable outbox objects or inferring retirement from a missing history page violates demonstrated contracts. Main's independent eager-work deletion is excluded; remaining Home ownership repair is net +2 production lines. Classification allocations remain.
The earlier ClawSweeper conflict/rank-up requests are addressed by direct current-main/sibling inspection, preserved ownership and repeated proof. The stored-data detector is not applicable: the outbox diff is only a transient key helper. A fresh read-only review was requested. The latest published review, on runtime head
719f471a18eat 21:33 UTC, found no discrete correctness issue; its current-head CI/rank-up requirement is now satisfied. The only later change is the verified test-fixture migration. Maintainer direction is the explicit cleanup-and-land request; no changed path matches a restricted CODEOWNERS rule. Native merge still revalidates GitHub enforcement; no label or review-policy bypass is requested.Inspected synthetic media
All seven media assets were inspected. The one-pixel PNG is visually inconspicuous; decoded-image instrumentation proves continuity. Home captures show rename states on the repaired UI, not pre-patch/post-patch screenshots. The separate hard-refresh image flash landed independently and is already in this base; it is not attributed to this PR. No operator Gateway, live configuration, credentials or unrelated checkout changed. No transcripts or raw provider logs are included.
Real-Gateway setup/custody and promotion:
attachment-50552318.mp4
Real-Gateway refresh/remount and deliberate identical second send:
attachment-3946965942.mp4
attachment-3882720608.mp4