Skip to content

fix(ui): keep agent names through offline reloads and reconnects - #186316

Merged
steipete merged 4 commits into
mainfrom
steipete/air-offline-identity
Oct 28, 2026
Merged

steipete merged 4 commits into
mainfrom
steipete/air-offline-identity

Conversation

@steipete

@steipete steipete commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

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.

Scenario Base Candidate
Offline reload First composer at 0.332 s says “Message Assistant”; hello at 18.538 s; custom name appears at 19.954 s. First composer at 0.293 s already says “Message Harbor proof assistant”; unchanged through the outage, hello at 18.969 s, and connected rendering.
Warm reload The campaign observed the same identity gap before live identity arrived. First composer at 1.185 s has the custom name, before hello at 2.839 s; no name change after reconnect.

Synthetic offline reload, before:

Offline reload before: Message Assistant

Synthetic offline reload, after:

Offline reload after: agent name kept

Synthetic warm reload, before:

Warm reload before

Synthetic warm reload, after:

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.

  • Passed 164 focused unit cases: warm boot, identity capability, bootstrap identity, pane identity, chat composer, and chat state. Coverage includes different agents, offline agent switching, recovery-account changes, connection revisions, retired scopes, renamed agents, removed agents, and same-client reconnects.
  • Passed all 11 warm-boot and offline-session-title E2E cases; rerun after simplification.
  • Passed UI typecheck, production UI build, formatting, and diff checks. Independent review is clean through P2.
  • Full pnpm lint reports 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 detached origin/main at 61722900dfe2 (4 failures / 20 passes). Main passes quota and reproduces the other four failures exactly:

Spec Matching failure on current main Source evidence
chat-pasted-text-show-in-text-field.e2e.test.ts sameSize: false for the attachment cards at both 1280 px and 390 px #186058 changed fixed 162 px file cards to content-dependent widths. The assertion compares card dimensions, not composer height or placeholder text.
new-session-page.transition.e2e.test.ts Desktop/mobile timeout looking for the completion toast's “Open” button #186028 supplies actionHref, 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:

Tree Test lines Ceiling Result
Candidate branch 6,285,751 6,287,068 Pass; 1,317 lines of slack
Detached main 6b1310042b9fd084de7e6533ab58913767edb136 6,289,898 6,288,829 Independently over by 1,069; inherited
That main plus this PR's test diff 6,289,898 6,288,829 Pass; net delta 0, using the existing no-growth rule

Final 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-attachments failure from run 40598818866 was 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.

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.
@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review October 27, 2026 21:11
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: M labels Oct 27, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T23:38:32.952243Z 8fc5062 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 27, 2026
@steipete
steipete enabled auto-merge (squash) October 27, 2026 21:26
@clawsweeper

clawsweeper Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

The 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.

  • Before: The composer says “Message Assistant” until live identity arrives.
  • After: The composer says “Message Harbor proof assistant” while the reconnect indicator remains visible.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful, focused repair with inspected product evidence, distinct boundary regressions, and no actionable correctness or security findings.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after browser screenshots from the isolated real-Gateway fault-proxy setup show the corrected composer name during reconnect; the supplied scenario observations and first-placeholder regression cover offline initialization and matching live refresh.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A cached conversation temporarily presents a custom agent as the generic Assistant during offline reloads and reconnects.
Reason: This maintainer-authored repair restores identity continuity using existing scoped data without adding configuration, persistence, or live-discovery authority.

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
Reviewed head: 3f11e97d72fa470cc5de7793cc02ee88c0446aaa

Before merge

None.

Findings

None.

Agent review details

How this fits together

Application 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]
Loading

Technical review

Best 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

  • Cached boot roster keeps the original intent (9764de1: Retain admitted offline routing facts independently of group persistence and prevent reconnects from reviving obsolete defaults.)
  • First-render bootstrap identity keeps the original intent (4644b02: Avoid placeholder identity while authenticated deep-link reloads wait for Gateway hello.)
  • Transport-triggered identity reset changes intended behavior with a stated reason (fix(ui): preserve session identity across gateway snapshots #113322: Preserve session-specific identity across ordinary snapshots while refreshing it after logical connection changes.)
  • Settled identity capability cache keeps the original intent (ac3c0cb: Keep settled identities available independently of request-cache eviction.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Introduced change: The pinned merge-base-to-head diff connects existing boot-roster display facts to the existing identity capability and replaces transport-triggered identity resets with owner-triggered resets. (ui/src/app/bootstrap-warm-boot.ts:223, 3f11e97d72fa)
  • Current-main failure path: Main still initializes chat identity from bootstrap configuration and resets the displayed name on logical transport changes; the affected production modules retain the reviewed base behavior. (ui/src/pages/chat/chat-pane-context.ts:526, 2d7c3497e1fa)
  • Inspected visual proof: All four downloaded screenshots were inspected: the before/after offline comparison visibly changes the composer from “Message Assistant” to “Message Harbor proof assistant” with the saved-conversation reconnect indicator present; the PR describes an isolated real Gateway behind a fault proxy. (3f11e97d72fa)
  • Scope and persistence: Offline identity reads require matching connection revision, Gateway scope, and recovery account; retired access rejects the read, and connected discovery replaces retained roster facts. The existing version-2 boot-record format and writer are unchanged. (ui/src/app/bootstrap-warm-boot.ts:223, 3f11e97d72fa)
  • Original identity-preservation intent: fix(ui): preserve session identity across gateway snapshots #113322 preserved session identity across ordinary snapshots but deliberately reset it on logical connection changes; this PR explains why transport reconnects should now retain it while account and Gateway replacement still clear it. (ui/src/pages/chat/chat-pane-context.ts:522, 5e3007cc2300)
  • CI remains pending: Both check-run pages were inspected without a reported failure; multiple checks and the aggregate CI gate remain pending, while dependency and security-sensitive classification statuses pass. (3f11e97d72fa)

PR surface

Source +57, Tests +89, Docs +4. Total +150 across 11 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 6 106 49 +57
Tests 4 96 7 +89
Docs 1 4 0 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 206 56 +150

Review metrics

Metric Value Why it matters
Production versus tests Production +106/−49; tests/support +96/−7 Production growth connects existing scoped identity owners; tests cover first-render ordering, reconnect retention, and distinct account, agent, and retirement boundaries.

Labels

Label changes:

  • add P2: Incorrect agent labels during otherwise usable cached conversations are a limited user-facing bug.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Incorrect agent labels during otherwise usable cached conversations are a limited user-facing bug.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

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.
@steipete
steipete disabled auto-merge October 27, 2026 22:36
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.
@steipete
steipete merged commit e1f37b9 into main Oct 28, 2026
94 of 101 checks passed
@steipete
steipete deleted the steipete/air-offline-identity branch October 28, 2026 00:09
@steipete

steipete commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor Author

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.

  • new-session-page.prompt-attachments.e2e.test.ts (“grows the first prompt downward…”) expects overflow auto and receives scroll. The same assertion reproduced on exact CI base 50bb32ef09475b3f91e30ad0d9ec78a2c213a8e8, and scheduled main run 40594793891, job 122508254305 records the matching failure. The textarea owners and styles are unchanged in the tested merge. PR failure.
  • appearance-control-layout.e2e.test.ts:18 expects three theme-grid columns and receives one. The maintainer attributed this to an unrelated hosted intermittent after inspecting its scope: the spec and appearance view/grid styles are unchanged, while this PR changes agent identity and tooltip dismissal. The case passed 7/7 on the exact CI base and passed on PR head 8fc5062e32f5db5d2e4774f51ddf9bc669b84a87; scheduled main run 40594793891, job 122508254257 also passed it. No baseline failure or repair is claimed. PR failure.

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.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
…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.
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 clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. docs Improvements or additions to documentation size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant