Skip to content

自定义头像资产:上传 / 裁切 512 / 持久化 / Blobatar 回退 #58

Closed

Description

@DoodleBears

Part of #425(T2)· Moves: v1.1 → v1.0

Scope

自定义 PersonaBot 头像的完整流程:上传 → 裁切 512×512 → 持久化 → 读取 → 删除回退,全程有类型 / 大小 / 路径 / 资源上限与测试。

Decisions (2026-09-29)

  • 存储:有界 data URL 存进 bot.json 的 avatar 字段(唯一权威);随 profile 文件天然可携带,export 不会悬空(export UX 仍归 Tracer: publish a Memory Git repo and import through a Bot link #17 / Design: Profile Backup / Restore / Transfer UX #76)。见 ADR-0086。
  • 参数:输入 PNG / JPEG / WebP;裁切为 512×512;输出 WebP(质量 0.85 起自适应下调);解码后硬上限 128 KiB;只接受 data:image/(png|jpeg|webp);base64,;magic-byte 嗅探;拒绝远端 URL。
  • 读取:botharness/list / get / sessionOwner 返回受认证的读取 URL(新增 DSH fetch route,带 ETag),避免消息驱动的 roster 刷新重传 base64。
  • 回退:缺失 / 非法 / 损坏 → 确定性 identity-seeded Blobatar。
  • 客户端:复用 PersonaBotAvatar(src 已支持图片)与群头像裁剪交互;入口在 Profile view(Tracer 1: Profile popover + Profile view 表面与名字内联编辑 #426 之后)。

Acceptance criteria

  • 用户可在默认 Blobatar 与自定义图片之间切换,并能预览、裁切、保存和删除。
  • 持久化后 Host restart 与客户端重连均恢复。
  • 删除 / 损坏 / 不可用资产确定性回退 Blobatar。
  • 文件类型、尺寸、路径与资源耗尽攻击有明确限制和测试(host 侧校验 + route)。
  • 读取 route 有缓存校验,且不把 base64 内联进列表响应。
  • 自定义图片在 Activity Frame 内保持静态(thinking / working 仍可访问地表达)。
  • Motion preference 遵守 UI Foundation: BotHarness motion preference(System / Reduce / Full) #128,不自行读取或持久化。
  • light / dark 与无障碍路径通过 Human 验收。

Related

Activity

  1. added this to the v1.1 milestone on Sep 19, 2026
  2. changed the title [-]v1.1: 自定义头像(预设 / 上传 / 裁切)[/-] [+]Future: 自定义头像资产(上传 / 裁切 / 持久化 / Export)[/+] on Sep 20, 2026
  3. DoodleBears commented on Sep 20, 2026

    @DoodleBears
    ContributorAuthor

    This was generated by AI during triage.

    Triage result: keep this as the independent future custom-avatar asset pipeline. It has been detached from the M3 parent/project and narrowed to upload, crop, persistence, deletion, fallback, and export semantics. Shared activity rendering belongs to #120; custom image pixels remain static inside that Activity Frame.

  4. added
    V1.1Milestone v1.1; mirrors the GitHub milestone
    area:fullstackEnd-to-end Host and Client implementation
    area:ui-uxInteraction and visual experience; may accompany a code-layer area
    feature:avatarPersonaBot avatar media and activity frame
    on Sep 22, 2026
  5. 9 remaining items

  6. modified the milestones: v1.1, v1.0 on Sep 28, 2026
  7. changed the title [-]Future: 自定义头像资产(上传 / 裁切 / 持久化 / Export)[/-] [+]自定义头像资产:上传 / 裁切 512 / 持久化 / Blobatar 回退[/+] on Sep 28, 2026
  8. DoodleBears commented on Sep 28, 2026

    @DoodleBears
    ContributorAuthor

    Agent work claim

    • Agent: opencode
    • Task: opencode/local/feat-58-personabot-avatar (branch-scoped reference)
    • Issue scope: T2 — 自定义头像上传 / 裁切 512 / 持久化 / 读取 route / Blobatar 回退
    • Branch: feat/58-personabot-avatar (worktree BotHarness-profile, based on origin/main)
    • Started: 2026-09-29
    • State: active
  9. added
    agent:activeOne or more coding-agent tasks currently claim this issue; see claim comments for task IDs
    in-progressHeld by an agent session; see Claim comment for who
    on Sep 28, 2026
  10. DoodleBears commented on Sep 28, 2026

    @DoodleBears
    ContributorAuthor

    Agent work status

    • Task: opencode/local/feat-58-personabot-avatar
    • State: active — implementation and evidence are in PR #438 (Closes 自定义头像资产:上传 / 裁切 512 / 持久化 / Blobatar 回退 #58)
    • Scope: bounded 512×512 WebP data URL in bot.json, create/update validation, DM-scoped botAvatarSet, authenticated ETag read route, summarised read URLs, crop dialog with adaptive quality, change/remove actions, Blobatar fallback
  11. moved this from In Progress to Done in Roadmapon Sep 28, 2026
  12. removed
    agent:activeOne or more coding-agent tasks currently claim this issue; see claim comments for task IDs
    in-progressHeld by an agent session; see Claim comment for who
    on Sep 28, 2026
  13. DoodleBears commented on Sep 28, 2026

    @DoodleBears
    ContributorAuthor

    Agent work outcome

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:fullstackEnd-to-end Host and Client implementationarea:ui-uxInteraction and visual experience; may accompany a code-layer areaenhancementNew feature or requestfeature:avatarPersonaBot avatar media and activity framefeature:profilePersonaBot Profile surface (popover, view, cards)scope:tracerHuman-testable implementation slice

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions