Skip to content

feat: animate uploaded agent avatars in conversations and profiles - #3866

Open
valranum wants to merge 7 commits into
block:mainfrom
valranum:v/uploaded-avatar-playback
Open

valranum wants to merge 7 commits into
block:mainfrom
valranum:v/uploaded-avatar-playback

Conversation

@valranum

@valranum valranum commented Nov 18, 2026 •

Copy link
Copy Markdown

Uploaded animated agent avatars play during active responses, in expanded profiles, and while a conversation portrait's hover or keyboard-focus preview is open. Idle portraits, cards, sidebar entries and panel tabs stay still. Playback follows the existing visible response owner, including message-attached work and compact folded failure/retry groups.

Visual review

Recorded from the production components at d02a1c0 in a browser fixture with fictional data and a simulated response. Shows idle and active portraits, pointer and keyboard previews, expanded profile, light and dark themes, and browser-emulated Reduce Motion. The screenshot board also includes a 430 px view and 150% text. This is browser visual evidence, not an additional native or live-response acceptance test.

Buzz-animated-agent-avatars.mp4
Buzz-avatar-review-board

Playback now fetches through the existing authenticated community media resolver and checks compressed bytes before creating an image. Accepted GIF, animated WebP and APNG files must fit 16 MiB encoded, 512 pixels per axis, 128 actual frames and 16,777,216 canvas-frame pixels (64 MiB estimated RGBA storage). Frame rectangles and embedded WebP dimensions are checked too; APNG reserves an additional poster canvas. This is an estimated frame-storage budget, not a total process-memory limit. A 400×400, 96-frame loop fits. Invalid, unsupported or oversized media keeps the cached still portrait.

Only validated bytes become a Blob URL. Ending playback, changing source, enabling Reduce Motion or unmounting aborts the renderer fetch, detaches image callbacks, clears the preload source and revokes its Blob URL. Late completions cannot restart playback. Browser proxy cancellation propagates upstream. The native buzz-media transport can still finish an already-started request under its existing 100 MiB host ceiling; this change bounds bytes admitted to image decoding and does not claim a 16 MiB native network limit or guaranteed native upstream cancellation.

The change reuses ProfilePeek, PreviewCard, AgentResponsePreview, shared Avatar's retained still, existing image-container readers and community media resolution. No native/authentication, upload policy, plugin contract, activity subscription or timer changes.

Upload protections verified from source

Joah's November 19 follow-up confirmed the cleanup fix, bounded animation parser and passing tests. His remaining upload-path questions are covered by the existing implementations below; this PR does not change that upload contract.

Protection Verified implementation
Metadata removal before upload Avatar uploads call prepareAttachment(file, signal, true). Image preparation cleans containers or re-encodes pixels, and the avatar flag removes snapshot metadata too.
Server-side metadata enforcement The relay structurally validates image containers, rejecting residual EXIF/ICC and forbidden metadata structures. The client strips metadata; the server rejects forbidden metadata rather than stripping it. Accepted original bytes remain unchanged.
Server-side file-type enforcement The upload handler selects the pipeline from actual bytes. The image validator independently sniffs MIME and applies its allowlist and limits. It does not trust a filename or the supplied Content-Type.
Serving accepted media Media serving requires authoritative sidecar metadata, rejects a noncanonical extension, sets the stored MIME type and sends X-Content-Type-Options: nosniff.

These are source verifications at the linked commits. Maintainers still need to confirm the intended deployed relay includes these protections. They do not establish the behavior of every deployed relay or historical blob, or substitute for the required human maintainer and design reviews.

