Skip to content

fix(ui): main-session queued follow-ups use the wrong recovery history - #133067

Merged
steipete merged 7 commits into
mainfrom
steipete/serene-blackwell-2ceba5
Aug 30, 2026
Merged

steipete merged 7 commits into
mainfrom
steipete/serene-blackwell-2ceba5

Conversation

@steipete

@steipete steipete commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #133059

Related: #132233 (generation-safe deletion/fixture follow-up), #133052 (landed large-attachment Blob storage), and #133085/#133149 (selected-session presentation ownership).

Merged to main as d708507a498b6cc2654ac5aa422f67cab6011a2f through native squash preparation/merge, from exact reviewed head d35363d5eff30f2200cd5c01df17deb5c5fcee81. Exact-head CI is green, with independently audited complete mocked-browser coverage (330 files / 1,337 tests, zero skips) and passing clean-Linux static/build/architecture proof. Native merge receipt. The earlier interrupted manual sweep is recorded below and is not counted green. This is a merge, not a release announcement.

What Problem This Solves

A follow-up queued in an agent's main conversation could remain parked after the current run finished, or remain unconfirmed after delivery, because browser outbox recovery read the separate global conversation. The mock Gateway concealed that mistake by returning one history/startup session ID for different keys. Its selected route also implicitly became configured main, and pin/archive patches did not maintain canonical timestamps.

Why This Change Was Made

Give fixture identity/metadata one per-key owner and resolve new browser outbox admissions through the configured canonical conversation identity. Captured persisted destinations stay immutable. Ordinary list/describe/history/startup responses agree; deliberate stale/case/sequence/deferred wire responses remain fault injection. Successful mutations commit at their response boundary; failed or unresolved operations do not.

The explicitly approved conservative migration writes a distinct v4 metadata namespace, importing v1/v2/landed-v3 while preserving messages, drafts, attachments, ordering, revisions, original attempt/run IDs and delivery uncertainty. Independently identifiable destinations migrate automatically. Ambiguous input remains unsent until an operator confirms an empty non-Incognito destination. Failed/no-op transfers retain sources, receipts fence replay, whole-source overflow is deferred without truncation, and newer-input CAS plus connection/incarnation checks remain intact. The independent durable-draft identity namespace remains unchanged.

The integration reuses the landed IndexedDB v2 opener/stores and scope-free queued Blob references. Retention accounts for raw active and recovery records across credentials: moving an entry into recovery is not retirement. Mixed-principal recovery is partitioned by existing payload ownership without exposing foreign rows. Exact queue/reference/Gateway/recovery/source-tab ownership, complete-batch validation, copied-tab uncertainty and held-lock-only deletion remain intact. Verified metadata commit/removal precedes byte cleanup. Pending recovery readiness cannot settle an awaited payload operation.

Canonical targets are captured before async Blob work and carried into admission. Admission success comes from the verified storage write, not a later credential-filtered projection after synchronous notifications. Related repairs respect advertised main identity, retain unsaved queued-edit custody, bind edit actions to immutable conversation/Gateway/recovery ownership, and preserve newer same-agent metadata when delayed history arrives. Main's selected-session implementation is reused; task detail compares the complete conversation identity rather than only global. The browser committed-state helper awaits async predicates and exact IndexedDB transaction completion. No timeout or generation check is weakened.

User Impact

Queued input stays with its captured conversation and agent across reloads, split panes and default/agent changes. Older ambiguous input gets a visible Saved messages need a destination recovery flow. Recovered entries remain paused for review/Retry; attempted messages keep delivery uncertainty, and drafts return without sending. Stale confirmation cannot overwrite newer input or silently discard an unsaved correction.

Large attachments retain their existing 25 MiB per-input / 250 MiB origin bounds, credential filtering and Blob lifetime guarantees. No claim is made to fix the distinct restored-idle queue wakeup repair.

Documentation change: docs/web/control-ui.md; public page https://docs.openclaw.ai/web/control-ui#chat-behavior (the PR's new wording is not yet deployed).

