Skip to content

fix(ui): retain automation inventory across reconnects - #184483

Merged
steipete merged 2 commits into
mainfrom
solid2/w-perf-reconnect-automation
Oct 26, 2026
Merged

steipete merged 2 commits into
mainfrom
solid2/w-perf-reconnect-automation

Conversation

@steipete

@steipete steipete commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Reconnect can briefly clear a chat's physical session row and restore the same row after history arrives. The desktop Automations section keyed its entire subtree to that physical ID, destroying an inventory that had already admitted the replacement connection's request. Restoring the row could issue a second identical cron.list request before the first completed. This is a focused follow-up to #184386.

Keep the existing automation inventory mounted across physical-row changes. Its existing owner still retires requests on Gateway, connection, logical session/agent, and read-access changes. A separate presentation identity preserves disclosure and “Show more” resets, including controlled disclosure preferences. Pending reveal/retry focus work checks the latest identity before reading props held by an asynchronous frame, so an old click cannot change the replacement presentation. This adds no cache, effect, dependency, or request owner; the mobile and CI automation owners are unchanged.

Evidence

Check Result
Regression on unchanged production code accepts one replacement-client page while its physical session row is restored fails: two replacement-client requests, expected one
Coupled automation/composition tests 40/40 passed in chat-summary-automations.test.tsx and chat-details-arrival.test.tsx, including logical-session retirement, controlled/local disclosure, reveal-count resets, client replacement, and pending pagination
UI typecheck Passed: pnpm tsgo:ui
Scoped format / lint Passed; three existing reactivity warnings in the unchanged inventory lifecycle remain
Production UI build / strict asset check Passed on both integrated base and head, with strict comparison
Production Knip Exact base/head output matches: 12 unused-export rows and four unused-type rows; no new finding
Structural reconnect trial 12/12 passed: one serial base/control/head triplet for each of four cells; 5-second drop, 1,000 sessions, 1,000 models, 500 automations, 1/10 open panes, localhost and 100 ms RPC/HTTP delay
Final independent review Scoped-clean through P2; no accepted/actionable finding
Initial full PR CI Run 40306507909 found a reveal-reset regression and two E2E failures; see attribution below

The structural trial uses the existing scripts/bench-control-ui-reconnect.ts with --pairs 1 --scenarios brief-drop --panes 1,10 --aa-control --thread-cpu-time --first-pair-screenshots, run separately with --rtt 0 --asset-latency-ms 0 and --rtt 100 --asset-latency-ms 100. Base is the built candidate from #184386; head adds this automation fix. All cases retained the fully-live witnesses: reconciled history in every pane, current sidebar/presence, enabled composers, and the unsent draft. The inspected candidate captures retain 10 rendered automation rows with one pane and 100 with ten panes.

Counts below cover only matching session-scoped compact cron.list pages (limit: 50, offset: 0, name order) started during restoration-to-readiness. Bytes are their delivered response bytes in that interval, not all reconnect traffic.

RPC / HTTP delay Panes Requests: base / control / head Response bytes: base / control / head Overlapping identical pairs: base / control / head
0 / 0 ms 1 2 / 2 / 1 28,690 / 28,690 / 14,345 1 / 1 / 0
0 / 0 ms 10 20 / 10 / 10 286,909 / 143,450 / 143,450 10 / 0 / 0
100 / 100 ms 1 2 / 2 / 1 28,690 / 28,690 / 14,345 1 / 1 / 0
100 / 100 ms 10 20 / 20 / 10 286,909 / 286,909 / 143,450 10 / 10 / 0

The localhost ten-pane control already avoids duplication: the defect depends on arrival order. The deterministic regression test establishes the broken boundary; these single-triplet trials show the duplicate disappears in the exercised production renderer. They do not establish a latency/CPU improvement, a global 50% traffic reduction, or performance across sleep/restart/update scenarios. Transport, HTTP delay, session history, and roster data are synthetic; there is no real Gateway/provider or bandwidth/loss simulation in this trial.

The final published patch is 2c050625ba2 on main 92415c1e5fe; the initial CI head was e446661e0d2. Its three reviewed source preimages are unchanged from the measured baseline; structural proof is retained at its original provenance. CI found that an absent optional presentationIdentity prop could track replacement of the whole props object, resetting 25 revealed jobs to 10 after only onNavigate changed. The existing regression fails on that head and passes after an equality-preserving memo around the presentation identity. Both coupled files (40 tests), UI types, scoped format and lint pass on this correction.

The same CI run timed out in Control UI image lightbox > opens transcript and sidebar images in one accessible modal and failed row removal in Control UI cloud workers settings mocked Gateway E2E > config.set preserves Advanced edits after class removal and deletes project defaults. Both exact tests pass in scheduled main run 40302156926 and in a bounded replay against the frozen clean base 92415c1e5fe. A replay against the frozen published head stopped during canonical worker-cache preparation at the 120-second no-output watchdog, before either test executed. These failures are not classified as inherited, and the memo correction is not claimed to fix them. Full PR CI 40312454935 passed on the corrected head after one targeted retry of the failed UI job. Its first attempt passed the reveal regression but failed collection of app-shell-view.test.ts with a duplicate openclaw-agent-select registration, before any test body ran. All 18 shell tests pass independently on this exact head and its exact base; the same suite also passed the initial PR run. The shared-worker collection-isolation failure remains an unresolved test-harness flake; a passing retry is not claimed to fix it. All full-run UI E2E and real-Gateway shards pass. The PR evidence check also required the explicit problem/evidence headings now present in this body.

Size and ownership

Surface Before → after
Startup JS gzip 271,102 → 271,082 B (-20 B); 5 JS / 1 CSS requests unchanged
Chat boot JS gzip 1,233,903 → 1,233,773 B (-130 B); 20 JS / 3 CSS requests unchanged
Touched production LOC 1,245 → 1,257 (+12)
Desktop composition test LOC 216 → 454 (+238)

The static Solid census changes from 16 to 17 memos; 5 signals, and 5 existing onSettled calls across the two production files; zero effects, render effects, direct listeners/queries, onCleanup, flush, or owner APIs. One physical-identity keyed subtree is removed. The additional production lines preserve presentation resets and cancel stale presentation work while the logical inventory remains owned by its existing lifecycle.

Before / after

Both captures use synthetic data and were inspected. The localhost one-pane before/after PNGs are byte-identical; the change removes redundant work without changing the settled appearance.

Before:

Before: reconnected chat with the Automations section

After:

After: the same reconnected chat and Automations section

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 26, 2026
@clawsweeper

clawsweeper Bot commented Oct 26, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T10:23:01.780254Z e446661 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 26, 2026
@clawsweeper

clawsweeper Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR retains the automation inventory across physical session-row changes while resetting disclosure and reveal presentation separately.

Example: Reconnect restores the physical row for agent:main:arrival while its replacement-client automation request is pending.

  • Before: Restoring the row can start a second identical cron.list request.
  • After: The existing request remains owned by the mounted inventory.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful owner-preserving repair with bounded synthetic browser evidence, blocked by a directly attributable existing-test regression.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; inspected browser captures and recorded reconnect counts exercise the built renderer with synthetic transport, without establishing real-Gateway behavior.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Reconnecting a chat can discard its automation inventory and start duplicate reads while the same session row is restored.
Reason: The maintainer-authored direction removes demonstrated duplicate work while retaining established presentation resets and request ownership.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: the reconnect fix is useful, but CI exposes an introduced reveal-count reset that needs a focused repair.

Priority: P2
Reviewed head: e446661e0d2ea74983146c30ca479968798a0870

Before merge

  • Equality-filter the presentation identity before resetting shown rows (P2) - Reading props.presentationIdentity directly inside the writable derivation subscribes its reset to aggregate prop replacement. With the existing spread-props caller, reveal all 25 jobs and update only onNavigate: shown resets to 10 although presentationIdentity remains undefined. Exact-head CI fails this existing contract at chat-summary-automations.test.tsx:793. Narrow the prop through createMemo, as already done for presented and sessionKey, and read that memo in the reset derivation.

Findings

  • [P2] Equality-filter the presentation identity before resetting shown rows — ui/src/pages/chat/components/chat-summary-automations.tsx:364
Agent review details

How this fits together

Chat Details supplies session and Gateway facts to the automation inventory, which loads scoped cron pages and renders automation links.

flowchart LR
  A[Gateway connection facts] --> C[Automation inventory]
  B[Logical session identity] --> C
  C --> D[Scoped cron list request]
  D --> E[Automation rows]
  F[Physical session identity] --> G[Disclosure and reveal state]
  G --> E
Loading

Technical review

Best possible solution:

Keep the inventory mounted and equality-filter presentationIdentity through a memo before using it to reset the reveal count.

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

Source shows physical-row restoration remounting the inventory, and the body records a failing baseline regression; this review ran no target code.

Is this the best way to solve the issue?

Separating inventory lifetime from presentation lifetime uses the existing owners appropriately, but the new reset dependency needs equality filtering.

Full review comments:

  • [P2] Equality-filter the presentation identity before resetting shown rows — ui/src/pages/chat/components/chat-summary-automations.tsx:364
    Reading props.presentationIdentity directly inside the writable derivation subscribes its reset to aggregate prop replacement. With the existing spread-props caller, reveal all 25 jobs and update only onNavigate: shown resets to 10 although presentationIdentity remains undefined. Exact-head CI fails this existing contract at chat-summary-automations.test.tsx:793. Narrow the prop through createMemo, as already done for presented and sessionKey, and read that memo in the reset derivation.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Physical-session keyed Automations composition changes intended behavior with a stated reason (04aaba0: Append late automation content after retained Details sections to preserve reload geometry.)
  • Automation disclosure and reveal behavior keeps the original intent (9019674: Provide session-scoped automation summaries with local reveal behavior and existing navigation.)
  • Shared automation request and readiness ownership keeps the original intent (0079562: Observe admitted reads without duplicating RPC ownership, preserving scope retirement and retained rows.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm --dir ui test src/pages/chat/components/chat-summary-automations.test.tsx src/pages/chat/components/chat-details-arrival.test.tsx --maxWorkers=1
  • pnpm tsgo:ui
  • Verify the existing unrelated onNavigate update retains 25 rows while physical identity changes still reset to 10.

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 04aaba0 adds ui/src/pages/chat/components/chat-details-session.tsx:59 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 04aaba0c783d; files: ui/src/pages/chat/components/chat-details-session.tsx)
  • Vyctor H. Brzezowski: Raw commit 9019674 adds ui/src/pages/chat/components/chat-summary-automations.tsx:29 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 901967444973; files: ui/src/pages/chat/components/chat-summary-automations.tsx)

PR surface

Source +11, Tests +238. Total +249 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 53 42 +11
Tests 1 238 0 +238
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 291 42 +249

Review metrics

Metric Value Why it matters
Production versus regression coverage Production net +11 lines; tests +238 lines Growth preserves disclosure, reveal resets, logical-session retirement, replacement-client admission, and pending pagination without adding another request owner.

Labels

Label changes:

  • add P2: The reconnect duplication and introduced reveal reset affect a limited Chat Details surface with a narrow repair.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: The reconnect duplication and introduced reveal reset affect a limited Chat Details surface with a narrow repair.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 26, 2026, 6:50 AM ET / 10:50 UTC.

@steipete
steipete merged commit 2d45b90 into main Oct 26, 2026
173 of 177 checks passed
@steipete
steipete deleted the solid2/w-perf-reconnect-automation branch October 26, 2026 11:45
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 27, 2026
* fix(ui): retain automation inventory across reconnect row restoration

* fix(ui): retain revealed automations across unrelated updates
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 ci:full Keep ordinary native-locale CI selection on the next PR run. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant