Skip to content

refactor(ui): adopt @lit/task across remaining page surfaces - #115274

Merged
steipete merged 3 commits into
mainfrom
refactor/lit-task-sweep
Jul 28, 2026
Merged

steipete merged 3 commits into
mainfrom
refactor/lit-task-sweep

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Wave 2 of the operator-directed @lit/task adoption (#115131 was wave 1). The remaining page surfaces still hand-rolled the async lifecycle Task replaces: monotonic generation/epoch counters compared after every await, post-await isConnected checks, parallel loading/error booleans, and bespoke inflight-dedup promises — the pattern the original audit counted ~85 times across 45 files.

Why This Change Was Made

Same rationale as wave 1: args-keyed Tasks discard stale completions structurally, supply per-run AbortSignals, and delete the per-site counter discipline. Rules held constant: Tasks are for reads (mutation lanes, pagination-append, and streaming stay hand-rolled — approvals pagination was deliberately skipped when the Task added scaffolding instead of removing it); debounces kept, feeding args; render output byte-identical.

User Impact

No behavior change; a class of stale-response races across settings/ops pages is now handled structurally. Net −19 non-test LOC while removing 16 more bespoke lifecycle mechanisms.

Evidence

Migrated: sidebar-attention, github-link-hovercard, pr-indicators (controller-hosted Task with row cancellation), terminal-panel session picker (fixes the stale-path loading-flag bug structurally), workboard-widget (refreshPromise/refreshPending/refreshGeneration triple deleted), skills-page (search Task passes AbortSignal into the RPC), skill-workshop, profile, logs, nodes, model-providers, tasks-page read lane (refresh-event buffer coupling preserved), model-control (preference-restore selectionGeneration retained as write-adjacent), channels read lane, debug, config (six-conjunct isCurrentSystemInfoRequest collapsed into args + visibility predicate). Skipped with reasons: approvals-page (manual pagination stays explicit), plus any target where Task added net code.

Validation: full UI e2e 104 files / 371 tests; focused + cross-page suites (incl. gateway-source-replacement) green; UI prod+test tsgo; full lint incl. raw-copy scanner (zero findings); both deadcode lanes; full format check; git diff --check; autoreview clean. Numstat non-test: +854/−873 (net −19).

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XL maintainer Maintainer-authored PR labels Jul 28, 2026
@steipete
steipete force-pushed the refactor/lit-task-sweep branch from 67da174 to 0d45af5 Compare July 28, 2026 15:58
@steipete
steipete marked this pull request as ready for review July 28, 2026 15:59
@steipete
steipete force-pushed the refactor/lit-task-sweep branch from 0d45af5 to 7914fc6 Compare July 28, 2026 16:14
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Jul 28, 2026
@clawsweeper

clawsweeper Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 28, 2026, 12:20 PM ET / 16:20 UTC.

ClawSweeper review

What this changes

The branch replaces remaining Control UI page-level read lifecycles with @lit/task, passing cancellation signals into gateway RPCs and removing bespoke stale-response counters, loading flags, and refresh queues.

Merge readiness

⛔ Blocked until real behavior proof is added - 4 items remain

Keep this PR open for protected-label maintainer handling. The stated approach continues the already-merged Lit Task migration, but this read-only review could not complete the required current-tree, scoped-policy, and direct dependency-contract inspection; the provided PR body also contains validation claims rather than inspectable after-fix UI proof.

Priority: P3
Reviewed head: 7914fc669e38f52ea04797bf7da0b68725095766

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The patch has a coherent stated direction, but merge confidence is capped by missing inspectable real-behavior proof and incomplete direct contract review.
Proof confidence 🧂 unranked krab (1/6) Needs real behavior proof before merge: The supplied PR body reports automated validation but provides no inspectable after-fix live UI artifact; add redacted browser, terminal, recording, or runtime-log evidence for representative changed pages before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The supplied PR body reports automated validation but provides no inspectable after-fix live UI artifact; add redacted browser, terminal, recording, or runtime-log evidence for representative changed pages before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 4 items Protected maintainer handling: The GitHub context marks this PR with the protected maintainer label, so ClawSweeper must keep it open for explicit maintainer handling rather than auto-close or route it to automated repair.
Related merged foundation: The PR explicitly follows the merged first-wave Lit Task adoption at #115131; that establishes a related pattern, but this second wave changes distinct page surfaces and is not a duplicate.
Changed async boundary: The supplied diff moves gateway-backed page reads to Task instances and forwards AbortSignal values into RPC helpers, including diagnostics, model-provider loading, tasks, skills, logs, and sidebar/terminal paths.
Findings None None.
Security None None.

How this fits together

The Control UI loads gateway-backed operational data for settings, diagnostics, skills, tasks, logs, and terminal views. Each page derives request inputs from the active gateway and selection state, then renders the resulting data or loading/error state to the operator.

flowchart LR
  A[Operator opens a Control UI page] --> B[Gateway and page selection state]
  B --> C[Request arguments]
  C --> D[Lit Task read lifecycle]
  D --> E[Gateway RPCs with cancellation]
  E --> F[Fresh page state]
  D --> G[Stale or cancelled result discarded]
  F --> H[Rendered operator view]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The supplied PR body reports automated validation but provides no inspectable after-fix live UI artifact; add redacted browser, terminal, recording, or runtime-log evidence for representative changed pages before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - This broad lifecycle refactor can change cancellation, stale-result ordering, and loading/error transitions across operator pages; current-main and direct @lit/task contract review remains incomplete.
  • Resolve merge risk (P1) - The supplied evidence does not include inspectable after-fix real UI behavior proof, so tests and CI alone do not establish that the affected page flows remain byte-for-byte equivalent for operators.
  • Complete next step (P2) - The protected maintainer label and broad asynchronous lifecycle surface require maintainer review rather than automated repair or cleanup.
Agent review details

Security

None.

PR surface

Source -51, Tests +5. Total -46 across 27 files.

View PR surface stats
Area Files Added Removed Net
Source 19 725 776 -51
Tests 8 104 99 +5
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 27 829 875 -46

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: ui/src/components/app-sidebar-session-pr-indicators.ts, vector/embedding metadata: ui/src/pages/new-session/model-control.test.ts, vector/embedding metadata: ui/src/pages/new-session/model-control.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Refresh the lifecycle review and add live proof (recommended)
    Confirm the Task argument and cancellation semantics on current main, then attach redacted browser or terminal evidence for representative changed pages before merge.
  2. Pause this wave
    Keep the refactor unmerged if maintainers do not want to accept broad async-lifecycle churn without direct contract review and observable UI proof.

Technical review

Best possible solution:

Retain the established read-only Lit Task pattern, then have a maintainer verify the current branch against the prior wave’s dependency semantics and review redacted live Control UI evidence covering representative gateway replacement, cancellation, and error/loading transitions.

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

Not applicable: this PR is presented as a behavior-preserving refactor, not a report of a standalone current-main failure. The supplied material identifies stale-response races as the class being structurally reduced but does not provide a failing reproduction for this branch.

Is this the best way to solve the issue?

Unclear. The Lit Task approach is consistent with the related merged first wave, but the required direct inspection of current call sites, scoped UI policy, and the installed dependency contract was not completed in the available read-only environment.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against d44d0d96ad69.

Labels

Label changes:

  • add P3: This is a behavior-preserving internal UI refactor rather than a confirmed user-facing regression.
  • add merge-risk: 🚨 other: Replacing many independent asynchronous UI lifecycle implementations can alter stale-result, cancellation, and loading-state behavior beyond what normal static checks demonstrate.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The supplied PR body reports automated validation but provides no inspectable after-fix live UI artifact; add redacted browser, terminal, recording, or runtime-log evidence for representative changed pages before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P3: This is a behavior-preserving internal UI refactor rather than a confirmed user-facing regression.
  • merge-risk: 🚨 other: Replacing many independent asynchronous UI lifecycle implementations can alter stale-result, cancellation, and loading-state behavior beyond what normal static checks demonstrate.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The supplied PR body reports automated validation but provides no inspectable after-fix live UI artifact; add redacted browser, terminal, recording, or runtime-log evidence for representative changed pages before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Protected maintainer handling: The GitHub context marks this PR with the protected maintainer label, so ClawSweeper must keep it open for explicit maintainer handling rather than auto-close or route it to automated repair. (7914fc669e38)
  • Related merged foundation: The PR explicitly follows the merged first-wave Lit Task adoption at refactor(ui): adopt @lit/task for async data lifecycle #115131; that establishes a related pattern, but this second wave changes distinct page surfaces and is not a duplicate. (053384fa01d2)
  • Changed async boundary: The supplied diff moves gateway-backed page reads to Task instances and forwards AbortSignal values into RPC helpers, including diagnostics, model-provider loading, tasks, skills, logs, and sidebar/terminal paths. (ui/src/pages/tasks/tasks-page.ts, 7914fc669e38)
  • Provided proof is not inspectable real-behavior evidence: The PR body reports tests, type checks, lint, formatting, and autoreview, but the supplied context contains no inspectable recording, screenshot, terminal output, runtime log, or linked artifact showing an after-fix Control UI flow. (7914fc669e38)

Likely related people:

  • steipete: Authored the related merged first-wave Lit Task adoption and all commits in this follow-up migration, making them the clearest history connection for the asynchronous UI lifecycle pattern. (role: prior implementation author; confidence: medium; commits: 053384fa01d2, 634d29cd13f4, 7914fc669e38; files: ui/src/pages/tasks/tasks-page.ts, ui/src/pages/logs/logs-page.ts, ui/src/pages/model-providers/model-providers-page.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Attach redacted real Control UI evidence showing a changed page through a gateway replacement, cancellation, or error/loading transition.
  • Have a maintainer refresh the current-main and @lit/task semantic review before merge.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit c41ca07 into main Jul 28, 2026
168 of 176 checks passed
@steipete
steipete deleted the refactor/lit-task-sweep branch July 28, 2026 16:44
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Jul 28, 2026
…etwork-none

* origin/main:
  feat(skills): shared authoring standards make learned skills routable (#115103)
  fix(matrix): suppress previews for modifying hooks
  fix: prevent node gateway hangs and runaway local inference (#115248)
  refactor(ui): adopt @lit/task across remaining page surfaces (#115274)
  fix(slack): cap chat.update edit text at the 4000-char limit, not the 8000 send limit (#115027)
  [AI-assisted] docs: recommend Node 26 in quickstart, landing, and platform install docs (#115064)
  refactor(workboard): tidy Control UI card execution helpers (#115195)
  perf(agents): amortize history-limit eviction with hysteresis (#115273) (#115281)
vincentkoc added a commit that referenced this pull request Jul 28, 2026
…-20260728

* origin/main:
  fix(tui): order delayed prompts before completed replies (#115219)
  feat(macos): enable Computer Control by default and diagnose stale Accessibility grants (#115280)
  fix(qa): restore full-stack scenarios and truthful suite exits (#115290)
  feat(memory): backfill past sessions from Control UI (#115266)
  docs: link macOS onboarding pages to app download (#111361)
  feat(skills): shared authoring standards make learned skills routable (#115103)
  fix(matrix): suppress previews for modifying hooks
  fix: prevent node gateway hangs and runaway local inference (#115248)
  refactor(ui): adopt @lit/task across remaining page surfaces (#115274)
vincentkoc added a commit to christian-lallo/openclaw that referenced this pull request Jul 28, 2026
* origin/main: (62 commits)
  feat(macos): enable Computer Control by default and diagnose stale Accessibility grants (openclaw#115280)
  fix(qa): restore full-stack scenarios and truthful suite exits (openclaw#115290)
  feat(memory): backfill past sessions from Control UI (openclaw#115266)
  docs: link macOS onboarding pages to app download (openclaw#111361)
  feat(skills): shared authoring standards make learned skills routable (openclaw#115103)
  fix(matrix): suppress previews for modifying hooks
  fix: prevent node gateway hangs and runaway local inference (openclaw#115248)
  refactor(ui): adopt @lit/task across remaining page surfaces (openclaw#115274)
  fix(slack): cap chat.update edit text at the 4000-char limit, not the 8000 send limit (openclaw#115027)
  [AI-assisted] docs: recommend Node 26 in quickstart, landing, and platform install docs (openclaw#115064)
  refactor(workboard): tidy Control UI card execution helpers (openclaw#115195)
  perf(agents): amortize history-limit eviction with hysteresis (openclaw#115273) (openclaw#115281)
  fix: schema-version refusal blames a downgrade that never happened and cannot identify the stale install (openclaw#115232)
  fix: restore Fish completion after global CLI options (openclaw#115222)
  refactor(agents): collapse the client-tool catalog branch (openclaw#115212)
  fix(macos): signed rebuild no longer stalls on app shutdown (openclaw#103957)
  fix(agents): prevent repeated Code Mode output across waits (openclaw#115213)
  refactor(ui): split Profile (identity) from Usage (statistics) (openclaw#115245)
  fix(channels): report a channel that cannot receive as unhealthy instead of connected (openclaw#115229)
  fix(cli): reject malformed infer model refs (openclaw#115225)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 29, 2026
…w#115274)

* refactor(ui): adopt @lit/task across remaining page surfaces

* refactor(ui): keep approval history pagination explicit

* fix(ui): preserve task refresh ordering
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 maintainer Maintainer-authored PR merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant