Skip to content

improve: retain unchanged forwarded avatar publications - #139181

Merged
steipete merged 1 commit into
mainfrom
codex/perf10-avatar-state
Sep 5, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/perf10-avatar-state

Conversation

@steipete

@steipete steipete commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Appending or reordering chat messages triggered another render of settled transcript rows when forwarded-agent avatar refreshes returned the same images. The same redundant update occurred after identity metadata expired but avatar URLs stayed unchanged.

Why This Change Was Made

The avatar loader now publishes a new sender map only when its ID-to-URL associations change. Image lease exchange and identity TTL refresh still run independently. Empty/disconnected cleanup shares the same flow while remaining synchronous, and asynchronous results retain the existing session/client/epoch/roster/request fences.

User Impact

Unchanged forwarded-agent images no longer invalidate settled chat rows. New avatar revisions and removals still update the view, while failed image replacements retain the prior image. Production is 3 lines smaller; the rendered regression fixture adds 118 test lines.

Evidence

  • Three regression cases failed on original production source and passed after the change: append, reorder, and expired identity metadata with unchanged images. Extra row renders fell from 3/2/2 to 0/0/0. Each case then changed the image revision and verified a real update still occurred.
  • 110 owner/sibling tests passed; final strengthened regression cases also passed. Managed P0–P2 review, formatting, and diff checks passed.
  • Real Chromium before/after proof rendered actual transcript and avatar components with synthetic identity RPC and native PNG fetch/decode. Both arms made the same cumulative identity requests (2, 2, 2, 4, 6, 6). The candidate suppressed map publication for append/reorder/unchanged-image TTL, then published changed images and removal once each.
  • This demonstrates eliminated rendering/publication work, not a measured browser memory or latency improvement. The browser fixture uses actual source components rather than full application/Gateway boot; current-head CI is publisher-owned.

Before/after: actual transcript components after an identity TTL refresh with unchanged images. Synthetic identities and PNGs are used; the candidate keeps the same rendered content while suppressing the extra avatar-map publication and host update.

Before After
Before: unchanged-image TTL refresh publishes After: unchanged-image TTL refresh stays idle

@clawsweeper

clawsweeper Bot commented Sep 5, 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.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Sep 5, 2026
@steipete
steipete marked this pull request as ready for review September 5, 2026 15:28
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 12:04 PM ET / 16:04 UTC.

ClawSweeper review

What this changes

Retains unchanged forwarded-agent avatar maps to avoid redundant chat-row rendering and adds regression coverage for refreshes and image revisions.

Merge readiness

✅ Ready for maintainer review

Current main still performs the redundant publications, so this PR remains useful. No blocking correctness findings were identified.

Priority: P3
Reviewed head: 5e73092310e2c73a5dd5938a32d01c29a2f8bd6b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused owner-level optimization with meaningful rendered regression coverage and no blocking findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The contributor-proof gate is exempt for this maintainer-authored PR, and no authority boundary changes. The captured body reports Chromium component proof of reduced publications and preserved revision/removal updates; screenshots were not independently viewable because GitHub DNS failed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The contributor-proof gate is exempt for this maintainer-authored PR, and no authority boundary changes. The captured body reports Chromium component proof of reduced publications and preserved revision/removal updates; screenshots were not independently viewable because GitHub DNS failed.
Evidence reviewed 10 items Pinned change and merge ownership: The complete merge-base-to-head delta contains only the avatar owner and its new regression fixture. The inspected test-merge raw parents match the pinned base followed by the exact PR head, and its avatar change matches the introduced patch.
Current-main necessity: At the fetched main revision, every completed nonempty sender batch still assigns a fresh map at line 474 and requests an update at line 483, even when all associations remain unchanged.
Publication owner: The complete owner module preserves asynchronous session/client/epoch/roster/request fences, exchanges image references before comparing maps, and publishes only changed associations. Empty and disconnected batches execute cleanup without awaiting.
Findings None None.
Security None None.

How this fits together

The Control UI resolves avatars for agents whose messages are forwarded into a chat. Gateway identity metadata and cached image URLs feed the transcript renderer.

flowchart TD
  A[Forwarded chat messages] --> B[Known sender agents]
  B --> C[Identity and image cache]
  C --> D[Refresh image leases]
  D --> E{Avatar associations changed?}
  E -->|Yes| F[Publish map and refresh rows]
  E -->|No| G[Keep settled rows idle]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -3, Tests +118. Total +115 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 22 25 -3
Tests 1 118 0 +118
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 140 25 +115

Review metrics

Metric Value Why it matters
Production versus test LOC Production −3 net; tests +118 The owner-level repair removes duplicated cleanup while adding rendered regression coverage, with no production growth.

Technical review

Best possible solution:

Keep publication equality at the avatar owner while refreshing metadata and image leases independently through the existing shared cache.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: changing the message array refreshes senders, and current main replaces the map used by transcript invalidation even when its contents match. This review did not execute a runtime reproduction.

Is this the best way to solve the issue?

Yes. Stabilizing publication at its producer preserves the renderer contract; comparing avatar contents in downstream rows would duplicate policy and leave unnecessary host updates.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 76fb700f1322.

Labels

Label changes:

  • add P3: This is a bounded rendering-work optimization without an established outage, incorrect avatar, or message-delivery failure.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The contributor-proof gate is exempt for this maintainer-authored PR, and no authority boundary changes. The captured body reports Chromium component proof of reduced publications and preserved revision/removal updates; screenshots were not independently viewable because GitHub DNS failed.

Label justifications:

  • P3: This is a bounded rendering-work optimization without an established outage, incorrect avatar, or message-delivery failure.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The contributor-proof gate is exempt for this maintainer-authored PR, and no authority boundary changes. The captured body reports Chromium component proof of reduced publications and preserved revision/removal updates; screenshots were not independently viewable because GitHub DNS failed.

Evidence

What I checked:

  • Pinned change and merge ownership: The complete merge-base-to-head delta contains only the avatar owner and its new regression fixture. The inspected test-merge raw parents match the pinned base followed by the exact PR head, and its avatar change matches the introduced patch. (ui/src/pages/chat/chat-avatar.ts:435, e6919800a965)
  • Current-main necessity: At the fetched main revision, every completed nonempty sender batch still assigns a fresh map at line 474 and requests an update at line 483, even when all associations remain unchanged. (ui/src/pages/chat/chat-avatar.ts:474, 76fb700f1322)
  • Publication owner: The complete owner module preserves asynchronous session/client/epoch/roster/request fences, exchanges image references before comparing maps, and publishes only changed associations. Empty and disconnected batches execute cleanup without awaiting. (ui/src/pages/chat/chat-avatar.ts:473, 5e73092310e2)
  • Caller and rendering boundary: The chat pane invokes sender refresh after its update at chat-pane-lifecycle.ts:559. chat-pane-render.ts:654 forwards the map, chat-transcript-projection.ts:640 includes it among render dependencies, and chat-transcript-render-guard.ts:30 compares those dependencies by identity. This is Control UI rendering logic without a Codex runtime or protocol dependency. (ui/src/pages/chat/components/chat-transcript-render-guard.ts:30, 5e73092310e2)
  • Shared image lifecycle: The existing image loader retains each pending/displayed consumer independently and only evicts unreferenced settled entries. Its sibling controller already reuses unchanged results. The patch retains this shared loading path and does not change credential handling or image trust checks. (ui/src/lib/identity-avatar-loader.ts:122, 5e73092310e2)
  • Regression and sibling coverage: Read the complete new fixture and existing avatar suite. The three new cases exercise append, reorder, and expired identity metadata, then require revised images to update. Existing cases cover failed/removed/text replacements, disconnected cleanup, stale batches, invalidation, cache pressure, and current-agent sharing. Tests were inspected, not executed. (ui/src/pages/chat/chat-avatar-publication.test.ts:23, 5e73092310e2)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit b223757 into main Sep 5, 2026
187 checks passed
@steipete
steipete deleted the codex/perf10-avatar-state branch September 5, 2026 16:07
@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit to aniruddhaadak80/openclaw that referenced this pull request Sep 5, 2026
* origin/main: (46 commits)
  fix(gateway): keep chat metadata responsive across auth refresh (openclaw#139192)
  fix(doctor): keep Workshop relocation lint read-only (openclaw#139193)
  perf(ui): retain unchanged forwarded avatar publications (openclaw#139181)
  fix(config): guide exec policy migration repairs (openclaw#139143)
  test(i18n): refresh representative Watch key (openclaw#139197)
  fix(agents): preserve recovered scheduled-run outcomes (openclaw#139037)
  refactor(acp): simplify pending operation accounting (openclaw#139189)
  fix(plugin-sdk): harden account scope for pairing requests and challenges (openclaw#139142)
  perf(gateway): avoid redundant PR landing ancestry checks (openclaw#139186)
  perf(ui): release captured audio cache leases directly (openclaw#139174)
  fix(skills): validate names in library forms (openclaw#139184)
  fix(sessions): reduce cold catalog listing delays (openclaw#139146)
  perf(cron): scan preserved action output once (openclaw#139163)
  fix(agents): keep fresh tool results readable under context pressure (openclaw#139165)
  fix(compaction): heartbeat sessions ignore the active transcript byte cap (openclaw#136533)
  perf(agents): reuse snapshotted web search result rows (openclaw#139162)
  fix(onboarding): keep Tauri setup recoverable and verify model results (openclaw#139140)
  fix(memory): rank indexed sessions by source activity (openclaw#139112)
  perf(terminal): avoid rebuilding sanitized link fallbacks (openclaw#139159)
  perf(agents): bound retained tool result projection data (openclaw#139157)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 2026
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 maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant