Skip to content

fix(chat): prevent retired prompts from reappearing - #134059

Merged
steipete merged 7 commits into
mainfrom
refactor/chat-input-ownership-cleanup
Aug 31, 2026
Merged

steipete merged 7 commits into
mainfrom
refactor/chat-input-ownership-cleanup

Conversation

@steipete

@steipete steipete commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

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 inputReceipts now 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 inputReceipts only.

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.ts only gains a transient display-key helper; no serialized representation, database or migration changes.

Evidence

Final head: 7cb26f6f67db808feb475f95858c5645f4f7bf96, based on main bcf8e986c19d2850fbefa7bef50d8156fea62783. 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 recommend READY FOR /prepare-pr; no accepted actionable findings remain.

Current proof

  • Receipt integration passed 746 owner/protocol/Gateway tests across 19 files, covering startup delivery/disconnect/Stop, placement recovery, outbox identity/Blob recovery, retirement, cached/retained panes, the shared reducer, wire schema and the real history-handler boundary. 25 browser cases across five files passed, including cloud startup/recovery, Home updates, handoff/replay and prompt attachments.
  • Final isolated-pane correction passed 61 history/lifecycle tests, preserving the original older-page → terminal → custody execution order. The complete selected check:changed graph passed afterward, including core-test/UI types, lint and guards. Runtime and type-aware architecture checks report zero cycles.
  • Full pnpm build passed on runtime head 719f471a18e8bd08e6e83be08fb95f9a9dc51de0: 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.
  • Fresh complete-candidate independent Codex autoreview was P0 scoped-clean, confidence 0.96. The final one-line fixture migration was separately P0 scoped-clean, confidence 0.99. Review did not execute tests; executable proof is separate.
  • The unmigrated receipt consumer failed six existing boundary cases. The pending/consumed replay cases also failed before migration while canonical cases passed. The last stale isolated-pane fixture failed its original-order test and core-test typing before correction; assertions were not relaxed.

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 719f471a18e exposed the remaining isolated-pane fixture in both check-test-types-core-3 and checks-node-compact-large-22. The fetched logs identify the same retired consumptions option and older-page custody assertion reproduced locally. The one-line migration to receipts with state: "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.

Measurement Startup JavaScript gzip Result
Exact failing merge, original frozen dependencies 347,539 B Over budget
Refined lazy owner, same base/dependencies 346,822 B Pass
Canonical manifest regeneration and full build 346,841 B Pass
Accepted-input integration 346,903 B Pass
Dock integration 346,892 B Pass
Final receipt runtime integration 346,909 B Pass

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, lease tbx_01m1bqx4nx76mq7a0bpxw3hmwt, passed on 834957b8e4188677831bf633d90c7783655438b3 with 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

node scripts/run-vitest.mjs ui/src/app/session-placement-startup.delivery.test.ts ui/src/app/session-placement-startup.test.ts ui/src/app/session-placement-startup.disconnect.test.ts ui/src/app/session-placement-startup.stop.test.ts ui/src/lib/sessions/session-placement-startup.test.ts ui/src/app/chat-submissions.test.ts ui/src/pages/chat/history-merge.test.ts ui/src/pages/chat/chat-pending-inputs.test.ts ui/src/pages/chat/chat-send.test.ts ui/src/pages/chat/chat-send-submit.test.ts ui/src/pages/chat/outbox-identity.test.ts ui/src/pages/chat/outbox-blob-recovery.test.ts ui/src/pages/chat/chat-pane-snapshot-hydration.test.ts ui/src/pages/chat/chat-pane-attachment-handoff.test.ts ui/src/pages/chat/chat-page-attachment-handoff.test.ts ui/src/pages/chat/chat-pane-retained-presentation.test.ts packages/gateway-client/src/session-projection.test.ts packages/gateway-protocol/src/schema/logs-chat.test.ts src/gateway/server-methods/chat-history-handler.test.ts
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/new-session-page.cloud-startup.e2e.test.ts ui/src/e2e/new-session-page.cloud-startup.recovery.e2e.test.ts ui/src/e2e/assistant-panel-context.e2e.test.ts ui/src/e2e/chat-send-pending-handoff.e2e.test.ts ui/src/e2e/new-session-page.prompt-attachments.e2e.test.ts
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.ts
node scripts/check-changed.mjs
pnpm check:architecture
pnpm build

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 719f471a18e at 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.

Before: terminal replay resurrects the retired prompt

After: terminal replay leaves the prompt retired

Real-Gateway setup/custody and promotion:

attachment-50552318.mp4

Real-Gateway refresh/remount and deliberate identical second send:

attachment-3946965942.mp4

Home reference before the synthetic session rename

Open Home reference follows the synthetic session rename

attachment-3882720608.mp4

@steipete steipete self-assigned this Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: XL maintainer Maintainer-authored PR labels Aug 31, 2026
@steipete
steipete marked this pull request as ready for review August 31, 2026 10:57
@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. 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 Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 5:49 PM ET / 21:49 UTC.

ClawSweeper review

What this changes

The 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 provenance

Possible regression — suspected (failure trace). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No 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
Reviewed head: 7cb26f6f67db808feb475f95858c5645f4f7bf96

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The ownership refactor has focused lifecycle coverage and supplied real runtime evidence, with exact-head required-check confirmation remaining before merge.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The supplied PR evidence records an isolated Gateway-to-Chromium run of retained-prompt retirement and hydration, while inspected owner and browser tests cover the final fixture update; the full CI rollup was unavailable to refresh from this checkout.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The supplied PR evidence records an isolated Gateway-to-Chromium run of retained-prompt retirement and hydration, while inspected owner and browser tests cover the final fixture update; the full CI rollup was unavailable to refresh from this checkout.
Evidence reviewed 8 items Display ownership and receipt retirement: The app-owned submission store bounds initial and delivered display entries, retires only on custody or durable receipt, and keeps outbox retries outside this display owner.
Canonical projection boundary: History reduction, custody reconciliation, and submission admission route through the same pane-owned projection publication boundary, preventing independent transcript copies from deciding visibility.
History receipt application: Hydration applies a receipt batch only when the physical session incarnation matches, after the authoritative history projection is reduced.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

  • Resolve merge risk (P1) - This broad transient transcript-state refactor affects cache hydration, pagination, custody, and terminal replay; confirm required checks for 7cb26f6 remain green before merge, since the complete live CI rollup could not be refreshed from this offline checkout.
  • Complete next step (P2) - No repair branch is requested or indicated; retain the maintainer-owned PR for exact-head CI confirmation and normal merge handling.
Agent review details

Security

None.

PR surface

Source +109, Tests +695, Docs +8. Total +812 across 68 files.

View PR surface stats
Area Files Added Removed Net
Source 41 689 580 +109
Tests 25 1139 444 +695
Docs 2 10 2 +8
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 68 1838 1026 +812

Review metrics

Metric Value Why it matters
Production versus test delta production +643/-565; tests/support +1146/-456; generated +7/-1; docs +10/-2 The positive production delta is tied to consolidating one transcript and custody ownership boundary; the much larger test delta exercises lifecycle and replay permutations.

Stored data model

Persistent data-model change detected: serialized state: ui/src/lib/chat/outbox-store.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Confirm exact-head validation (recommended)
    Confirm the required checks for 7cb26f6 are green before merging this transcript-state ownership refactor.
  2. Pause on a failing required check
    Keep the PR open if an exact-head required check fails until its relationship to this state-projection change is resolved.

Technical review

Best 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.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The supplied PR evidence records an isolated Gateway-to-Chromium run of retained-prompt retirement and hydration, while inspected owner and browser tests cover the final fixture update; the full CI rollup was unavailable to refresh from this checkout.

Label justifications:

  • P2: This is a bounded Control UI transcript-state repair with limited user blast radius.
  • merge-risk: 🚨 session-state: The PR changes how provisional submissions, custody receipts, history pages, and cache hydration determine visible transcript state.
  • 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 (linked_artifact): The supplied PR evidence records an isolated Gateway-to-Chromium run of retained-prompt retirement and hydration, while inspected owner and browser tests cover the final fixture update; the full CI rollup was unavailable to refresh from this checkout.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied PR evidence records an isolated Gateway-to-Chromium run of retained-prompt retirement and hydration, while inspected owner and browser tests cover the final fixture update; the full CI rollup was unavailable to refresh from this checkout.

Evidence

Acceptance criteria:

  • [P1] Confirm required exact-head CI checks at 7cb26f6 are green.

What I checked:

Likely related people:

  • steipete: 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.

  • Confirm the required exact-head CI checks for 7cb26f6 before merge.

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 (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-31T16:08:16.298Z sha 2361e6a :: needs changes before merge. :: [P2] Gate replay-proof capture behind the configured artifact switch
  • reviewed 2026-08-31T16:32:04.354Z sha 2361e6a :: found issues before merge. :: [P2] Make replay-proof capture opt-in
  • reviewed 2026-08-31T16:40:48.024Z sha 4ea1843 :: needs changes before merge. :: [P2] Gate replay-proof capture behind the artifact switch
  • reviewed 2026-08-31T18:31:26.854Z sha 897871ecff1dfe9d184345bc53022c9d3dcb7b87 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-31T20:06:09.622Z sha 2b393eb28e7cd10db723cc60f9527c08b5bf0c7e :: needs maintainer review before merge. :: none
  • reviewed 2026-08-31T20:51:03.994Z sha 8b05a77e3e5682e21f3549b6b8ade0d9ca34184b :: needs maintainer review before merge. :: none
  • reviewed 2026-08-31T21:02:20.789Z sha 8b05a77e3e5682e21f3549b6b8ade0d9ca34184b :: needs maintainer review before merge. :: none
  • reviewed 2026-08-31T21:33:33.612Z sha 719f471 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. 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. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Aug 31, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Aug 31, 2026
@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label Aug 31, 2026
@steipete
steipete force-pushed the refactor/chat-input-ownership-cleanup branch from 2361e6a to 4ea1843 Compare August 31, 2026 16:34
@openclaw-barnacle openclaw-barnacle Bot removed the agents Agent runtime and tooling label Aug 31, 2026
@steipete

steipete commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor Author

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 719f471a18e; final 7cb26f6 changes only one test-fixture line. Fresh complete-candidate independent Codex review was P0 scoped-clean, and the final test-only correction was separately P0 scoped-clean. Review did not execute tests.

The two failed jobs in superseded CI 33441479199 came from that same stale isolated-pane fixture: its retired consumptions option failed typing and the original older-page → terminal → custody assertion. Both were reproduced locally and corrected by migrating the fixture to receipts with state: "consumed"; assertions were unchanged. Six earlier receipt-boundary failures and the pending/consumed terminal-replay regressions also fail before the owner migration and pass afterward.

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.ts
node scripts/check-changed.mjs
pnpm check:architecture
pnpm build

The exact 746-case owner and 25-case browser commands are preserved in the PR Evidence section. Its earlier real-Gateway Testbox run used blacksmith-testbox, lease tbx_01m1bqx4nx76mq7a0bpxw3hmwt, on source 834957b8e4188677831bf633d90c7783655438b3; it is not claimed to have tested later hashes. External provider HTTP was mocked, not authenticated provider/Codex-backend proof. The lease and owned processes/state were cleaned. All seven published media assets were inspected and are synthetic-only. Capture remains opt-in through the existing artifact setting and allocator.

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 719f471a18e found no discrete correctness issue; its exact-head validation/rank-up request is now satisfied. A fresh read-only review was also requested. This is explicitly maintainer-directed work, and no changed path matches restricted CODEOWNERS routing. Current native artifacts recommend READY FOR /prepare-pr; native prepare/merge will revalidate server enforcement. No operator Gateway restart, deployment or release is part of this work.

@clawsweeper clawsweeper Bot added 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. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 31, 2026
@steipete
steipete force-pushed the refactor/chat-input-ownership-cleanup branch from 8b05a77 to 719f471 Compare August 31, 2026 21:27
@clawsweeper clawsweeper Bot added merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. labels Aug 31, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Please refresh the review for 7cb26f6f67db808feb475f95858c5645f4f7bf96. It integrates main's cloud recovery/exact input receipts into the single retained-display/projection owner, preserves accepted custody without another optimistic handoff, and keeps receipt lookup in the lightweight identity module. The remaining isolated-pane fixture is migrated without changing its assertions.

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.

@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Aug 31, 2026
@steipete
steipete merged commit 0f3e17e into main Aug 31, 2026
180 checks passed
@steipete
steipete deleted the refactor/chat-input-ownership-cleanup branch August 31, 2026 21:57
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Aug 31, 2026
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.
steipete added a commit that referenced this pull request Aug 31, 2026
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.
steipete added a commit that referenced this pull request Aug 31, 2026
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.
steipete added a commit that referenced this pull request Aug 31, 2026
* 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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 1, 2026
* 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
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 1, 2026
…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.
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 docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. 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. 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