Repository navigation
refactor: consolidate UI and package lifecycle bookkeeping - #169375
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. What this changesThis PR consolidates UI rendering and lifecycle owners and simplifies subscription, provider, CLI, and Doctor bookkeeping. Example: A second chat pane joins a shared history request after 59 seconds.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep this maintainer-directed PR open; the prior stale-import finding is fixed, and no new concrete patch defect was identified. Priority: P3 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherControl UI pages consume Gateway state through connection-owned bindings and subscriptions; package helpers manage provider resources, while offline Doctor rewrites verified database copies. flowchart TD
A[Control UI pages] --> B[Page binding and projections]
B --> C[Gateway client subscriptions]
C --> D[Gateway state owners]
D --> E[Plugin and AI runtimes]
F[Offline Doctor] --> G[Verified database copies]
Technical reviewBest possible solution: Retain the shared owners and focused legacy-write guard, with existing-state compatibility verified before landing. Do we have a high-confidence way to reproduce the issue? The previous stale-import sequence is now rejected at the write boundary, and the added regression exercises that sequence through the real session capability with mocked Gateway I/O; no target code was run during this review. Is this the best way to solve the issue? Delegating to existing owners and retaining one check before the destructive import follows the approved simplification direction without restoring the removed display-generation machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a49b2ac1da08. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -787, Tests -693, Docs +8. Total -1472 across 73 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (5 earlier review cycles)
Reviewed October 12, 2026, 1:52 AM ET / 05:52 UTC (Revision 6). |
872431f to
d113fe5
Compare
Keep one path for channel configuration forwarding, Google thinking preparation, status projections and rendering, and voice digest settlement. Remove speculative catalog, transport, and lifecycle coordination while preserving security-effect authority and ordinary durable settlement. Best-effort tradeoffs accepted: - Replacing the process-default AI host mid-session leaves old runtime-local caches for global cleanup or bounded expiry. #158901 tested replacement synthetically; explicit runtime owners and stream authority remain. - A throwing synchronous custom-API registrar fails setup instead of requeuing a partial drain. #111669 supports initialization ordering, not recovery from an arbitrary throwing registrar; restart after repairing it. - Reentrant toJSON cleanup can replace a continuation claim during serialization. #128848's synthetic callback is unlike provider JSON; the next turn can replay full history. Credential isolation and cache limits remain. - A concurrent channel rebind may miss its activity touch. #154672's forced incarnation swaps no longer trigger a retry protocol; routing still rereads. - An admitted CLI registry load may finish during shutdown. The work scope joins and disposes it; new command admission remains closed (#142388/#142838). - Unsupported writers during offline NOCOW copying are no longer detected by a second inventory/fuser/fingerprint scan. #160877/#161501 used synthetic interleavings; initial exclusivity, integrity, atomic exchange, and retained originals still protect normal maintenance and recovery. - Remote keyword listings changing between pages may repeat or skip entries, rather than reject the cursor (#163459). Request binding and limits remain. - A missing subscription acknowledgment can leave stale observation until a fresh subscription or reconnect, without compensating requests. #126760 and #159564 forced ACK loss; server authorization and acknowledged leases remain. - A retained thinking callback may reject during plugin reload until the catalog refreshes or the caller retries. #162470 used forced retirement; the plugin instance continues to reject revoked execution. Use the existing compiled CLI fixture for native-resource lifetime proof so cold source transformation occurs before its unchanged runtime deadline. No schema, dependency, protocol shape, or permission change.
Keep the existing aggregate errors and message while attaching the caught error as the standard cause. No signature or import graph changes.
Final-head CI attribution and inherited-failure landingReviewed and signed head: CI 38208949916 completed on this exact head. All 102 jobs are terminal. There are three root failures, one downstream gate failure, and no cancellations. The complete commit check-run inventory was queried with the paginated commit API before this decision.
All other exact-head jobs passed or were intentionally skipped by the repository planner. No jobs were rerun, no workflow was dispatched, and no empty push was used to obtain green. Earlier pushes fixed actual stale test expectations and the discovered legacy-group data-loss boundary. Earlier model-probe, paste, and MCP failures were independently reproduced on main; they are not failures on this final run. The late persistence finding is fixed: stale display catalogs remain best effort, but an invalidated empty response cannot authorize Local proof limits remain explicit: extension lint ran fully on Linux and reported two untouched-main max-lines violations. Script export scan passed; production/full export scans reported 82 symbols in 60 untouched files. Matching baseline scans timed out, and the one queued remote comparison never executed and was stopped/reconciled. No reported file was modified and no reported exported symbol appeared in removed source lines, but transitive export causality is not claimed proved. These facts are not described as green checks or used as CI failure attribution; no baseline/allowlist/timeout was weakened. Proceeding with the coordinator-authorized inherited-failure exception, pinned to the reviewed head above. No release, deployment, schema change, or live-state operation is involved. Post-merge accounting correction: a strict squash-first-parent recount excludes both documentation files and |
299 upstream commits, seven of them touching extensions/feishu (none overlap the branch's files). runtime-forwarders.ts and the config baseline hash file conflicted. openclaw#169375 made createRuntimeOutboundDelegates read each method once instead of re-reading the params on every call. The merge takes that shape and adds the branch's sendFormattedText to the OutboundMethod union and to the returned delegates, so Feishu still advertises the formatted sender on the registered surface. Upstream's updated forwarder test is kept, with the branch's sendFormattedText: undefined row. The config baseline hashes were regenerated from this merge with build:docker in a separate detached checkout. Counts are unchanged at core 2499, channel 4033 and plugin 4527, since upstream moved none. The core and plugin hashes match upstream/main, the channel hash is the branch's from the last merge, and the combined hash is new. The generated channel metadata is unchanged. The config docs, channel metadata, config schema, plugin inventory, sqlite session schema and runtime sidecar checks pass there. Feishu: 102 files and 1265 tests in the extension project, and the 17 Feishu files in the database-workers project (213 tests), all passing. The four monitor.lifecycle.test.ts failures seen at the last merge are gone: openclaw#169616 moved lifecycle.test-support.ts to mock the async binding route that bot.ts calls. The src/channels/plugins tests (112 files, 809 tests) and the other tests that use the forwarders pass. tsgo:core, tsgo:extensions, tsgo:test, the eight baseline ratchets against upstream/main, the import cycle checks and oxfmt on the changed files pass. Lint reports 15 max-lines errors, deadcode:full reports 3 unused exports and db:worker-inventory:check reports a stale inventory, all in files this branch leaves identical to upstream, and all three reproduce on a clean 3f337ed.
…169375) * refactor(ui): consolidate page state and refresh bookkeeping * refactor: simplify transient plugin and client bookkeeping Keep one path for channel configuration forwarding, Google thinking preparation, status projections and rendering, and voice digest settlement. Remove speculative catalog, transport, and lifecycle coordination while preserving security-effect authority and ordinary durable settlement. Best-effort tradeoffs accepted: - Replacing the process-default AI host mid-session leaves old runtime-local caches for global cleanup or bounded expiry. openclaw#158901 tested replacement synthetically; explicit runtime owners and stream authority remain. - A throwing synchronous custom-API registrar fails setup instead of requeuing a partial drain. openclaw#111669 supports initialization ordering, not recovery from an arbitrary throwing registrar; restart after repairing it. - Reentrant toJSON cleanup can replace a continuation claim during serialization. openclaw#128848's synthetic callback is unlike provider JSON; the next turn can replay full history. Credential isolation and cache limits remain. - A concurrent channel rebind may miss its activity touch. openclaw#154672's forced incarnation swaps no longer trigger a retry protocol; routing still rereads. - An admitted CLI registry load may finish during shutdown. The work scope joins and disposes it; new command admission remains closed (openclaw#142388/openclaw#142838). - Unsupported writers during offline NOCOW copying are no longer detected by a second inventory/fuser/fingerprint scan. openclaw#160877/openclaw#161501 used synthetic interleavings; initial exclusivity, integrity, atomic exchange, and retained originals still protect normal maintenance and recovery. - Remote keyword listings changing between pages may repeat or skip entries, rather than reject the cursor (openclaw#163459). Request binding and limits remain. - A missing subscription acknowledgment can leave stale observation until a fresh subscription or reconnect, without compensating requests. openclaw#126760 and openclaw#159564 forced ACK loss; server authorization and acknowledged leases remain. - A retained thinking callback may reject during plugin reload until the catalog refreshes or the caller retries. openclaw#162470 used forced retirement; the plugin instance continues to reject revoked execution. Use the existing compiled CLI fixture for native-resource lifetime proof so cold source transformation occurs before its unchanged runtime deadline. No schema, dependency, protocol shape, or permission change. * fix: preserve runtime cleanup error cause Keep the existing aggregate errors and message while attaching the caught error as the standard cause. No signature or import graph changes. * refactor(ui): finish subscription compensation cutover * test: retire obsolete subscription recovery expectations * fix(ui): guard legacy group import at the write boundary
Combined wave-2 cleanup (w04 + w11)
Final reviewed head:
961db63164e48977c8372f0ba6ad8f110a47ff86. Exact-head CI 38208949916 completed with 102 terminal jobs and no cancellations. Its only three root failures are independently proven main failures (native catalog maintenance overlap, steering fixture assertions, and retired terminal selector); the aggregate gate is downstream. Exhaustive failure attribution, local proof and disclosed gaps. Landing uses the explicitly authorized inherited-failure exception, not a claim of green CI.Rebundles the UI-pages lane and
deslop/w11-packages-misc-20261011at14424bd627ee574121b61dbece95f8bd53a93b38, as requested by the coordinator. Both w11 commits applied cleanly: no conflicting hunks dropped. Combined reduction: 787 net production lines (692 added, 1,479 removed), excluding documentation, tests, fixtures, test support, generated files and declarations. This uses the explicitly approved 500–999 exception, with both lane ledgers below as the coverage log.The UI removes duplicate page state/rendering and speculative display-cache bookkeeping. The packages/core lane shares Google thinking and theme validation paths, simplifies channel alias adapters, and removes synthetic hot-replacement/lost-ack/offline-writer recovery machinery. The UI cutover also removes the unreachable compensation-reconnect consumer and obsolete compensation-only test expectations. Public config, protocol, SDK exports, security authority checks, ordinary write settlement and data durability remain intact. There is no intended visual or feature change.
The separate main-red suppression fix is not part of this PR:
81a4679dec8b7fc0fb137df0a5b085a93d4977c7adds the exact explained JSON control-character regex to the existing allowlist. The regex intentionally rejects invalid JSON control characters.Additional best-effort tradeoffs accepted (w11)
toJSONmay supersede continuation state during serialization. fix(ai): raise HTTP continuation idle TTL to a fixed 90 minutes, bound the cache #128848 exercises a synthetic interleaving, not a human report; the next request sends full history.5e18bb24ea1) has no human report of method mutation; rebuild the adapter after replacement.abf21a675ca) covers synthetic option mutation; actual runtime and method resolution remain live.Combined validation
Fresh combined P2 review raised one Interactions xhigh finding, declined after source inspection: unchanged
getGoogleThinkingLevelends withreturn ThinkingLevel.HIGH(google-shared.ts:310), so xhigh cannot become an unsupported wire value. Existing serialized-request coverage also asserts high. The UI compensation-consumer cutover received a separate scoped-clean P2 review. No accepted actionable finding remains.Both requested Linux-only NOCOW cases passed separately on Testbox
tbx_01m4pt6fym0pdv908r48twbzze, run 38190427942, verified head3742a8bc7307e972e9b026a54b6164174bead57fand treeb9a1f82321fd0b7957a3d8703ce82b315e73b690. Commands usednode scripts/run-vitest.mjs src/commands/doctor-sqlite-nocow.test.ts -t '<exact test name>'; wrapper times were 27.58s and 18.14s. Subsequent edits affect only UI consumers/tests, not that proof's graph. The lease is stopped and cleanup reconciled.Local extension lint stopped before lint at the normal SDK declaration preparation's unchanged 300000ms deadline. On the same Linux lease, unmodified
pnpm lint:extensionscompleted preparation (12,645 declarations) and checked 10,661 files in 152.1s. It failed only on two untouched main files:extensions/openai/image-generation-provider.test.ts:1078(1002 > 1000 lines), andextensions/crabbox/src/crabbox-worker-provider.ts:756(717 > 700 lines). Both files and the full lint config have identical blobs on current main05287aca6a6584f8f10c763c7b21947cc7f8089c; a narrow same-config reproduction reports the same errors. No threshold was changed.Fresh runtime and Madge cycle checks both report zero. The original suppression suite fails only on the missing main-side JSON-regex allowlist; an isolated test copy with exactly the already-landed two-line fix passes all three tests (35.88s). The canonical test is unchanged in this PR. Final UI boundary proof passes 69 tests across six files (74.62s Vitest, 80.74s wrapper): sidebar narration retry/release, foreground admission, history retry/errors, session subscriptions and mounted transcript loading. Red proof exposed exactly the obsolete compensation assertions; no timeout, retry, skip, or kept assertion was weakened. Final cutover P2 review is scoped-clean.
Fresh production UI types and all eight UI-test/extension-declaration type graphs pass. Prior w11 core/extension types are reused after verifying all 20 w11 production blobs are byte-identical to its tested head. Changed-file typed lint, UI style batches, formatting, i18n, and pre-format ratchets pass. The export scans complete: script scan passes; production/full scans report many untouched Solid/component and core exports. Current-main comparison is in progress; these are not yet claimed inherited. Remaining guard results will be recorded before landing. The individual-lane proof below remains qualified to its tested revision; exact-head hosted CI is the landing gate. No CI reruns or empty pushes will be used to obtain green.
w11 coverage ledger
The complete requested ledger is retained locally at
/Users/steipete/Projects/openclaw-wt/deslop-w11/.local/w11-ledger.md, with companion AI, CLI, commands, plugins and ACP/talk/channels ledgers. Public coverage summary:Prior w11 proof: focused owner/sibling tests; core/extension production and test type graphs; runtime/Madge cycles zero; all three export scans clean. Full build passed in 41m 2.3s, followed only by a focused-tested cleanup-error cause preservation. No SDK entrypoints or direct export declarations changed. Extension lint and two Linux-only cases were the explicit gaps being closed here.
What Problem This Solves
Removes duplicated Control UI lifecycle/state plumbing and repeated page rendering while keeping the existing pages and controls.
User Impact
No intended visual or feature change. Security/authorization, ordinary concurrent sessions, draft durability, and pending write settlement remain intact. The w04 portion removes 438 net production lines after main absorbed part of the original cut and after the final migration safeguard; the combined count is recorded above.
Why This Change Was Made
The Solid Gateway hook now delegates to the existing renderer-neutral binding. Revision-based capability projections share one constructor; Skills has one typed synchronous state object instead of a mirrored field inventory. Usage reads props directly and renders its four query controls through one path. Five local preference toggles and nine page-local SVG shells share their existing presentation contract. Dead group-generation and skill-message type plumbing is removed.
The lane investigated recent additions first, then the largest remaining owners. Larger apparent targets in draft persistence, permissions, media, and session reconciliation were retained where they protect user data or realistic concurrency. A proposed palette-owner simplification was reverted after existing tests demonstrated a lost queued write during remount.
Best-effort tradeoffs accepted
sessions.groups.put; stale reads cannot replace saved groups/defaults.Evidence
check:changedran its real gates. Its three parallel export scans timed out after ten minutes; a sequential scan then caught the now-removed unusedSkillMessageMap. The final production export rescan also timed out. Final complete export-scan proof remains for exact-head hosted CI; no scan was skipped or allowlisted. Remote routing did not allocate a runner because provider authentication was unavailable; the wrapper fell back locally.The combined branch is in the explicitly authorized 500–999-line exception band after both lanes' source/provenance passes. Hosted checks on this exact head remain the landing gate.
Lane coverage ledger (original locations)
lib/reactive/gateway-page.ts:1,lib/gateway-page-binding.ts:36lib/reactive/projection.ts:68,211lib/reactive/{application,application-native,domain-capabilities,domain-keyed,theme,router}.tslib/sessions/session-group-catalog.ts:44-240lib/sessions/{index,session-capability}.tsgroupsGeneration, whose final consumer was removed in #168656.lib/agents/identity.ts:104-214pages/skills/skills-page.tsx:43-175,318-352SkillMessageMapexport.pages/usage/{view,view-details,view-overview,view-query-section}.tsxpages/usage/refresh-policy.ts:22-122pages/chat/chat-history-request.ts:189-269pages/config/view-appearance-preferences.ts:44pages/plugins/catalog-results.tsx:76pages/plugins/skill-preview.tsx:222.ts/.tsxpairs95dcdf93588.Paths above are relative to
ui/src. No schema, persistence representation, SDK export, protocol, dependency, or changelog change.Exact-head CI follow-up
Late persistence review found that a stale empty list could otherwise reach legacy
sessions.groups.put, replacing newer saved group/default rows. Fixed with the existing pending promise's identity check only immediately before that write; no generations or display-read fences restored. New boundary regression failed at the unwanted RPC before the fix. All 43 migration/session tests pass after it (6.22s wrapper), UI types and ten affected test-type graphs pass, typed lint passes, and final independent P2 review is scoped-clean.Run 38195603511 completed on
0b5b3a00d1e2518488177769160a75ad6b4a27f8with five failing jobs and no cancellations:checks-node-changed-compact-large-17: the auth-recovery test still expected the removed retired-policy fallback. Fixed the expectation to require the existing live-authority rejection; all 34 policy/recovery tests pass.checks-node-changed-compact-large-9: two server-boundary tests still asserted removed lost-ACK compensation. Deleted only those synthetic tests and their private fixture. All 80 approval/registry/broadcast tests pass; live approval authorization, audience filtering and disconnected-client cleanup coverage remain.checks-node-compact-small-1: duplicate wrapper inventory entries on main. Independently reproduced on main2b9aa2ead43a21978627fdbf794223b4f16aaeaa; another lane subsequently fixed it in2b66ae6c3a310308a59127201b56c0900aa19b37. This PR did not change the inventory or failing test.checks-ui-e2e (2/9): five pasted-text cases and one archived-session action case failed. Current-main bundled reproduction is in progress; not yet claimed inherited.checks-ui-e2e (3/9): MCP-server modal case failed. Current-main bundled reproduction is in progress; not yet claimed inherited.The aggregate
openclaw/ci-gatefailed because of those jobs. Test-only follow-up received fresh scoped-clean P2 review. No CI rerun or empty push was requested; the next head contains the actual stale-test repairs.Before / after
Attached synthetic galleries show Agents, Chat, Skills, Usage, all category icons, and the chat/sidebar preference controls in light and dark themes. No real account data or live Gateway was used.
Post-merge accounting correction: a strict squash-first-parent recount excludes both documentation files and
ui/src/test-helpers/app-sidebar.ts. Production-only change is 692 additions / 1,479 deletions = -787 LOC; the earlier -780 accounting mixed those non-production changes into the total. This does not change the approved 500-999 exception or CI evidence.