Evidence

  • Final exact-head proof: CI 33309378076, attempt 1, is green. All 13 canonical Control UI shards ran 330 distinct mocked-browser files exactly once, with 1,337 passed tests and zero failures/skips/todos. Raw logs, hashes, terminal summaries and the complete path union were independently verified, including the 13 suites under ui/src/pages/. All logs ran merge deae51f3604503869ce6e5198bf90afa45d354a7, whose parents are main 4306140e0b8824fc8e41f19bdf1ef119e37247d9 and the exact PR head. Matrix row 14 is a separate browser-extension job; it and the real-Gateway UI lane also passed and are excluded from the 330/1,337 totals.
  • Final clean-Linux gates: Testbox 33309439352, provider Blacksmith Testbox, ran the exact head with 70 tests in three whole owner files, complete changed gates, explicit full architecture checks and normal build 345,779 B / 346,761 B, all passing. Full source fingerprints matched before and after; wrapper exit 0. The owned lease was stopped and independently verified completed.
  • Original reproduction: truthful per-key fixtures make a main-session follow-up request chat.history({sessionKey:"global",agentId:"main"}) and remain queued. Real Gateway main/list/history/patch contracts were inspected. Raw-parent history identifies fix(ui): queue chat input while reconnecting #102781 (reconnect queue admission); feat(ui): surface queued-outbox counts in composer hint, session rows, and offline footer #112649 (outbox split) carried it forward.
  • Current integrated red/green: three unchanged boundary probes first rejected ordinary landed-v3 envelopes/dropped an opaque Blob reference, then passed. Additional pre-fix failures cover changed defaults during deferred preparation, credential changes after a verified admission, pending connected recovery during a payload read, and retirement under changed main defaults.
  • Current complete-file local proof: 20 shared files / 1,166 tests, four isolated files / 32 tests, and 11 native-Chromium mocked-Gateway files / 58 tests, all passing with zero skips. Browser coverage includes multi-megabyte complete transport batches, v3 migration/reload/recovery/retry/retirement, copied-tab custody, quota/no-op failures, mixed credentials, composer drafts, queue edits/reordering, deletion, history recovery and attachment lifecycle. Original IDs/attempts and exact bytes are asserted.
  • Current static/build proof: all 16 core-test type shards, UI compiler, matching type-aware lint, installed formatter, staged whitespace checks and normal build passed. Startup gzip 345,676 B / 346,761 B, unchanged limit. All 22 source groups / 35,464 files, including executable/link kind, match the reviewed staged tree and committed source.
  • Current independent review: two complete integration-bundle passes plus a fresh five-file type-relocation review, all P0-scoped clean with no accepted/actionable findings. This is the selected review scope/threshold, not a blanket correctness certificate.
  • Clean-Linux integration proof: run 33307657128, source d05c8a3b1d7d66f752c89cacb2530b783708d85f, passed package UI 835 files / 12,791 tests (one existing skip), root shared 784 files / 12,142 tests (20 existing file exclusions / 86 skipped tests), isolated 31 files / 563 tests (one existing skip), complete changed gates and normal build 345,769 B / 346,761 B. These lanes overlap. Source fingerprints matched. Its separate manual three-shard browser sweep stopped incomplete with two Vitest worker EPIPE errors, then remote command exit 255; the wrapper failure is authoritative despite the lease's underlying Actions job reporting success. The lease was stopped and independently verified completed. No complete browser result is claimed from that run.
  • Type-cycle correction: hosted CI 33307705166 caught a Madge cycle through the shared attachment type; a local pre-fix run reproduced it. The type moved unchanged into existing chat-types.ts, with all consumers migrated and no compatibility re-export. All five changed files emit byte-identical JavaScript versus the integration head. Full local architecture gate, both compiler programs, 70 tests in three whole owner files, lint/format and normal build 345,617 B / 346,761 B pass. The final exact-head Linux and hosted browser proof above both pass.
  • Historical breadth, not current composition proof: run 33298268840 passed all 326 mocked-browser files / 1,316 tests, package UI 833 / 12,683, root shared 782 / 12,034 and isolated 31 / 563 on earlier source. Those unit lanes overlap. Run 33300501356 passed earlier complete changed gates. Run 33302983286 passed the earlier five-file browser integration on Linux; its changed check was plan-only. The unchanged native microphone setup failed to establish ICE on this Mac but passed on Linux; a separate follow-up records it, with no timeout/flag/production workaround.
  • Failures repaired, not waived: original hosted run 33292278338 exposed 24 UI unit failures plus the Work quota case. Compiler failures, obsolete identity/metadata fixtures and connected ownership failures were corrected through their actual contracts. No stable-release or production-deployment claim is made for main's newly landed v3 writer.

