Repository navigation
feat(apps): resolve the per-profile accent live on iOS, macOS, and Android - #130598
Conversation
…droid Named follow-up from #130340: native apps now fetch the caller's own profile accent (users.prefs.get, strict #rrggbb normalization) and prefer it over the gateway accent, refetching on users.prefs.changed — the gateway targets that event at the caller's own profile, so clients need no identity logic. macOS stores it separately from the seam color so settings-pane config refreshes cannot clobber it, and fetches bypass ControlChannel.request to avoid degrading the channel on older gateways. Profile-less and token connections are unchanged. Removes the ios/android users.prefs.changed allowlist entries now that handlers exist.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 26, 2026, 10:28 PM ET / August 27, 2026, 02:28 UTC. ClawSweeper reviewWhat this changesThis PR makes iOS, macOS, and Android prefer a caller-bound profile accent over the gateway accent and refresh it when that profile’s preferences change. Merge readinessKeep open: the macOS refresh can apply a profile accent from a retired Gateway connection after a switch, so the new connection may show the prior profile’s appearance until a later refresh. The PR is also maintainer-labeled and MEMBER-authored, so it requires explicit maintainer handling rather than automated cleanup. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherThe Gateway stores profile appearance preferences and pushes change notifications to the matching connected profile. Native clients read that preference, validate the color, and supply the result to their chat and talk UI. flowchart LR
A[Profile preference change] --> B[Gateway preference event]
B --> C[Native app connection]
C --> D[Profile accent lookup]
D --> E[Color validation]
E --> F[Chat and talk appearance]
C --> G[Gateway switch]
G --> D
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceOther +178. Total +178 across 13 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Capture the current macOS server lease before the profile lookup, use the lease-bound Gateway request, reject stale completion before publishing, and add a replacement-socket regression test. Do we have a high-confidence way to reproduce the issue? Yes, from source: begin the macOS profile lookup, replace the Gateway route or socket before its response returns, then allow the old request to complete after the replacement snapshot. Is this the best way to solve the issue? No. The iOS route-bound and Android generation-bound implementations preserve the required ownership invariant; macOS should use its existing server-lease API instead of an unbound request. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c75616186224. LabelsLabel changes:
Label 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
|
|
Rank-up moves acknowledged; stating both skips per landing policy:
|
|
Merged via squash.
|
…droid (openclaw#130598) * feat(apps): resolve the per-profile accent live on iOS, macOS, and Android Named follow-up from openclaw#130340: native apps now fetch the caller's own profile accent (users.prefs.get, strict #rrggbb normalization) and prefer it over the gateway accent, refetching on users.prefs.changed — the gateway targets that event at the caller's own profile, so clients need no identity logic. macOS stores it separately from the seam color so settings-pane config refreshes cannot clobber it, and fetches bypass ControlChannel.request to avoid degrading the channel on older gateways. Profile-less and token connections are unchanged. Removes the ios/android users.prefs.changed allowlist entries now that handlers exist. * chore(macos): satisfy swiftformat explicit-self on profileAccentHex
…droid (openclaw#130598) - Add resolveProfileAccentArgb to NodeUtils.kt - Add fetchProfileAccentArgb to NodeRuntime.kt - Handle UsersPrefsChanged gateway event - Take iOS/macOS files from upstream
What Problem This Solves
Follow-up named in #130340: native apps (iOS, macOS, Android) resolved the accent from
config.get(ui.prefs.accent ?? ui.seamColor), so an identity-bound connection never saw the caller's per-profile accent outside the talk payload, and no native surface reacted tousers.prefs.changed— a profile accent change on another device didn't reach a connected native app until reconnect. Theusers.prefs.changedevent was allowlisted for iOS/Android as "named follow-up"; this PR is that follow-up.Why This Change Was Made
Each platform now fetches the caller's own profile accent (
users.prefs.get, keys["ui.accent"], strict#rrggbbnormalization) and prefers it over the gateway accent, refetching whenusers.prefs.changedarrives. The gateway targets that event at connections bound to the caller's own profile, so native clients need zero identity logic — any receipt means "your appearance changed elsewhere".refreshBrandingFromGatewaygains a profile-accent fetch (fetchProfileAccentHex, route-guarded like the existing config fetch);gatewayAccentColorHexresolvesprofileAccent ?? configAccent, so no consumer changes. New"users.prefs.changed"case inhandleOperatorGatewayServerEventre-runs the guarded refresh.ColorHexSupport.profileAccentHex(entries:)owns the entry normalization.ControlChannelfetches the profile accent on.snapshot(connect) and onusers.prefs.changed, storing it in a newAppStateStore.profileAccentHexkept deliberately separate fromseamColorHex— the settings-paneChannelsStoreconfig writer can no longer clobber it. Consumers (WebChatSwiftUI,TalkOverlayView) read the neweffectiveAccentHex(profileAccentHex ?? seamColorHex). The fetch goes straight throughGatewayConnectionbecauseControlChannel.requestmarks the channel degraded on error — an older gateway without the method must not degrade the channel. macOSColorHexSupportgains the strictnormalizedHexvalidation iOS already had.refreshBrandingFromGatewayprefersfetchProfileAccentArgb(inner try so a failed profile fetch never discards the config accent;CancellationExceptionre-thrown to preserve scope-change semantics), andhandleGatewayEventhandlesGatewayEvent.UsersPrefsChanged— Android's first live accent refresh of any kind (it never handledconfig.changed).resolveProfileAccentArgbin NodeUtils owns entry parsing.no_durable_identity, older gateways without the method, and malformed stored values as "no profile accent" — profile-less/token connections keep today's behavior byte-identically.users.prefs.changedallowlist entries for iOS and Android are removed (the coverage checker now detects both handlers; stale entries fail it).User Impact
An identity-bound native connection (trusted-proxy / Tailscale) shows the person's own accent in chat and talk surfaces and updates live when they change it on another device. Token-auth setups (the typical single-user native connection) are unchanged.
Evidence
GatewayAccentColorTests(profile-entry normalization), macOSChannelsStoreUIConfigTests(7 tests incl.effectiveAccentHexprecedence and strict entry validation; run viaswift test), AndroidNodeUtilsTest.resolveProfileAccentArgb_readsUiAccentEntryStrictly(table-driven).node scripts/check-protocol-event-coverage.mts: "Protocol event coverage OK: ios handles 21, android handles 19" — handlers detected, allowlist entries retired.pnpm check:changedgreen with pinned Swift tools (swiftlint 0.65.0: 0 violations across 363 files; swiftformat repo config clean); macOS app target compiles (swift build); iOS app builds for simulator (pnpm ios:build, BUILD SUCCEEDED incl. its SwiftFormat lint phase).OPENCLAW_PROFILEinstance of the packaged macOS app against it. Both hit the same pre-existing wall, unrelated to this change: native first-run/pairing choreography — operator-socket pairing requests expire (5-min TTL) before scripted browser-side approval can be sequenced across the app's node+operator connects, and the onboarding flows accept Bonjour/SSH targets but not a direct loopback URL. The changed gateway seam (users.prefs.getself-binding,users.prefs.changedsame-profile targeting, live cross-device update) was live-proven end-to-end in feat(ui): save appearance preferences per user profile #130340's browser proof; what this PR adds on top is the native-side RPC call, normalization, and event-triggered refetch, which the unit tests cover directly. Android additionally has no SDK on this host (no emulator).