Validation

  • On December 1 the avatar commits were rebased onto 380120f2. Compact thread titles now show the responding agent’s avatar, and a collapsed reply leaves playback on the visible response cue. The existing tests cover both cases. TypeScript, related unit tests, and design checks passed at cb7cc47b.

  • On November 30, the six avatar commits were rebased onto 892992ff at dd8223dd. The help guide retains both the upstream Codex session guidance and the avatar playback instructions. All six patches match the previous revision apart from help-guide context. The local TypeScript, related unit test and design checks passed. The Rust gate found no changed Rust inputs.

  • November 25 conflict resolution at 723d5d1: rebased onto d626266. The only explicit conflict was a timeline import block; retained upstream removal of MediaReviewOrigin and this PR's useLiveConversationActivity. Independent comparison confirmed all six feature patches are unchanged apart from upstream context. All 324 focused tests across six affected files passed, as did mandatory types/related unit tests (286.70 seconds), design-system checks and the Rust change gate. GitHub confirmed no merge conflict after this push. No new native build or human acceptance is claimed.

  • November 24 conflict resolution at c07abb1: rebased onto 4276f5e, preserving the newer inline composer/thread layout and the existing avatar playback ownership. GitHub reported no merge conflict at that update. All 324 focused tests across the affected timeline, thread, grouping and activity components passed, as did mandatory types/related unit tests (328.20 seconds), design-system checks and the Rust change gate. Independent comparison of the six rebased commits found no regressions. No new native build or human acceptance is claimed.

  • November 23 integration update at 1472d69: rebased onto 5b5f804 and integrated the existing avatar guidance into the rewritten help and design docs. GitHub reported no merge conflict at that update. The 433 focused tests, avatar playback in Chromium and WebKit, and mandatory push checks passed. The earlier native acceptance still applies to its recorded candidate.

  • November 20 integration update at d02a1c0: rebased onto 877a7e9. The Avatar conflict was resolved by retaining upstream useReadyImage and this PR's still/foreground handoff. Independent comparison of the rebased patches found no blocking regressions (9/10). The focused Blob-decoding/still-restoration case passed again in Chromium and WebKit. Mandatory types/related unit tests (270.76 seconds), design-system checks and the Rust change gate passed. This was a source integration and browser check; no new native build or human acceptance is claimed, and the earlier native evidence remains scoped to its recorded candidate.

  • Follow-up unit/integration checks: 115 tests across seven files passed, covering byte/dimension/frame budgets, actual format fixtures, encoded-frame mismatches, missing/misleading Content-Length, stale results, fetch cancellation, Blob revocation, response ownership, preview dismissal and still fallback.

  • One focused browser case added, passing in Chromium and WebKit. It exercises real Blob decoding, visible shared-Avatar fallback while the request is held, and still restoration on Reduce Motion. jsdom cannot prove those browser behaviors. Container permutations remain in unit tests; no scenarios or engines were removed.

  • Independent source/test review found no blockers and rated minimalness, elegance and correctness 9/10. The saved animated sample also passes the new validator without regeneration.

  • Earlier ownership regressions failed before and passed after their fixes. Prior native/human acceptance applies to dc6dbfc: a real response was exercised and the human confirmed animation playback. That evidence is retained, not claimed as acceptance of the new loader.

  • The signed macOS candidate built and passed copied-bundle/signature verification. On the subsequent normal launch, it reached the signed-in app after an initial startup delay. The agent opened an existing animated agent profile and observed changing frames; the human then directly confirmed playback in that running candidate. This exercises the current bounded loader through the native media path. No new live message was sent. The native profile closed successfully afterward. Current-build post-dismissal still restoration, OS Reduce Motion and live-response playback were not repeated; browser tests cover loader cleanup/still restoration and earlier native response acceptance remains attributed to dc6dbfc. A Keychain prompt was reported during launch, so prompt-free startup is not claimed. Mandatory push checks passed at 33217a5: types/related unit tests (272.84 seconds), design-system checks and the Rust change gate. The successful resumed run used eight workers, unchanged assertions/timeouts and no concurrent native build.

Remaining gates

The changed loader has been reviewed and exercised in the native app with human confirmation, meeting the scoped ready-for-review checklist. Design review, human @block/buzz-oss-team code-owner approval, and confirmation of the deployed relay upload protections remain outstanding. The current head is cb7cc47b2f44c423ae68fb4dd032ee583ece31d0. DCO passed. The hosted CI run for this head requires maintainer authorization to run the fork workflow. Hosted CI passed on the earlier head 67536ffd (prior CI run), which is retained only as historical evidence. The active branch rules require an approving review and code-owner approval, but do not impose a separate last-push approval requirement. A separate local Keychain issue is unresolved. Second-member visibility and Windows playback remain unverified. No merge or deployment is included.

Focused manual check

In the updated candidate, hover or keyboard-focus an existing animated agent portrait. The portrait and preview should animate without a blank frame; dismissing the preview should restore the still. Active responses use this same bounded loader. Reduce Motion should keep both still. Over-budget files intentionally retain their still thumbnail.

buzz-review-completed

@valranum valranum changed the title feat: animate uploaded agent avatars during work and in profiles feat: animate uploaded agent avatars in conversations and profiles Nov 19, 2026
@valranum
valranum marked this pull request as ready for review November 19, 2026 19:07
@valranum
valranum requested a review from a team as a code owner November 19, 2026 19:07

@joahg joahg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 I read the avatar hook, Avatar/ProfilePeek changes, ownership logic in the timeline/thread/typing code and the docs; I did not read the test files line by line. I found no blocking correctness issue: playback is gated on active response or open preview, prefers-reduced-motion is checked and re-checked on change, and the original URL is limited to /media/. served through the community media resolver. This changes what users see (agent avatars animate), so it needs a design reviewer and a human Buzz maintainer to review it, since the author is outside buzz-oss-team and this review is not an approval; the PR itself lists code-owner approval and hosted CI as outstanding. Open questions for the maintainers: the loop is the full-size original (up to the 50 MiB upload limit, per the description) fully decoded per active portrait, with no size cap or metadata to bound it; the extension check is URL-based, so server-side content-type enforcement and EXIF stripping on upload should be confirmed in the media path rather than assumed here. No FOUNDATION-marked files are edited.

update();
motion.addEventListener("change", update);
return () => {
motion.removeEventListener("change", update);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Cleanup only nulls onload; the in-flight request for a potentially very large original keeps downloading after hover ends, the response finishes or Reduce Motion flips on. Consider also clearing image.src here so the fetch is abandoned.

@valranum
valranum marked this pull request as draft November 19, 2026 19:59
@valranum
valranum marked this pull request as ready for review November 19, 2026 21:03

@joahg joahg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 My earlier inline point is fixed. The hook now fetches through an AbortController, and on cleanup it cancels the reader, clears image.src and revokes the blob URL.

You also answered my size question. The new avatar-animation.ts caps animations at 16 MiB, 512 px per side, 128 frames and a 64 MiB estimate of decoded frames. It checks GIF, APNG and WebP containers before any bytes reach the image decoder. I read the parser against the PNG, GIF and WebP layouts and found no bugs. The 15 touched test files pass (126 tests). I didn't run the Playwright spec.

For maintainers to confirm: whether the upload path strips EXIF and enforces content type on the server.

This is a user-visible change from outside the core maintainer group, so a human maintainer and a design reviewer still need to review it.

@valranum

Copy link
Copy Markdown
Author

🤖 @joahg Thanks for confirming the cleanup fix and reviewing the bounded animation parser. I updated the PR description with a source-linked upload-protection table addressing your remaining questions:

  • Avatar preparation removes photo metadata before upload, including snapshot metadata.
  • The relay validates actual file bytes and rejects forbidden metadata, including EXIF, rather than stripping it server-side.
  • Media serving enforces the canonical extension and stored MIME type, with nosniff.

These checks are verified in source; a maintainer still needs to confirm the intended deployed relay includes them. No additional code change was needed for this follow-up.

Could you please take a personal look at the evidence and the avatar playback behavior, and help confirm the deployed upload protections? We still need human maintainer/design review and authorization for the hosted CI run. Nothing has been merged or deployed.

@joahg

joahg commented Nov 19, 2026

Copy link
Copy Markdown
Member

🤖 Thanks. The upload-protection table answers my remaining question: metadata is stripped client-side before upload, the relay rejects forbidden metadata by checking the actual bytes, and media is served with the stored MIME type and nosniff. Two things are still open, and both need a Buzz core maintainer: confirming that the deployed relay includes those checks, and authorizing the hosted CI run for this fork. The playback and design review needs a maintainer and a design reviewer, as noted in my last review.

@kazemek21

Copy link
Copy Markdown
Contributor

Instructions to get the build to run:
buzz://message?channel=5909b3f1-fbe6-4f63-9cd2-06440e58b4a1&id=41538c84fc77a64cc0d124407b31805e3d485d331654a91b5185d62dc9245b05&thread=71a8d710754540d5c562226840389021badb3398752eb76d821d2a5b6c2b16ba

If you haven’t yet, please check out the community contribution process for Buzz UX changes:
buzz://message?channel=a4624079-fe03-435d-a618-8e29c0d231c9&id=f89a88f08686d72b045be68cda5d1951969ecfc5d51d7a391d2eca17a8af1347

@valranum
valranum force-pushed the v/uploaded-avatar-playback branch 3 times, most recently from 67536ff to 1472d69 Compare November 23, 2026 16:58
@valranum

Copy link
Copy Markdown
Author

🤖 @kazemek21 Thanks for the build and UX guidance. This PR is now updated without merge conflicts at 1472d69; 433 focused tests and the Chromium/WebKit playback checks passed locally.

Could you help route this to a Buzz core maintainer to authorize the current fork CI run, and to the human maintainer/design reviewers for the behavior shown in the PR demo? The PR also documents the upload protections whose deployed relay coverage still needs maintainer confirmation.

The previous hosted run passed on 67536ffd; the current run is awaiting authorization. No merge or release is requested.

@valranum
valranum force-pushed the v/uploaded-avatar-playback branch 3 times, most recently from 723d5d1 to dd8223d Compare November 30, 2026 17:32
valranum and others added 7 commits December 1, 2026 01:34
Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: Valerie Ranum <v@squareup.com>
Keep loaded still artwork mounted while alternate images load or retry, and retire stale playback state when responses stop.

Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: Valerie Ranum <v@squareup.com>
Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: Valerie Ranum <v@squareup.com>
Pass active message work to the existing avatar playback owner, and
respect folded activity when selecting the visible compact reply portrait.
Cover native-shaped message work and folded failure/retry lifecycles with
mounted regressions.

Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: Valerie Ranum <v@squareup.com>
Validate encoded size, canvas dimensions and frame storage before decoding uploaded avatar loops. Cancel renderer loads and release blob URLs when playback ends; preserve the cached portrait for rejected media.

Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: Valerie Ranum <v@squareup.com>
Preserve registration and still-portrait coverage while exercising the protected fetch and validated blob source.

Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: Valerie Ranum <v@squareup.com>
…lapsed replies

Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: Valerie Ranum <v@squareup.com>
@valranum
valranum force-pushed the v/uploaded-avatar-playback branch from dd8223d to cb7cc47 Compare December 1, 2026 07:06

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants