Repository navigation
fix(ui): keep agent names through offline reloads and reconnects - #186316
Conversation
Cached chat panes read assistant identity only from bootstrap config, which the offline shell cannot fetch, and reset the displayed name on transport edges. This made a custom agent show as Message Assistant until live identity arrived. Project display name and emoji from the existing admitted boot roster through the agent identity owner without admitting cached live discovery. Seed panes before their first render, retain identity through reconnect, and retire it across Gateway/account/recovery ownership changes. The boot-record read owns the connection-revision fence. Refresh cached facts from current discovery so reconnect cannot revive retired agents or old names. Proof: the warm-boot regression fails on base with Message Assistant, then passes with unavailable bootstrap config and Gateway hello held. All 11 warm-boot/offline-title E2E cases and 162 focused unit cases pass. UI typecheck, formatting, diff checks and production UI build pass. The real-Gateway network-fault rig retains Message Harbor proof assistant from its first cached render through offline reload and warm reconnect. Independent autoreview is clean through P2. Full pnpm lint reports inherited repository failures. After lint repairs, changed-file lint reports only bootstrap's pre-existing max-lines failure: 705 counted lines on base and 704 with this change, against a 700-line limit. The production build also reports a non-failing 29-byte CSS gzip overrun. Simplification: retain the placeholder history contract and remove three redundant current-placeholder assertions (11 test lines). All 11 focused E2E cases pass again; production behavior and the rig inputs are unchanged. Independent review of the simplification is clean through P2.
|
🦞👀 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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThe Control UI uses its scoped cached agent roster to preserve agent names and text avatars during offline reloads and reconnects. Example: Reload a cached conversation belonging to Harbor proof assistant while the Gateway is unreachable.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR addresses a concrete identity-display bug that remains on main; the focused implementation and inspected visual evidence support it, with no actionable findings. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherApplication bootstrap admits the existing account-scoped boot roster, the identity capability exposes display facts, and chat panes consume those facts before rendering and refresh them after connection. flowchart LR
A[Scoped boot roster] --> B[Boot record reader]
B --> C[Agent identity capability]
D[Live Gateway discovery] --> B
D --> C
C --> E[Chat pane identity]
E --> F[Composer and text avatar]
Technical reviewBest possible solution: Retain this focused fix through the existing identity owner and complete the normal CI gates before landing. Do we have a high-confidence way to reproduce the issue? The base source exposes the bootstrap-only initialization and transport reset paths, and inspected before/after screenshots corroborate the reported failure; no target code was executed during this review. Is this the best way to solve the issue? The patch is a small complete repair: obtain first-render display facts through the existing scoped identity owner, preserve them across transport changes, and replace or clear them when ownership changes. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2d7c3497e1fa. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +57, Tests +89, Docs +4. Total +150 across 11 files. Added test files: 0. View PR surface stats
Review metrics
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 Reviewed October 27, 2026, 5:28 PM ET / 21:28 UTC. |
The offline identity repair filtered bootstrap data at callers, discarding unscoped Gateway-wide names along with foreign scoped identities. Move that selection into the shared identity projection: scoped bootstrap facts require a matching agent and same-origin transport; cached agent facts outrank the unscoped name fallback. Keep account and access retirement at the caller. Correct the quota E2E's stale expectation that Main's scoped bootstrap name belongs to Work. Exercise scoped and unscoped bootstrap separately, reject late Main identity, and require Work's live identity after its response. The new foreign-Gateway unscoped-name regression fails on the prior head. All 164 focused unit cases and 32 of 36 selected E2E cases pass, including quota, warm boot, and offline titles. The four remaining browser failures reproduce on detached main 6172290: attachment-card size checks at both viewports (#186058) and completion-toast button lookups (#186028). Leave those inherited failures unchanged. UI typecheck, targeted lint, formatting, build, diff checks, and independent review through P2 pass. The production change is three lines smaller than the prior head. Release-note context: preserve Gateway-wide display-name fallbacks without borrowing scoped identity from another agent or Gateway.
Growing the mobile command-palette draft can move an attachment action under a stationary pointer. Its tooltip can reopen after focus leaves and consume Escape at window capture, keeping the palette open. Dismiss active and pending tooltips on input outside their owned trigger and content through the existing close lifecycle. Preserve normal tooltip Escape behavior and the scoped identity cache. Proof: the new browser regression fails before the fix; all 29 tooltip browser cases pass in Chromium and WebKit. All 21 palette-drop, quota-pill, warm-boot, and offline-title e2e cases pass. The focused unit wrapper passes 205 cases across two shards. UI typecheck, changed-file lint, formatting, diff checks, and independent review through P2 pass.
The tooltip regression's inferred generic element type exceeded the core UI-components test compiler's union limit. Use an explicit native textarea type and verify the exact failing tsgo configuration. Consolidate identity reconnect and stale-fork cases without dropping their failure boundaries. Read quota identity and auth state in one snapshot, remove unused held-method replies, and use the shared E2E lifecycle instead of bespoke optional recording plumbing. Retain standard screenshots and all scoped, unscoped, stale-response, reconnect, and fork outcome assertions. Remove 149 test lines from the previous head, bringing this PR's net test line delta from +149 to zero. Do not change the ceiling. Detached main at 6b13100 independently has 6,289,898 lines against a 6,288,829 ceiling (over by 1,069); adding this PR's test diff leaves that count unchanged and the no-growth ratchet passes. Proof: exact UI-components, chat, and chat-E2E test typechecks; all 24 focused identity/quota/warm/offline-title/palette E2E cases; 204 focused unit cases; 29 tooltip browser cases each in Chromium and WebKit; changed-file lint, formatting, diff checks, simplification, and independent review through P2. No production behavior changes. Leave the inherited prompt-attachments failure and auto-merge settings untouched.
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
CI run 40603289610 attempt 1 remains failed; this landing uses the native inherited-failure exception with the maintainer's scoped attribution.
The native v1 evidence binds both jobs, the exact head/base/CI checkout, hashed logs, unchanged subject inputs, and the maintainer attribution. UI unit/browser, type, performance, i18n, and security checks passed. Full current-head CI success is not claimed; no CI rerun or branch update was used for this exception. |
…nclaw#186316) * fix(ui): retain cached agent identity through offline reloads Cached chat panes read assistant identity only from bootstrap config, which the offline shell cannot fetch, and reset the displayed name on transport edges. This made a custom agent show as Message Assistant until live identity arrived. Project display name and emoji from the existing admitted boot roster through the agent identity owner without admitting cached live discovery. Seed panes before their first render, retain identity through reconnect, and retire it across Gateway/account/recovery ownership changes. The boot-record read owns the connection-revision fence. Refresh cached facts from current discovery so reconnect cannot revive retired agents or old names. Proof: the warm-boot regression fails on base with Message Assistant, then passes with unavailable bootstrap config and Gateway hello held. All 11 warm-boot/offline-title E2E cases and 162 focused unit cases pass. UI typecheck, formatting, diff checks and production UI build pass. The real-Gateway network-fault rig retains Message Harbor proof assistant from its first cached render through offline reload and warm reconnect. Independent autoreview is clean through P2. Full pnpm lint reports inherited repository failures. After lint repairs, changed-file lint reports only bootstrap's pre-existing max-lines failure: 705 counted lines on base and 704 with this change, against a 700-line limit. The production build also reports a non-failing 29-byte CSS gzip overrun. Simplification: retain the placeholder history contract and remove three redundant current-placeholder assertions (11 test lines). All 11 focused E2E cases pass again; production behavior and the rig inputs are unchanged. Independent review of the simplification is clean through P2. * fix(ui): preserve unscoped identity across Gateway routes The offline identity repair filtered bootstrap data at callers, discarding unscoped Gateway-wide names along with foreign scoped identities. Move that selection into the shared identity projection: scoped bootstrap facts require a matching agent and same-origin transport; cached agent facts outrank the unscoped name fallback. Keep account and access retirement at the caller. Correct the quota E2E's stale expectation that Main's scoped bootstrap name belongs to Work. Exercise scoped and unscoped bootstrap separately, reject late Main identity, and require Work's live identity after its response. The new foreign-Gateway unscoped-name regression fails on the prior head. All 164 focused unit cases and 32 of 36 selected E2E cases pass, including quota, warm boot, and offline titles. The four remaining browser failures reproduce on detached main 1156516: attachment-card size checks at both viewports (openclaw#186058) and completion-toast button lookups (openclaw#186028). Leave those inherited failures unchanged. UI typecheck, targeted lint, formatting, build, diff checks, and independent review through P2 pass. The production change is three lines smaller than the prior head. Release-note context: preserve Gateway-wide display-name fallbacks without borrowing scoped identity from another agent or Gateway. * fix(ui): dismiss hover tooltips when typing elsewhere Growing the mobile command-palette draft can move an attachment action under a stationary pointer. Its tooltip can reopen after focus leaves and consume Escape at window capture, keeping the palette open. Dismiss active and pending tooltips on input outside their owned trigger and content through the existing close lifecycle. Preserve normal tooltip Escape behavior and the scoped identity cache. Proof: the new browser regression fails before the fix; all 29 tooltip browser cases pass in Chromium and WebKit. All 21 palette-drop, quota-pill, warm-boot, and offline-title e2e cases pass. The focused unit wrapper passes 205 cases across two shards. UI typecheck, changed-file lint, formatting, diff checks, and independent review through P2 pass. * test(ui): simplify identity regressions and fix textarea types The tooltip regression's inferred generic element type exceeded the core UI-components test compiler's union limit. Use an explicit native textarea type and verify the exact failing tsgo configuration. Consolidate identity reconnect and stale-fork cases without dropping their failure boundaries. Read quota identity and auth state in one snapshot, remove unused held-method replies, and use the shared E2E lifecycle instead of bespoke optional recording plumbing. Retain standard screenshots and all scoped, unscoped, stale-response, reconnect, and fork outcome assertions. Remove 149 test lines from the previous head, bringing this PR's net test line delta from +149 to zero. Do not change the ceiling. Detached main at 9c63f48 independently has 6,289,898 lines against a 6,288,829 ceiling (over by 1,069); adding this PR's test diff leaves that count unchanged and the no-growth ratchet passes. Proof: exact UI-components, chat, and chat-E2E test typechecks; all 24 focused identity/quota/warm/offline-title/palette E2E cases; 204 focused unit cases; 29 tooltip browser cases each in Chromium and WebKit; changed-file lint, formatting, diff checks, simplification, and independent review through P2. No production behavior changes. Leave the inherited prompt-attachments failure and auto-merge settings untouched.
What Problem This Solves
Fixes: on airplane or spotty-network connections, reloading a cached chat shows “Message Assistant” until the Gateway reconnects, even when the conversation's agent has a custom name.
User Impact
User impact: cached conversations show the correct agent name and text avatar from their first render and keep them through reconnect, alongside the reconnect indicator. No configuration, migration, or user action is required.
Release-note context: Control UI preserves cached agent names and text avatars during offline reloads and reconnects.
Why This Change Was Made
The offline shell cannot fetch bootstrap identity, and transport changes reset the pane's displayed name. The existing scoped boot roster already contains the missing display facts. This change reads them through the identity owner before the pane renders and replaces them when live facts arrive, without admitting cached agents into live discovery or adding storage.
The same identity fields serve the composer, chat identity presentation, and working labels. Connection, agent, recovery-account, and retired-access boundaries remain in force. Current discovery replaces cached roster facts so a later disconnect cannot revive an old name or removed agent.
Accepted edge cases: a rename made elsewhere while the browser is completely offline remains unknown until live refresh; a missing, mismatched, or retired cache uses the generic identity rather than borrowing another agent's name. Managed image thumbnails are outside this change; only the cached text avatar is supplied here.
Evidence
The rig is an isolated local Gateway with synthetic Team-shaped state behind a TCP fault proxy: 700 ms RTT, jitter, ~190 KB/s, silent blackouts / refused connections. The retained offline-reload comparison uses refused connections; the warm scenario uses the slow, jittered connection. Times below are relative to scenario start and are observations, not latency guarantees.
Synthetic offline reload, before:
Synthetic offline reload, after:
Synthetic warm reload, before:
Synthetic warm reload, after:
The warm-boot regression fails on base with “Message Assistant”. With bootstrap config unavailable and Gateway hello held, it now records only the custom placeholder from first render through matching live identity.
pnpm lintreports inherited repository failures. Changed-file lint reports only bootstrap's inherited line-cap failure: 705 lines on base, reduced to 704, against a 700-line limit. The build reports a non-failing 29-byte CSS gzip overrun. The CI failure comparison below records the follow-up validation.The simplification pass removed 11 lines of redundant current-placeholder assertions: the retained placeholder-history assertions independently detect both an incorrect first name and any reconnect flip. Every remaining test protects a distinct failure boundary. Production behavior is unchanged by this pass, so the inspected Gateway-rig evidence remains applicable.
Against the merge base after the CI repair: production/docs are +108/−50 lines (net +58); tests/support are +137/−12 lines (net +125). The initial simplification removed 11 redundant test lines; the follow-up centralizes scope selection and reduces production code by another three lines. Necessary growth connects the existing scoped roster to first-render identity and checks ownership; no new persistence, manager, or live-discovery fallback is introduced.
CI repair and inherited failures
Follow-up head:
df096bfba713.The quota failure exposed a stale expectation: the fixture scopes bootstrap “OpenClaw” to Main, then expected that name while Work identity was held. The test now explicitly covers both scoped and unscoped bootstrap. It requires no borrowed Main identity in Work, preserves a genuinely unscoped fallback, rejects delayed Main responses, and requires “Work Agent” after the Work response. Both variants pass.
A separate owner regression proved a real fallback loss on the pushed head: an unscoped bootstrap name disappeared on a foreign-Gateway route (expected “Observatory”, received an empty name). Scope selection now lives in the shared identity projection, preserving an unscoped name while accepting a scoped bootstrap identity only for the matching agent over the same-origin transport. Existing account/recovery retirement still suppresses the entire cache. This adds no fallback store or discovery path.
The same three originally failing specs ran on pushed head
3f11e97d72fa(5 failures / 19 passes) and detachedorigin/mainat61722900dfe2(4 failures / 20 passes). Main passes quota and reproduces the other four failures exactly:chat-pasted-text-show-in-text-field.e2e.test.tssameSize: falsefor the attachment cards at both 1280 px and 390 pxnew-session-page.transition.e2e.test.tsactionHref, rendering the toast action as a link. The old test still looks for a button.Those inherited failures are unchanged. The final focused browser invocation includes all three failing specs plus warm boot and offline session title: 32 passes and only the same four inherited failures (36 cases total). The owner/unit set, UI typecheck, changed-file lint, formatting, production build, diff checks, and independent review through P2 pass. Full repository lint limitations remain as recorded above.
The post-repair network-fault rig also passes offline reload and warm reload: the custom name is present at 0.271 s before offline-reload hello at 18.212 s, and at 1.228 s before warm-reload hello at 2.964 s. Its placeholder never changes across hello. The inspected synthetic screenshots have the same name/reconnect presentation as the embedded evidence above.
Mobile palette Escape repair
Follow-up head:
76cf2c13bf016878b96f17da6ee221a64e55ee17.The remaining palette-drop failure came from tooltip keyboard ownership. Growing the mobile textarea moves the image remove action under a stationary mouse pointer. Its hover tooltip can reopen after focus has already moved to the textarea, then consume Escape at window capture before the palette receives it. Instrumented failing repetitions recorded the active remove-action tooltip consuming Escape before any document or palette handler ran. The palette and tooltip handling files were identical on the exact CI base and prior PR head; this repair addresses the timing-sensitive interaction at its existing owner.
The tooltip owner now dismisses active or loading tooltips when input occurs outside their owned trigger and content. Both dismissal listeners share the existing cleanup lifecycle. Input inside rich tooltip content and ordinary tooltip Escape behavior remain supported. A visible tooltip without subsequent outside input still owns the first Escape, as before. The identity implementation and existing palette-drop test are unchanged.
The new browser regression fails before repair (Escape never reaches the textarea) and passes afterward. Final wrapper results: all 21 palette-drop, quota-pill, warm-boot, and offline-title E2E cases pass with exit 0; 205 focused unit cases pass with
[test] passed 2 Vitest shards. All 29 tooltip browser cases pass in both Chromium and WebKit. UI typecheck, changed-file lint, formatting, diff checks, and independent review through P2 pass.The simplification pass kept one owner-level input listener and one distinct browser regression: production delta +25/−9 lines (net +16), tests +24 lines against the prior head. Temporary diagnostics and repeated mobile cases were removed. The previously inspected offline identity rig evidence remains applicable because this follow-up does not change identity, caching, or reconnect behavior. The other failures classified as inherited by the exact CI-base comparison remain untouched.
Current CI gate repair
Current head:
8fc5062e32f5db5d2e4774f51ddf9bc669b84a87.The tooltip browser test now creates an explicitly typed native textarea, avoiding the generic fixture's TS2590 union expansion. The exact failing configuration,
test/tsconfig/tsconfig.core.test.ui-components.json, passes locally. The chat and chat-E2E test typecheck configurations also pass.The repair removes 149 test lines from the prior head and brings this PR's full net test-line delta from +149 to 0. Identity reconnect checks share the existing connection-replacement table and retain name/avatar assertions through both phases. The five bootstrap scope cases remain, and fixed routes now resolve independently of the fixture's selected agent. Quota assertions check identity and auth together before and after presence and stale Main responses, then require Work's live identity. Stale fork success/error cases share setup while retaining agent-change, reconnect, retained-return, and request-timing boundaries. Bespoke optional recording plumbing and unused canned replies for explicitly held methods are removed; standard screenshots and retained proof files remain. No production code or ceiling changes are included in this follow-up.
Ratchet evidence uses the failed job's actual checkout base,
39e4093b654e907fbf30831ad237dcb5cb79c916:6b1310042b9fd084de7e6533ab58913767edb136Final focused proof: 24 E2E cases across agent identity reconnect, quota, warm boot, offline session title, and command-palette drops pass with wrapper exit 0. All 204 focused unit cases pass with
[test] passed 2 Vitest shards. All 29 tooltip browser cases pass in both Chromium and WebKit. The three targeted typechecks, changed-file lint, formatting, diff checks, simplification, and independent review through P2 pass. This supersedes the earlier test-growth figures above.The remaining
new-session-page.prompt-attachmentsfailure from run40598818866was already reproduced on base and is unchanged. The inspected offline identity rig evidence remains applicable because this repair changes only tests. Auto-merge remains absent; landing stays with the lead after CI.