Skip to content

fix(ui): keep chat and drafts usable when connections fail - #162428

Merged
roboclaw-bot merged 19 commits into
mainfrom
openclaw/improve-offline-resilience-and-timeout-handling
Oct 1, 2026
Merged

roboclaw-bot merged 19 commits into
mainfrom
openclaw/improve-offline-resilience-and-timeout-handling

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes: slow or interrupted connections replace usable chat and visualizations with errors, strand message delivery, and prevent previously signed-in users from reopening their work offline.

User Impact

Users can keep reading cached conversations, editing text and attachment drafts, and queuing messages after a connection loss or an offline reload. Recovery appears in the existing bottom-left connection indicator, not a second chat banner. Loaded widgets retain their local interaction state.

Offline reload requires a prepared browser cache and an explicit browser-offline signal. Server actions and uncached external resources still require a connection. Previously signed-in proxy, Tailscale, and password users gain local access without storing their password or new bearer credentials; sending waits for account revalidation. People with access to the browser profile can read retained local data.

Migration: the derived transcript cache moves from IndexedDB version 3 to 4; unscoped old history is discarded and refilled online rather than assigned to another account. Unsent legacy drafts and queues remain available for explicit recovery, never automatic reassignment or sending. Retention limits remain unchanged; rollback does not turn account-qualified input back into an unowned queue.

Why This Change Was Made

Keep presentation alive independently of connection authority. Retry transient reads within their existing recovery windows, reconcile uncertain writes using the original message ID, and scope local work to its Gateway/account. Same-client account replacement, stale handoffs, cross-tab retirement, and explicit credential-forget cannot transfer another account’s input. The service worker prepares only integrity-bound build assets and a generic shell, retains native online HTTP-auth navigation, and resumes interrupted preparation without holding updates indefinitely.

The offline-access and account-isolation contract was explicitly accepted by @steipete in the linked work session.

Evidence

  • Full UI inventory exercised: 1,605/1,605 files, once each, on the checksum-pinned CI Bun runtime. The run recorded 23,795 passing tests, five stale retention assertions in one fixture, and one existing opt-in skip. The five assertions were corrected without changing production code; the corrected fixture and boot-owner siblings then passed 63/63 tests with zero lint warnings/errors. The original full run is retained as-is, not relabeled green.

  • Final isolated browser suite: 133/133 tests across all 17 files passed, with no skips. This includes real-Gateway Inspector pairing, offline/recovery fences, account-scoped drafts and attachments, queued delivery, loading deadlines, navigation, widgets, and reconnect reconciliation. Official Playwright 1.63 image; one worker; owned container positively removed.

  • Fresh production build and unchanged performance budgets passed. Latest rebuilt startup JS: 372,295 B gzip, 52 B below the enforcement limit. Startup CSS: 50,705 B, 495 B below its hard ceiling; the existing advisory warning remains. Chat/New boot use 32/27 requests, below 35. No budget or baseline relaxed.

  • Production Chromium/SW proof passed all eight account/offline stages and four native HTTP Basic proxy stages, with zero page errors. Offline navigation came from the service worker while a network probe failed. Original-account retention, different account/Gateway fencing, return to the original account, and “Forget this browser” were exercised. Proxy proof observed 17 native challenges and 113 authenticated asset requests.

  • Production UI types and all five canonical UI test type graphs passed, with scoped typed lint, formatting, line-count and assertion-safety ratchets. All tracked source, dependency and runtime fingerprints stayed unchanged during final browser/build proof. The account/proxy proof used build 2026.9.7-64b426373e23-2026-10-01T21-06-21.168Z; build/performance checks also passed after the private-export cleanup at 53ed9b1.

  • Independent review findings were reproduced and repaired. The final automated routing warning was rejected after inspecting the sole production getter and router call chain: offline defaults are null while connected, scoped to the current account/Gateway, and refreshed by live discovery; focused runtime-owner tests passed. No unresolved actionable P0–P2 finding remains. Hosted exact-head CI/review gates are still separate requirements; local proof is not a hosted-CI or merge claim.

  • Hosted dependency failure repaired: the obsolete global roster-generation export is now private, its test observes the existing account-scoped getter, and an unused legacy test helper was removed. Both complete Knip scans, 44 focused tests, affected production/test type graphs and typed lint pass. No dead-code suppression or production behavior change.

  • All eight cases in four additional browser files pass in scoped runs. Speech hydration now inspects the authenticated snapshot key; elapsed-time proof advances heartbeat callbacks chronologically and verifies one connection/send; catalog readiness keeps the same enabled-control assertion. Worker-update tests use the exact staged build-plus-digest cache, real install gate and generic shell. Instrumented reproduction established that network-isolated Chromium reported offline despite reachable loopback; a native online-state precondition preserves network isolation. The final diagnostic-free worker suite passed 4/4 in 38.96 seconds, with all draft, activation, asset-SHA and exact-one terminal-attach checks intact. No timing budgets or skips changed; WebKit was not run.

Integration and recovery repairs

