Skip to content

fix: keep cached avatars visible on session return - #1736

Merged
Lampese merged 2 commits into
mainfrom
codex/avatar-switch-continuity
Oct 19, 2026
Merged

Lampese merged 2 commits into
mainfrom
codex/avatar-switch-continuity

Conversation

@Lampese

@Lampese Lampese commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Related issue

Problem / pressure

Returning to a conversation can briefly replace a cached user avatar with its fallback. A cold mount keeps the original image URL visible while filling the blob cache, but the next mount uses a different, not-yet-decoded blob URL. Source changes also returned the previous hook state until an effect ran.

Summary

Preload and asynchronously decode local blobs for avatars actually used by the stable-source hook, retaining the image with its cache entry. Derive changed or newly available sources during render so they appear in the current commit. Cache reads and first paint do not await decoding; startup does not decode the whole persistent cache, and preloading adds no remote image requests.

Extend the owning suite with real UserAvatar rendering and explicit image-load signals. Keep the authenticated profile-query path unchanged; genuinely missing profiles and completely cold images can still display the normal fallback.

Visual explanation

flowchart LR
    A[First avatar mount] --> B[Display original URL]
    A --> C[Fill local blob cache]
    C --> D[Preload blob and decode asynchronously]
    D --> E[Cache entry retains warmed Image]
    E --> F[Return mount reuses loaded blob]
Loading

Source arrival, replacement and removal select the current source during render. Background completion remains fenced to its original source.

Before / after

Before After
First return using a cached blob can show the fallback while the new URL loads. Used blobs are warmed in the background and can display immediately on return.
Available or changed profile image waits for an effect to replace the previous source. The current source is selected in the same commit.

Test plan

  • pnpm check passed on the latest fetched main base (7d6695cf3), including type-checking, lint, all test suites and boundary guards. The component suite passed 586 files / 5,739 tests; CLI passed 328 files / 4,420 tests (existing skips retained).
  • pnpm format and changed-file Oxfmt checks passed.
  • An isolated Chromium page using the real UserAvatar changes the first blob return from fallback to an immediately loaded image. Each before/after run serves one avatar HTTP request.
  • Temporarily restoring the unpatched implementation makes the warm-return and first-commit regression cases fail.
  • pnpm run docs check still reports six existing broken links into the excluded Kimi/Pi submodules; no new documentation errors or protected-topic changes.

Live deployment attribution and full-page startup performance were not measured. Completely cold images, unfinished preloading and genuinely missing profile metadata retain their normal fallback.

Prewarm used local avatar blobs asynchronously and select changed image sources during render.

Model: gpt-6.1-sol
@Lampese
Lampese marked this pull request as ready for review October 19, 2026 17:34
@Lampese
Lampese merged commit 76ad85b into main Oct 19, 2026
16 checks passed
@Lampese
Lampese deleted the codex/avatar-switch-continuity branch October 19, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant