Repository navigation
fix(ui): keep newer Appearance choices after delayed theme imports [AI-assisted] - #117292
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 4:57 AM ET / 08:57 UTC. ClawSweeper reviewWhat this changesThe branch moves custom-theme import lifecycle state into a dedicated Control UI owner so late imports cannot overwrite newer Appearance, Gateway, configuration, or server-preference choices. Merge readinessThis PR addresses a real current-main ordering bug with a coherent lifecycle owner and strong browser proof. Keep it open for explicit maintainer confirmation of the compatibility-sensitive rule that a newer scoped server Priority: P2 Review scores
Verification
How this fits togetherThe Control UI Appearance page imports a remote custom theme, stores the selected theme in browser settings, and reconciles gateway-scoped server preferences. A delayed import response previously wrote directly into that state after later user or server actions had already changed the intended theme. flowchart LR
A[Appearance controls] --> B[Theme import request]
B --> C[Import lifecycle owner]
D[Gateway server preferences] --> C
E[Config edits and page or Gateway changes] --> C
C --> F[Browser theme settings]
F --> G[Rendered Control UI]
Decision needed
Why: The code and tests establish a deterministic implementation, but choosing whether server Before merge
Agent review detailsSecurityNone. PR surfaceSource +250, Tests +712. Total +962 across 11 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Adopt one lifecycle owner for delayed imports and explicitly document the accepted precedence: later Clear, built-in, URL, import, navigation, Gateway, and non- Do we have a high-confidence way to reproduce the issue? Yes, from source: current main awaits the import and then writes its result without checking later intent, and the branch supplies deterministic delayed-response browser and unit scenarios for the resulting race. This review did not execute the test suite locally. Is this the best way to solve the issue? Unclear until the maintainer chooses the server- AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 41051fe37c7f. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
|
Land-ready proof for Maintainer decision: accept the tested precedence where a newer Gateway-scoped Root cause: the previous Appearance path awaited the remote theme and then unconditionally published its palette, URL cleanup, success message, and busy-state completion. The canonical fix moves request generation, activation intent, Gateway scope, server-selection revision, and view-state publication into Sibling coverage includes server theme changes that require no local settings patch, built-in/reset actions, replacement URL/import ordering, page and Gateway lifecycle, full-config edits, initial config loading, and disconnect. Production TypeScript is Exact-head proof:
Observed behavior: the Chromium verdict shows the existing green Custom palette before replacement, immediate red/Claw state after Clear, and byte-for-byte equivalent control/persistence state after the delayed response. The newer-server-theme race also preserves the server-selected built-in theme while retaining only the newly imported palette. The known evidence gap remains screenshot publication: both approved upload routes rejected the upload, so no image was committed or sent to an unapproved host; the public Chromium run and redacted verdict remain inspectable. Best-fix verdict: this is the clean, appropriately bounded owner-level repair. Current |
|
Merged via squash.
|
* origin/main: fix(update): keep rolled-back Git installs runnable (openclaw#117294) refactor(ui): centralize chat outbox projections (openclaw#117284) fix(sessions): preserve target rows during legacy migration (openclaw#117272) fix(security): detect multiline skill prompt injection (openclaw#117254) fix(qa): lease credentials for Telegram startup proof (openclaw#116842) refactor(memory): unify session ingestion (openclaw#117293) fix(channels): strip internal tool text in Reef and Zalo Personal (openclaw#112621) fix(ui): keep newer Appearance choices after delayed theme imports [AI-assisted] (openclaw#117292) fix(inference): simplify lifecycle and preserve Codex tool identity (openclaw#117298)
…I-assisted] (openclaw#117292) * fix(ui): fence stale custom theme imports * test(ui): split custom theme ownership coverage * fix(ui): fence external theme import ownership * fix(ui): separate theme import activation ownership * fix(ui): bind theme imports to authoritative intent * refactor(ui): own custom theme import lifecycles * test(ui): refresh memory helper routing expectation * test(ui): emit custom theme race verdict
* origin/main: fix(update): keep rolled-back Git installs runnable (openclaw#117294) refactor(ui): centralize chat outbox projections (openclaw#117284) fix(sessions): preserve target rows during legacy migration (openclaw#117272) fix(security): detect multiline skill prompt injection (openclaw#117254) fix(qa): lease credentials for Telegram startup proof (openclaw#116842) refactor(memory): unify session ingestion (openclaw#117293) fix(channels): strip internal tool text in Reef and Zalo Personal (openclaw#112621) fix(ui): keep newer Appearance choices after delayed theme imports [AI-assisted] (openclaw#117292) fix(inference): simplify lifecycle and preserve Codex tool identity (openclaw#117298)
Closes #117291
What Problem This Solves
Fixes an issue where a delayed tweakcn custom-theme import could overwrite a newer Appearance action. If an operator clicked Clear, changed the URL, started another import, selected a built-in theme, received a newer server theme, left the page, switched Gateways, or began editing config before the old response finished, that stale completion could still publish its palette, selection, URL cleanup, message, or busy state.
Why This Change Was Made
The Appearance page now delegates custom-theme operations to one lifecycle owner. It records the import request generation, ordered theme-activation intent, serving Gateway scope, and server-theme revision; every later owner action retires or supersedes the old generation. The owner also refuses to start while canonical config is loading or an older full-config write can still commit.
This is the canonical operation boundary rather than a timeout, retry, or consumer guard.
ConfigPageremains exactly 1,218 lines—unchanged frommain—because the lifecycle was extracted into a focused 228-line module. No public config, protocol, environment, dependency, storage, auth, or migration surface changes.Maintainer decision: accept the tested precedence where a newer Gateway-scoped Custom selection may activate the palette when the pending import completes. That server selection is the latest authoritative intent; any newer Clear, built-in, or non-Custom server selection still prevents activation.
User Impact
Later Appearance choices stay final. In particular, Clear cannot be silently reversed by a slow replacement; newer imports and URLs keep their own state; built-in and server-provided themes retain precedence; and leaving or changing Gateway/config context cannot let an older import write back into the active page.
Evidence
7cac40f05ae5fc24c10b5451645d7c0d728a2ce9.{ "scenario": "delayed-replace-then-clear", "beforeReplace": { "renderedThemeMode": "custom", "titleColor": "oklch(0.39 0.09 152)", "clawSelected": false, "customThemeMetadataCount": 1, "importUrl": "", "message": "", "importButtonDisabled": true, "persistedTheme": "custom", "hasPersistedCustomTheme": true }, "afterClear": { "renderedThemeMode": "dark", "titleColor": "rgb(255, 92, 92)", "clawSelected": true, "customThemeMetadataCount": 0, "importUrl": "replacement", "message": "Custom theme removed.", "importButtonDisabled": false, "persistedTheme": "claw", "hasPersistedCustomTheme": false }, "afterDelayedResponse": { "renderedThemeMode": "dark", "titleColor": "rgb(255, 92, 92)", "clawSelected": true, "customThemeMetadataCount": 0, "importUrl": "replacement", "message": "Custom theme removed.", "importButtonDisabled": false, "persistedTheme": "claw", "hasPersistedCustomTheme": false }, "pass": true }maintooling failure: the memory-core helper-routing assertion omitted seven newly importing tests. The failure reproduced independently on cleanmain(84/85), this PR updates only that exact expectation, and the focused rerun passes 85/85: https://github.com/openclaw/openclaw/actions/runs/30691350012overall: patch is correct, confidence 0.98).GatewayRequestError,UNKNOWN_AGENT, loading artifact, inconsistent control/color, false success, stale custom theme, or stranded busy state was visible.git range-diffproves the rebase onto currentmainwas patch-identical;git diff --checkpassed.Review metrics:
+320/-70(+250net), almost entirely the explicit lifecycle owner; tests:+713/-1.ConfigPageline count: 1,218 before and after; new owner module: 228 lines.Release-note context: delayed Control UI custom-theme imports no longer overwrite newer Clear, URL, import, theme-selection, page, Gateway, or config-edit intent.
AI-assisted: yes. The root cause, owner boundary, browser behavior, screenshots, and exact-head proof were reviewed directly. A sanitized agent transcript was not included because it was not explicitly approved.