[Bug] Agent avatar upload skips the crop/downscale that community icons already get
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- desktop
Research direction
Read desktop/src/features/profile/useAvatarUpload.ts and desktop/src/features/communities/lib/downscaleIcon.ts first, then compare the processImage usage in CommunityIconSettingsCard.tsx with AgentDefinitionDialog.tsx and AgentInstanceEditDialog.tsx. Done means agent avatar uploads use the same centered square crop and 128px downscale behavior as community icons.
Written by the indexing model from the issue text.
Description
Summary
When creating (or editing) an agent in Buzz Desktop, uploading a custom avatar image does not resize, downscale, or center-crop it. The raw uploaded file is sent as-is, so a large or non-square photo doesn't get shaped into a proper small square avatar the way it should.
Root cause (traced in code)
useAvatarUpload (desktop/src/features/profile/useAvatarUpload.ts:18,64-65) accepts an optional processImage(file): Promise<string> hook. When provided, it runs the file through that hook before upload; when omitted, it uploads the raw bytes untouched via uploadMediaBytes.
- Community icons already solve this.
CommunityIconSettingsCard.tsx:114passesprocessImage={downscaleIconToDataUrl}(desktop/src/features/communities/lib/downscaleIcon.ts:11-37), which center-crops to a square and downscales to 128px before encoding to WebP/PNG. - Agent avatars do not.
AgentDefinitionDialog.tsx:770andAgentInstanceEditDialog.tsx:882both render<AgentCreationPreview ... />(which threadsprocessImagedown touseAvatarUpload) but neither passes aprocessImageprop — so agent avatar uploads skip cropping/downscaling entirely.
Expected
Agent avatar upload should reuse the same center-crop + downscale treatment community icons already get, so users can drop in any photo and have it become a properly framed square avatar without needing to pre-edit the image themselves.
Suggested fix
Generalize downscaleIconToDataUrl (it's not community-specific — just takes a File and returns a data URL) into a shared location, and pass it as processImage in AgentDefinitionDialog.tsx and AgentInstanceEditDialog.tsx, same pattern as CommunityIconSettingsCard.tsx.
Duplicate search
Searched open/closed issues for avatar resize, avatar crop, agent avatar, agent icon, resize image, downscale, square image, etc. — no existing issue describes this. Closest are #2366 (icon lost across communities — different bug) and #3089 (proposal for AI-generated avatars — unrelated to manual upload sizing).
- Dominant language
- Rust
- Stars
- 33.7k
- Forks
- 4.4k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 239
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from block/buzz
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
workflow_sink's mention parser never masks code regions — @name inside a code span wakes the agent Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 Half a day Newbie friendliness 88/100
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100