Actual conflicts with main were resolved while retaining live-only agent discovery, warm pre-hello routing, history supersession, and Mermaid 12 worker handling. Existing landed CI prerequisites remain integrated unchanged. No main refresh was performed merely to chase branch movement.

  • Valid credential non-admission no longer deletes another document’s boot record. Explicit retirement, failed publication, and cross-tab cache cleanup affect only their captured owner; shellless sign-in/approval documents cannot retire an authenticated Chat tab.
  • Legacy recovery uses verified inactive, account-bound staging before publishing a destination. Throwing/silent/commit-then-throw failures, source resurrection, reopened storage, different-destination retries and Blob custody are covered. Required recovery writes reject before mutation if bounded retention would drop the destination or existing unsent input; ordinary cache retention is unchanged.
  • Memory-only, unconfirmed input survives A→B→A under its original opaque owner without exposing it to B or reviving stale send authority. Peer durable edits supersede dormant copies; returning in-flight input remains held for explicit action.
  • All chat sends share a finite acknowledgment deadline. A real browser-client wire test keeps heartbeats healthy while withholding an approval-command ACK: at 30 seconds it restores original text/attachment bytes, reports delivery unconfirmed, preserves the active run, ignores a late ACK, and sends nothing again on reconnect.
  • Production asset admission uses the canonical route selector rather than counting mutually exclusive preload templates together. Limits and integrity checks remain unchanged; type-only outbox dependencies use existing leaf owners without an import cycle.

Offline reload

Before

Before: proxy-signed-in offline reload cannot load the view

After

After: offline conversation, editable draft and attachment survive reload

Connection recovery and visualization state

Before

Before: subscription timeout interrupts chat with a raw error

After

After: recovery appears only in the bottom-left connection indicator

Before

Before: a Gateway disconnect replaces the widget with an error

After

After: the same widget and local note remain visible while disconnected

Requested by @steipete; implementation and verification by @roboclaw-bot.

Work sessions

Worked on by


View the OpenClaw team session

roboclaw-bot and others added 2 commits October 1, 2026 05:19
Keep account-scoped chat, drafts, queues, and loaded visualizations usable during interrupted connections. Reconcile uncertain delivery without replay and show recovery in the existing connection status. Prepare a bounded offline app shell while retaining native HTTP authentication.

Co-authored-by: steipete <[email protected]>
Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: 460948d0-663a-40d6-a1b3-187bfe9fa4ee
@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: XL labels Oct 1, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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. labels Oct 1, 2026
@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 1, 2026, 6:25 PM ET / 22:25 UTC (Revision 12).

ClawSweeper review

What this changes

The PR preserves chat, drafts, queued messages, and loaded widgets during connection failures and adds account-scoped offline reload with browser-data migration.

Merge readiness

⛔ Blocked before merge - 4 items remain

Keep open: this remains useful work absent from current main and the latest release. No concrete introduced correctness defect was found; the remaining human question is verification of the reported owner acceptance.

Priority: P2
Reviewed head: b6f255e617fb56da4386b4ac6b0ab034e97833cb
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong production and visual evidence supports a coherent recovery patch with no established blocking code defect.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The production Chromium/service-worker and native HTTP-auth observations exercise offline boot, account/Gateway fencing, retirement, and reconnect recovery; four inspected screenshots directly show retained chat/drafts and footer recovery. Migration source and browser-storage coverage preserve legacy unsent input through explicit recovery. The inaccessible owner-decision record is a reviewer limitation, not missing contributor behavior proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The production Chromium/service-worker and native HTTP-auth observations exercise offline boot, account/Gateway fencing, retirement, and reconnect recovery; four inspected screenshots directly show retained chat/drafts and footer recovery. Migration source and browser-storage coverage preserve legacy unsent input through explicit recovery. The inaccessible owner-decision record is a reviewer limitation, not missing contributor behavior proof.
Evidence reviewed 9 items Pinned introduction boundary: Reviewed the merge-base-to-head introduced hunks. The original head has the recorded parent 90e1151; the supplied stale test merge was not used to infer removal of main-branch behavior.
Still necessary on main: Current main admits warm boot only for token and device-token sign-ins; it lacks this branch's recovery-identity admission for proxy, Tailscale, and password users.
Latest-release comparison: The latest release, v2026.9.7, also limits warm-boot admission to token and device-token authentication. No merged replacement was established; the broader related-PR search was rejected by the host's limited API mode.
Findings None None.
Security None None.

How this fits together

The Control UI connects browser chat and widgets to the Gateway. Its local recovery stores preserve presentation and unsent input, while live Gateway admission controls server actions.

flowchart TD
  A[Gateway sign-in] --> B[Retained account identity]
  B --> C[Account-scoped browser storage]
  D[Connection failure] --> E[Cached chat and editable drafts]
  C --> E
  E --> F[Live account revalidation]
  F --> G[Reconcile or send queued input]
Loading

Decision needed

Question Recommendation
Does the recorded owner acceptance cover offline access to retained proxy, Tailscale, and password-account data until external sign-out is observed on reconnect? Verify the existing acceptance: Confirm the originating owner decision covers the documented behavior and retain this implementation without requesting duplicate approval.

Why: The contributor reports acceptance, but the available review surface could not independently inspect that decision; code and runtime proof cannot establish maintainer intent.

Before merge

  • Resolve merge risk (P1) - Offline admission exposes retained browser-local data after external sign-out until reconnection. The reported owner acceptance needs verification because its linked record was inaccessible to this reviewer.
  • Complete next step (P2) - Verify that the reported originating owner acceptance covers the documented offline visibility contract; reuse that acceptance if confirmed.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Production versus test growth production/tooling +2,279 net lines; tests/support +6,173 net lines The stated growth supports account custody, offline shell preparation, and recovery coverage across existing owners.
Offline sign-in expansion 3 additional authentication methods Proxy, Tailscale, and password sign-ins acquire the documented local visibility contract.
Browser cache migration IndexedDB transcript schema 3 → 4 Unscoped derived history is discarded while unsent input remains available through explicit recovery.

Stored data model

Persistent data-model change detected: serialized state: ui/src/pages/new-session/rejected-initial-turn.ts, unknown-data-model-change: ui/src/pages/new-session/rejected-initial-turn.ts, unknown-truncated-pull-files. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Merge-risk options

Maintainer options:

  1. Verify the recorded offline-access decision (recommended)
    Have the owner confirm that the existing acceptance covers browser-local visibility after external sign-out before landing.
  2. Narrow offline admission if acceptance does not cover it
    Preserve the recovery improvements while retaining the established credential requirement for offline admission.

Technical review

Best possible solution:

Preserve account-owned local recovery and live revalidation before server actions under an explicitly accepted browser-profile visibility contract.

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

Yes, from source and supplied before/after evidence: current main and v2026.9.7 reject proxy/password/Tailscale warm admission, while the PR demonstrates offline retained chat and drafts. This review did not execute target code.

Is this the best way to solve the issue?

Yes for the recovery architecture: it extends existing storage and presentation owners while keeping server actions dependent on live admission. Acceptance of the expanded offline visibility contract remains a human question.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 2f4808320cf8.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This improves bounded Control UI connection recovery without evidence of an urgent release-wide outage.
  • merge-risk: 🚨 security-boundary: Offline admission broadens retained-data visibility beyond current credential-gated boot, and verification of the reported acceptance remains unresolved.
  • 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 (live_output): The production Chromium/service-worker and native HTTP-auth observations exercise offline boot, account/Gateway fencing, retirement, and reconnect recovery; four inspected screenshots directly show retained chat/drafts and footer recovery. Migration source and browser-storage coverage preserve legacy unsent input through explicit recovery. The inaccessible owner-decision record is a reviewer limitation, not missing contributor behavior proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. The production Chromium/service-worker and native HTTP-auth observations exercise offline boot, account/Gateway fencing, retirement, and reconnect recovery; four inspected screenshots directly show retained chat/drafts and footer recovery. Migration source and browser-storage coverage preserve legacy unsent input through explicit recovery. The inaccessible owner-decision record is a reviewer limitation, not missing contributor behavior proof.

Evidence

What I checked:

  • Pinned introduction boundary: Reviewed the merge-base-to-head introduced hunks. The original head has the recorded parent 90e1151; the supplied stale test merge was not used to infer removal of main-branch behavior. (b6f255e617fb)
  • Still necessary on main: Current main admits warm boot only for token and device-token sign-ins; it lacks this branch's recovery-identity admission for proxy, Tailscale, and password users. (ui/src/app/boot-record.ts:32, 2f4808320cf8)
  • Latest-release comparison: The latest release, v2026.9.7, also limits warm-boot admission to token and device-token authentication. No merged replacement was established; the broader related-PR search was rejected by the host's limited API mode. (ui/src/app/boot-record.ts:32, c074824a27c9)
  • Offline visibility contract: The introduced admission intentionally allows retained local data without storing a password or new bearer credential. Documentation states that browser-profile access exposes retained data and external proxy sign-out is observed only after reconnect. Public docs: docs/web/control-ui/offline-and-reconnect.md. (docs/web/control-ui/offline-and-reconnect.md:35, b6f255e617fb)
  • Reported acceptance and reviewer limitation: The captured PR body and contributor discussion report explicit steipete acceptance in the linked originating work session. That session was inaccessible through the available reader, and no repository maintainer-notes directory exists. This preserves the prior acceptance-verification question rather than establishing rejection or requesting new runtime proof. Captured context identity: 85c52e7263ffc6e6c3fbeb9b6dec648cfa1780c7c8cf1d303b9bdd180bc559e7.
  • Production and visual proof: Inspected all four prepared screenshots: offline reload changes from an unloadable view to retained chat plus text/attachment draft, and subscription recovery moves from a raw error to the footer indicator. The captured body additionally records eight production Chromium/service-worker account stages and four native HTTP-auth proxy stages, including different-account/Gateway fencing, return to the original account, and Forget this browser. Screenshots support visible behavior; the production observations support runtime recovery. (ui/public/sw.js:325, b6f255e617fb)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

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 (11 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-01T06:57:12.664Z sha 9342859 :: blocked before merge. :: none
  • reviewed 2026-10-01T07:07:11.911Z sha aa0dc3d :: blocked before merge. :: none
  • reviewed 2026-10-01T07:34:43.100Z sha 26a03d1 :: blocked before merge. :: none
  • reviewed 2026-10-01T08:58:20.764Z sha 68c8df0 :: blocked before merge. :: [P2] Assert restored attachment bytes instead of data-URL spelling | [P2] Give same-account queue fixtures an admitted client identity
  • reviewed 2026-10-01T09:27:01.554Z sha 1eaa340 :: blocked before merge. :: none
  • reviewed 2026-10-01T09:39:56.072Z sha 438585a :: blocked before merge. :: none
  • reviewed 2026-10-01T10:36:51.142Z sha 9b119f1 :: blocked before merge. :: none
  • reviewed 2026-10-01T21:17:58.120Z sha 2801c4c :: blocked before merge. :: none

Resolve actual boot and composer-presence conflicts. Preserve live-only agent discovery while projecting account-bound routing defaults; retain manual history retry after deadlines and keep unrelated cold sign-ins alive during peer cache retirement.

Co-authored-by: steipete <[email protected]>
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 1, 2026 06:04
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

Please review exact head c4a9bb7 after the actual main-conflict integration. Local independent review findings were repaired, with scoped regressions and production offline/account-isolation plus HTTP-auth proxy proof. The existing PR body records the integration and retains its visual evidence.

@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Oct 1, 2026
Account for the unscoped recovery source before retiring Blob bytes. Break the outbox type-import cycle at its leaf owners. Validate mutually exclusive route preload variants independently while retaining startup reference, path, and integrity limits.

Co-authored-by: steipete <[email protected]>
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

Exact head 61a03e7 fixes the retained-unscoped-Blob finding, with four red/green partial-transfer regressions (20 tests passed), the CI type-import cycle, and production route-asset admission (40 tests passed, unchanged per-page limits). Scoped native autoreview is clean. Maintainer acceptance has been reverified against the owner-authenticated originating work session linked in the body; it is not awaiting a new product decision. Existing visual evidence and credit are preserved.

@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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 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. labels Oct 1, 2026
Generate Kysely declarations through the existing owner before direct typed lint and before striped children skip preparation. Keep core lint independent of plugin declaration builds and preserve metadata, focused syntax-only, and caller-owned preparation paths.

Co-authored-by: steipete <[email protected]>
(cherry picked from commit 74354d5)
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Oct 1, 2026
Resolve the current main preload-owner conflict by sharing facade and grouped-module entry discovery with offline assets. Preserve native route preload optimization and the offline sign-in gate without duplicate dependency traversal.

Co-authored-by: steipete <[email protected]>
@clawsweeper clawsweeper Bot removed the proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. label Oct 1, 2026
Keep copied lint-status and changed-lint fixtures complete after typed runners gained their Kysely prerequisite. Preserve all process-lifetime, signal, timeout, and semantic-lint assertions.

Co-authored-by: steipete <[email protected]>
steipete added a commit that referenced this pull request Oct 15, 2026
…-5 bundle A) (#172989)

* refactor(ui): remove unused page plumbing and duplicate presentation work

Fold sole-caller Config and Cron adapters into their existing owners, reuse
canonical controller types, and remove unused request arguments and login
selection options. Adopt the complete background mutation receipt instead of
rereading the write; keep authoritative preflight and live ownership checks.

Best-effort tradeoffs accepted: a later background edit in another browser is
reflected by normal preference events or refresh, not an unconditional read of
our own successful write. The introducing feature PR #168301 does not identify
a human incident requiring that reread. Settled rendering and public contracts
are unchanged; both shipping renderer paths remain intact.

* refactor(ui): consolidate presentation helpers and cached preview inputs

Share point-menu trigger attributes and deletion-first LCS traversal. Remove
an obsolete empty-badge predicate, a one-caller loading facade, and redundant
whole-map translation fallback. Preserve both active Lit and Solid paths,
positioning formulas, diff work budgets, visible text, and rendering.

Best-effort tradeoffs accepted:
- Trust successful synchronous Web Storage writes instead of reading them back.
  Introducing PR #162428 supplied synthetic storage failures, not a human
  incident where successful setItem silently failed. Nonconforming Storage
  replacements may miss a cache publication until the next refresh.
- Trust immutable message/tool-card identities for cached source previews.
  PR #148431's in-place mutation assertions were synthetic; production owners
  publish replacement snapshots. Unsupported in-place mutation may leave a
  decoration stale until replacement. Run/frame/origin and external source
  validation remain unchanged.

Net production reduction: 76 lines; tests: 20 lines removed, only synthetic
same-object mutation assertions. Kept config coercion tied to human Safari
report #13348, along with security, durability, ordinary navigation ownership,
and all active migration paths.

Focused proof: 73 boot/cache/diff tests, 82 menu tests, 46 badge/assistant tests,
20 i18n tests, 8 browser details tests, 3 lint-suppression tests; UI typecheck,
formatting, stylesheet lint and CSS declaration parity passed.

Known inherited local check failure: environment-variable count is 455 against
budget 454, independently reproduced against clean HEAD/index. Its counted
source roots exclude UI. No budget or unrelated source changes made.

* refactor(ui): remove obsolete presentation compatibility and styling

Use the native Popover capability required by the Control UI bootstrap
instead of retaining old-engine in-flow fallbacks. Keep native overlay
occlusion and all real connection/navigation ownership.

Remove retired sidebar style hooks and share identical question-panel
declarations. Supported browsers render identically; no user-visible
copy, feature, renderer selection, config, protocol, or storage change.

Best-effort tradeoffs accepted

- Old engines without Popover support, or invalid direct popover mounts,
  no longer receive an in-flow menu fallback. The fallback came from
  #105598 as generic compatibility, not a human incident; #168595 made
  native Popover support a required bootstrap capability. Invalid direct
  mounts now fail clearly rather than silently changing layering.

Deeper coverage and retained candidates are recorded in the requested
task-local y03 ledger for coordinator bundling.

Branch total: 123 net production LOC removed (+114/-237), excluding tests,
fixtures, generated files and declarations. Below the 500-line campaign
floor after the deeper components/app/lib/styles and lead-owned owner pass;
push branch-only for bundling.

* refactor(gateway): reuse server method owners

Consolidate duplicate catalog response handling,
optional catalog reads, pairing resolution, requester assertions and system
agent transcript persistence. Carry prepared pairing and actor facts instead
of probing or re-reading them. Remove redundant cache-generation and internal
receipt checks; retain security, durability, pagination and resource bounds.

Best-effort tradeoffs accepted:
- Pairing captures its selected adapter once. Repeated internal checks added
  by #112401 guarded hypothetical in-place plugin mutation, not a reported
  incident. Such a mutation now leaves this request on its selected adapter;
  later requests discover the current registration.
- Channel identity RPCs trust the canonical mutation result instead of
  repeating the action/kind assertion introduced in #161284. No human incident
  justified the redundant adapter assertion; live mutation authority remains
  with the state owner.

No user-facing feature, protocol/config/persistence shape, schema, dependency,
test coverage or standalone session memory backend changes.

Net production reduction: 100 lines (179 added / 279 deleted).
Type-aware lint, targeted production types, formatting, runtime cycles (zero),
SDK surface, suppression audit and independent P2 review pass. Gateway focused
suites and the full static import graph remain incomplete on the loaded host;
retain these proof gaps for the coordinator bundle rather than claiming green.

* refactor(gateway): trust prepared server method inputs

Remove a test-only config cache-reset wrapper, duplicate internal selection
and channel-support checks, an unused session-file metadata fallback, and
duplicate usage target shapes. Carry transcript delivery facts from their
first parsing pass. Keep all network validation, effect authority, transcript
durability, current update policy and standalone session memory machinery.

Best-effort tradeoffs accepted:
- Internal agent updates trust the selection-shape check at their sole
  production caller, agents.update. The duplicate originated in the Models
  agent-selection feature #150224; the same boundary check still rejects
  invalid user input. Live runtime choice validation stays at the effect.
- Channel start support is checked once at the synchronous request boundary.
  The inner check from #67815 / #167159 cannot observe a different plugin
  without unsupported synchronous mutation; the boundary guard remains.
- Workspace-root readers require caller-prepared metadata: both production
  consumers already provide it. The unused fallback from #161747 is deleted,
  not the Phase E backend or any factory. A future invalid internal caller
  gets a clear error instead of starting another metadata read.
- Update handlers trust the required getRuntimeConfig contract instead of
  falling back to a global schedule for an invalid context. Keep #158301's
  real scheduler-policy incident fix and its post-await current-config read.
- Usage summaries trust the canonical required target identity from #169660;
  the first-instance fallback served no production caller. The integration
  fixture now supplies that identity with all original assertions retained.

No public schema/config/SDK/protocol or persisted shape changes. The config
tests call the same canonical invalidators directly; no coverage is removed.

Follow-up removes 54 net production lines; branch total removes 154. Targeted
types (including MCP consumers), retained-file type-aware lint, formatting,
zero runtime import cycles, suppression audit and independent P2 review pass.
Gateway behavioral suites remain incomplete after a loaded-host startup run
was stopped at about ten minutes (exit 143). The prior full static-graph gap
remains pending for the coordinator bundle; no new production edge is added.

* refactor(ui): consolidate page lifecycle and config plumbing

Reuse the existing controller host, subscription and plugin-icon owners;
share cloud-worker config edit wiring and Usage query comparisons. Remove
the unused Usage detail predicate and duplicate model loading flag.

Retire the Web Awesome-era picker hiding fence now that native Popover
owns generation-bound close completion. Keep both rendering paths,
draft recovery, user-intent checks and dispatch-time write authority.
Settled rendering is unchanged. Net production reduction: 210 lines.

Best-effort tradeoffs accepted:
- Failed channel artwork retries on the next channel refresh rather than
  a queued trailing ensure. #131511 was a synthetic ordering regression;
  the human-reported owning-plugin bug #144152 remains covered.
- Picker triggers may reopen during closing. #126032's fence came from
  CI/synthetic overlap, not a human incident; #171441 transferred lifecycle
  ownership to native Popover, which ignores superseded completions.

Focused proof: 281 tests passed, including Chromium/WebKit overlay lifecycle
and responsive placement controls. Independent P0-P2 review: scoped-clean.
Final UI production and UI-pages test typechecks passed; suppression tests 3/3.
Scoped lint passed after a mechanical no-lonely-if fix.
Runtime and static import cycles: zero. No visual or locale changes.
The global environment-name budget is inherited at 455/454 on both the
untouched base and origin/main; none of its counted source roots changed.

* refactor(ui): remove unused new-session hiding selector

* refactor(gateway): retain legacy catalog and update handler contracts

Withdraw two wave-5 cleanups after focused CI failures and bounded isolated replay. Preserve the existing scalar-read concurrency and update-status handler contract. Tighten task-suggestions assertion allowance to match the cleaned source.
steipete added a commit that referenced this pull request Oct 15, 2026
## What Problem This Solves

An aborted IndexedDB transaction could report that an account-scoped chat snapshot clear succeeded, even though its cached records remained.

## User Impact

Explicit scope clearing now reports transaction errors. Ordinary single-session cache eviction remains best effort. No schema, rendered UI, config, or protocol changes.

## Why This Change Was Made

Use the existing transaction completion owner instead of treating complete, error, and abort as equivalent success events. The narrow regression uses a real IndexedDB transaction abort and verifies the record was not deleted.

## Best-effort tradeoffs accepted

- Single-session eviction remains intentionally best effort; explicit scope clearing rejects on failure. No new best-effort concession is introduced. The swallowed transaction outcomes originated in #162428 and survived #167780/#168206; the regression demonstrates the bug without claiming a human incident.

Net production LOC: **2 removed**. This is a silent-failure bug fix, exempt from the cleanup batch floor.

## Evidence

- Before repair: the scope-clear regression failed because its promise resolved instead of rejecting; the single-session control passed.
- After repair: 23 tests passed across the new invalidation regression and the existing snapshot store suite. New regression bodies: 6 ms; loaded-host wrapper: 167.37 s (Vitest 112.44 s).
- Formatting and `git diff --check` pass.
- Independent P0-P2 review found no issue in this packet. The complete multi-packet review found one unrelated MCP diagnostic issue, corrected separately.
- Targeted production and regression graph typecheck passes, including after the fixture lint repair. Runtime import cycles: zero. Production import edges are unchanged, so this cut cannot add a static import component. The full madge scan was stopped after30minutes without a result; no full static scan pass is claimed.
- Changed-file check: conflict-marker and line-cap gates pass. Max-lines itself passed but its combined command failed on inherited environment-count ratchet drift (452 variables, budget453). The subsequent broad assertion scan was deliberately stopped after the aggregate command exceeded20minutes; no passing aggregate check is claimed.
- Lint-suppression test:2/3 pass, existing inventory mismatch96vs94 in untouched `ui/src/test-helpers/control-ui-streaming-reply.ts` (no-unnecessary-type-conversion and unbound-method, two each). No baseline/suppression changes. Exact-head hosted CI remains the broad gate.
- Targeted source-backed lint found one unbound-method reference in the regression. The fixture now binds the native method to its test database; no suppressions were added. The fixed graph typecheck and affected two-case regression pass (120.26s wrapper /71.77s Vitest; bodies435ms). No fixed-head lint pass is claimed; exact-head hosted lint is required before merge.

The change does not modify rendering; behavior is proved at the IndexedDB boundary.

Exact-head hosted CI run38824831588 completed with the ci-gate successful; no failed jobs, CI reruns, dispatches or green-only pushes. Hosted lint supplies the fixed-fixture lint gate. Earlier draft-only skipped CI is not counted as proof.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
…-5 bundle A) (openclaw#172989)

* refactor(ui): remove unused page plumbing and duplicate presentation work

Fold sole-caller Config and Cron adapters into their existing owners, reuse
canonical controller types, and remove unused request arguments and login
selection options. Adopt the complete background mutation receipt instead of
rereading the write; keep authoritative preflight and live ownership checks.

Best-effort tradeoffs accepted: a later background edit in another browser is
reflected by normal preference events or refresh, not an unconditional read of
our own successful write. The introducing feature PR openclaw#168301 does not identify
a human incident requiring that reread. Settled rendering and public contracts
are unchanged; both shipping renderer paths remain intact.

* refactor(ui): consolidate presentation helpers and cached preview inputs

Share point-menu trigger attributes and deletion-first LCS traversal. Remove
an obsolete empty-badge predicate, a one-caller loading facade, and redundant
whole-map translation fallback. Preserve both active Lit and Solid paths,
positioning formulas, diff work budgets, visible text, and rendering.

Best-effort tradeoffs accepted:
- Trust successful synchronous Web Storage writes instead of reading them back.
  Introducing PR openclaw#162428 supplied synthetic storage failures, not a human
  incident where successful setItem silently failed. Nonconforming Storage
  replacements may miss a cache publication until the next refresh.
- Trust immutable message/tool-card identities for cached source previews.
  PR openclaw#148431's in-place mutation assertions were synthetic; production owners
  publish replacement snapshots. Unsupported in-place mutation may leave a
  decoration stale until replacement. Run/frame/origin and external source
  validation remain unchanged.

Net production reduction: 76 lines; tests: 20 lines removed, only synthetic
same-object mutation assertions. Kept config coercion tied to human Safari
report openclaw#13348, along with security, durability, ordinary navigation ownership,
and all active migration paths.

Focused proof: 73 boot/cache/diff tests, 82 menu tests, 46 badge/assistant tests,
20 i18n tests, 8 browser details tests, 3 lint-suppression tests; UI typecheck,
formatting, stylesheet lint and CSS declaration parity passed.

Known inherited local check failure: environment-variable count is 455 against
budget 454, independently reproduced against clean HEAD/index. Its counted
source roots exclude UI. No budget or unrelated source changes made.

* refactor(ui): remove obsolete presentation compatibility and styling

Use the native Popover capability required by the Control UI bootstrap
instead of retaining old-engine in-flow fallbacks. Keep native overlay
occlusion and all real connection/navigation ownership.

Remove retired sidebar style hooks and share identical question-panel
declarations. Supported browsers render identically; no user-visible
copy, feature, renderer selection, config, protocol, or storage change.

Best-effort tradeoffs accepted

- Old engines without Popover support, or invalid direct popover mounts,
  no longer receive an in-flow menu fallback. The fallback came from
  openclaw#105598 as generic compatibility, not a human incident; openclaw#168595 made
  native Popover support a required bootstrap capability. Invalid direct
  mounts now fail clearly rather than silently changing layering.

Deeper coverage and retained candidates are recorded in the requested
task-local y03 ledger for coordinator bundling.

Branch total: 123 net production LOC removed (+114/-237), excluding tests,
fixtures, generated files and declarations. Below the 500-line campaign
floor after the deeper components/app/lib/styles and lead-owned owner pass;
push branch-only for bundling.

* refactor(gateway): reuse server method owners

Consolidate duplicate catalog response handling,
optional catalog reads, pairing resolution, requester assertions and system
agent transcript persistence. Carry prepared pairing and actor facts instead
of probing or re-reading them. Remove redundant cache-generation and internal
receipt checks; retain security, durability, pagination and resource bounds.

Best-effort tradeoffs accepted:
- Pairing captures its selected adapter once. Repeated internal checks added
  by openclaw#112401 guarded hypothetical in-place plugin mutation, not a reported
  incident. Such a mutation now leaves this request on its selected adapter;
  later requests discover the current registration.
- Channel identity RPCs trust the canonical mutation result instead of
  repeating the action/kind assertion introduced in openclaw#161284. No human incident
  justified the redundant adapter assertion; live mutation authority remains
  with the state owner.

No user-facing feature, protocol/config/persistence shape, schema, dependency,
test coverage or standalone session memory backend changes.

Net production reduction: 100 lines (179 added / 279 deleted).
Type-aware lint, targeted production types, formatting, runtime cycles (zero),
SDK surface, suppression audit and independent P2 review pass. Gateway focused
suites and the full static import graph remain incomplete on the loaded host;
retain these proof gaps for the coordinator bundle rather than claiming green.

* refactor(gateway): trust prepared server method inputs

Remove a test-only config cache-reset wrapper, duplicate internal selection
and channel-support checks, an unused session-file metadata fallback, and
duplicate usage target shapes. Carry transcript delivery facts from their
first parsing pass. Keep all network validation, effect authority, transcript
durability, current update policy and standalone session memory machinery.

Best-effort tradeoffs accepted:
- Internal agent updates trust the selection-shape check at their sole
  production caller, agents.update. The duplicate originated in the Models
  agent-selection feature openclaw#150224; the same boundary check still rejects
  invalid user input. Live runtime choice validation stays at the effect.
- Channel start support is checked once at the synchronous request boundary.
  The inner check from openclaw#67815 / openclaw#167159 cannot observe a different plugin
  without unsupported synchronous mutation; the boundary guard remains.
- Workspace-root readers require caller-prepared metadata: both production
  consumers already provide it. The unused fallback from openclaw#161747 is deleted,
  not the Phase E backend or any factory. A future invalid internal caller
  gets a clear error instead of starting another metadata read.
- Update handlers trust the required getRuntimeConfig contract instead of
  falling back to a global schedule for an invalid context. Keep openclaw#158301's
  real scheduler-policy incident fix and its post-await current-config read.
- Usage summaries trust the canonical required target identity from openclaw#169660;
  the first-instance fallback served no production caller. The integration
  fixture now supplies that identity with all original assertions retained.

No public schema/config/SDK/protocol or persisted shape changes. The config
tests call the same canonical invalidators directly; no coverage is removed.

Follow-up removes 54 net production lines; branch total removes 154. Targeted
types (including MCP consumers), retained-file type-aware lint, formatting,
zero runtime import cycles, suppression audit and independent P2 review pass.
Gateway behavioral suites remain incomplete after a loaded-host startup run
was stopped at about ten minutes (exit 143). The prior full static-graph gap
remains pending for the coordinator bundle; no new production edge is added.

* refactor(ui): consolidate page lifecycle and config plumbing

Reuse the existing controller host, subscription and plugin-icon owners;
share cloud-worker config edit wiring and Usage query comparisons. Remove
the unused Usage detail predicate and duplicate model loading flag.

Retire the Web Awesome-era picker hiding fence now that native Popover
owns generation-bound close completion. Keep both rendering paths,
draft recovery, user-intent checks and dispatch-time write authority.
Settled rendering is unchanged. Net production reduction: 210 lines.

Best-effort tradeoffs accepted:
- Failed channel artwork retries on the next channel refresh rather than
  a queued trailing ensure. openclaw#131511 was a synthetic ordering regression;
  the human-reported owning-plugin bug openclaw#144152 remains covered.
- Picker triggers may reopen during closing. openclaw#126032's fence came from
  CI/synthetic overlap, not a human incident; openclaw#171441 transferred lifecycle
  ownership to native Popover, which ignores superseded completions.

Focused proof: 281 tests passed, including Chromium/WebKit overlay lifecycle
and responsive placement controls. Independent P0-P2 review: scoped-clean.
Final UI production and UI-pages test typechecks passed; suppression tests 3/3.
Scoped lint passed after a mechanical no-lonely-if fix.
Runtime and static import cycles: zero. No visual or locale changes.
The global environment-name budget is inherited at 455/454 on both the
untouched base and origin/main; none of its counted source roots changed.

* refactor(ui): remove unused new-session hiding selector

* refactor(gateway): retain legacy catalog and update handler contracts

Withdraw two wave-5 cleanups after focused CI failures and bounded isolated replay. Preserve the existing scalar-read concurrency and update-status handler contract. Tighten task-suggestions assertion allowance to match the cleaned source.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
## What Problem This Solves

An aborted IndexedDB transaction could report that an account-scoped chat snapshot clear succeeded, even though its cached records remained.

## User Impact

Explicit scope clearing now reports transaction errors. Ordinary single-session cache eviction remains best effort. No schema, rendered UI, config, or protocol changes.

## Why This Change Was Made

Use the existing transaction completion owner instead of treating complete, error, and abort as equivalent success events. The narrow regression uses a real IndexedDB transaction abort and verifies the record was not deleted.

## Best-effort tradeoffs accepted

- Single-session eviction remains intentionally best effort; explicit scope clearing rejects on failure. No new best-effort concession is introduced. The swallowed transaction outcomes originated in openclaw#162428 and survived openclaw#167780/openclaw#168206; the regression demonstrates the bug without claiming a human incident.

Net production LOC: **2 removed**. This is a silent-failure bug fix, exempt from the cleanup batch floor.

## Evidence

- Before repair: the scope-clear regression failed because its promise resolved instead of rejecting; the single-session control passed.
- After repair: 23 tests passed across the new invalidation regression and the existing snapshot store suite. New regression bodies: 6 ms; loaded-host wrapper: 167.37 s (Vitest 112.44 s).
- Formatting and `git diff --check` pass.
- Independent P0-P2 review found no issue in this packet. The complete multi-packet review found one unrelated MCP diagnostic issue, corrected separately.
- Targeted production and regression graph typecheck passes, including after the fixture lint repair. Runtime import cycles: zero. Production import edges are unchanged, so this cut cannot add a static import component. The full madge scan was stopped after30minutes without a result; no full static scan pass is claimed.
- Changed-file check: conflict-marker and line-cap gates pass. Max-lines itself passed but its combined command failed on inherited environment-count ratchet drift (452 variables, budget453). The subsequent broad assertion scan was deliberately stopped after the aggregate command exceeded20minutes; no passing aggregate check is claimed.
- Lint-suppression test:2/3 pass, existing inventory mismatch96vs94 in untouched `ui/src/test-helpers/control-ui-streaming-reply.ts` (no-unnecessary-type-conversion and unbound-method, two each). No baseline/suppression changes. Exact-head hosted CI remains the broad gate.
- Targeted source-backed lint found one unbound-method reference in the regression. The fixture now binds the native method to its test database; no suppressions were added. The fixed graph typecheck and affected two-case regression pass (120.26s wrapper /71.77s Vitest; bodies435ms). No fixed-head lint pass is claimed; exact-head hosted lint is required before merge.

The change does not modify rendering; behavior is proved at the IndexedDB boundary.

Exact-head hosted CI run38824831588 completed with the ci-gate successful; no failed jobs, CI reruns, dispatches or green-only pushes. Hosted lint supplies the fixed-fixture lint gate. Earlier draft-only skipped CI is not counted as proof.
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 merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. 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