Visual proof: Four inspected synthetic recovery and Blob captures are published here, showing the paused legacy entry, explicit destination confirmation, retained uncertainty after reload, and preserved Blob attachment. The published image bytes match the inspected local captures. The earlier upload-tooling gap was resolved using the normal protected client after its 0.5.16 update; no policy, authentication, PATH or guard bypass was used.

Size relative to integrated main 8b7d685b2a9228a7aa98b5338b0ad8534777cace: production +1,547/-1,214 (net +333) across 43 files; tests/support +4,581/-1,394 (net +3,187) across 124 files; docs +28/-2 (net +26). Positive production growth funds the approved data-preserving recovery capability and ownership boundaries. Core store, extracted retirement and composer persistence are net -27, -25 and -63 respectively; duplicate identity/routing paths were removed.

No new dependency, product configuration, Gateway protocol, SQLite or IndexedDB schema change. No release/changelog work, operator Gateway/state changes, or agent transcripts.

@clawsweeper

clawsweeper Bot commented Aug 30, 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 scripts Repository scripts size: XL maintainer Maintainer-authored PR labels Aug 30, 2026
@steipete steipete self-assigned this Aug 30, 2026
@steipete
steipete marked this pull request as ready for review August 30, 2026 04:20
@steipete
steipete force-pushed the steipete/serene-blackwell-2ceba5 branch from 3428766 to 1e4ebfd Compare August 30, 2026 08:03
Give mocked Gateway sessions one per-key identity and metadata owner while
preserving explicit stale-response fault injection. Separate selected routes
from configured main and maintain canonical pin/archive timestamps.

Repair the main/global outbox alias collapse exposed by truthful fixtures.
Preserve browser queues, drafts, attachments and original send attempts during
migration; retain ambiguous legacy destinations unsent for explicit recovery.
Keep captured identity, generation, connection and newer-input CAS fences.

Fix async committed-state browser probes and remove redundant identity and
routing adapters. Full mocked-browser proof passes 322 files / 1305 tests,
complete changed checks and the normal Linux UI build before integration.
Honor advertised main-session identity and carry canonical per-agent metadata into the composer. Preserve immutable queued-edit ownership across routing and recovery changes without discarding unsaved corrections or weakening replacement CAS. Migrate affected fixture and storage assertions, with real history/reconnect boundary regressions.
Keep Work quota list and startup facts in one fixture, route split tool-title scenarios explicitly, and emit typing events for their actual owning agent. Preserve generation, freshness, pruning and sender-provenance assertions.
@steipete
steipete force-pushed the steipete/serene-blackwell-2ceba5 branch from 1e4ebfd to 275cfb1 Compare August 30, 2026 09:15
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready verification for d35363d.

The canonical fixture/admission repair and approved conservative recovery are complete, including the landed Blob-storage contract. Captured destinations, original IDs/attempts, delivery uncertainty, byte custody and generation/CAS checks remain protected. The final CI-discovered import cycle was removed by relocating the shared attachment type; all five affected files emit identical JavaScript before/after that correction. No schema, storage-limit, configuration, dependency or test-timeout increase.

Exact-head CI: 33309378076, attempt 1, green. All thirteen Control UI shard logs were audited and independently rechecked against the full discovered inventory: 330 files exactly once, 1,337 passed tests, zero failures/skips/todos. Every log checked out merge deae51f3604503869ce6e5198bf90afa45d354a7, with main parent 4306140e0b8824fc8e41f19bdf1ef119e37247d9 and exact PR head as the other parent. Browser-extension row 14 and real-Gateway UI succeeded separately, excluded from those totals. Current main's inspected chat/session/draft owners have no further changes beyond that tested main parent.

Clean-Linux proof: 33309439352, Blacksmith Testbox coral-lobster, exact head, wrapper exit 0. Seventy tests in three whole owner files, complete changed gates, full architecture checks and normal build passed. Startup gzip 345,779 B / 346,761 B, unchanged limit; complete source fingerprints matched before/after. The owned lease is stopped and independently verified completed.

Commands executed for the final focused/static proof:

node scripts/run-vitest.mjs run --config test/vitest/vitest.ui.config.ts --configLoader runner --maxWorkers 2 ui/src/pages/chat/outbox-blob-recovery.test.ts ui/src/pages/chat/composer-persistence.test.ts
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-isolated.config.ts --configLoader runner --maxWorkers 2 ui/src/pages/new-session/draft-persistence.test.ts
node scripts/check-changed.mjs --base origin/main --head HEAD --timed
corepack pnpm check:architecture
node scripts/ui.js build

The canonical browser command was:

node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner --shard "$SHARD_INDEX/$VITEST_SHARD_COUNT"

It ran with shard indices 1–13, count 13, and OPENCLAW_UI_E2E_SKIP_REAL_GATEWAY=1. Earlier full package/shared/isolated UI and integrated native-browser proof, compiler commands, red/green reproductions and explicit existing unit-lane exclusions are retained in the PR body; overlapping totals are not added together.

Fresh complete-candidate and final type-only independent reviews returned no accepted P0 findings. Native review artifacts validate with READY FOR /prepare-pr. Latest ClawSweeper comment is its acknowledgement, with no actionable Rank-up list. Effective main rules require the CI gate and linear history; no admin bypass is being used.

Proof gaps and retries: the earlier manual three-shard browser sweep was interrupted by worker EPIPE and remote exit 255 after the lease reported idle shutdown; it is not counted green. The final canonical 330-file run supplies complete browser proof. Current synthetic recovery/Blob before-and-after-state captures were personally inspected, but normal gh --attach is rejected by the client's rewrite guard. They remain local; no alternate-client/curl/guard workaround or successful upload is claimed. The separate macOS microphone setup and Testbox lease/reporting issues are recorded as follow-ups, without weakening tests.

Final LOC: production +1,547/-1,214 (net +333); tests/support +4,581/-1,394 (net +3,187); docs +28/-2. The approved data-preserving recovery capability accounts for the production growth; duplicate identity/routing paths were removed. Proceeding through native preparation and squash merge.

@steipete
steipete merged commit d708507 into main Aug 30, 2026
176 checks passed
@steipete
steipete deleted the steipete/serene-blackwell-2ceba5 branch August 30, 2026 12:16
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@steipete

Copy link
Copy Markdown
Contributor Author

Visual proof for the landed recovery repair

These are the previously recorded, personally inspected captures from the actual Control UI with synthetic fixtures. They contain no live operator data and are not edited mockups. They were captured on integration d05c8a3; the final shared-type relocation emitted identical JavaScript. The repair landed as d708507.

The updated upload client now permits the normal protected attachment path, closing the earlier media-publication gap. Full land-ready proof includes all 330 mocked-browser files / 1,337 passing tests with zero skips.

Before destination confirmation

Ambiguous saved input remains unsent and asks for a destination

Explicit confirmation

Recovery confirms the exact agent and conversation and keeps messages paused

After confirmation and reload

Recovered message remains delivery-unconfirmed with an explicit Retry action

Landed-v3 attachment retained

Original Blob attachment survives destination recovery and reload without automatic replay

Confirmation does not send. Uncertain messages remain paused until explicit Retry; browser assertions separately verify original IDs/attempts and complete attachment bytes through transport and eventual retirement.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 31, 2026
openclaw#133067)

* fix(ui): keep queued messages bound to their conversation

Give mocked Gateway sessions one per-key identity and metadata owner while
preserving explicit stale-response fault injection. Separate selected routes
from configured main and maintain canonical pin/archive timestamps.

Repair the main/global outbox alias collapse exposed by truthful fixtures.
Preserve browser queues, drafts, attachments and original send attempts during
migration; retain ambiguous legacy destinations unsent for explicit recovery.
Keep captured identity, generation, connection and newer-input CAS fences.

Fix async committed-state browser probes and remove redundant identity and
routing adapters. Full mocked-browser proof passes 322 files / 1305 tests,
complete changed checks and the normal Linux UI build before integration.

* fix(ui): preserve scoped metadata and queued-edit custody

Honor advertised main-session identity and carry canonical per-agent metadata into the composer. Preserve immutable queued-edit ownership across routing and recovery changes without discarding unsaved corrections or weakening replacement CAS. Migrate affected fixture and storage assertions, with real history/reconnect boundary regressions.

* fix(ui): type queued-edit recovery through the client contract

* test(ui): align session fixtures with typed gateway contracts

* test(ui): keep incoming session fixtures coherent

Keep Work quota list and startup facts in one fixture, route split tool-title scenarios explicitly, and emit typing events for their actual owning agent. Preserve generation, freshness, pruning and sender-provenance assertions.

* fix(ui): keep attachment types outside storage runtimes
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 scripts Repository scripts size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Main-session outbox recovery can query global history and leave queued messages parked

1 participant