Skip to content

🐛 fix(inbox): restore inbox avatar fallback after deletion#13752

Merged
Innei merged 1 commit into
canaryfrom
fix/inbox-avatar-fallback-pr
Apr 12, 2026
Merged

🐛 fix(inbox): restore inbox avatar fallback after deletion#13752
Innei merged 1 commit into
canaryfrom
fix/inbox-avatar-fallback-pr

Conversation

@Innei

@Innei Innei commented Apr 12, 2026

Copy link
Copy Markdown
Member

💻 Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • ✅ test
  • 📝 docs
  • 🔨 chore

🔗 Related Issue

  • None

🔀 Description of Change

  • restore the dedicated inbox avatar fallback when the inbox agent no longer has a custom avatar
  • persist avatar deletion as null so clearing the avatar is not swallowed by the update merge path
  • add regression coverage for inbox selector fallback and avatar clearing behavior

🧪 How to Test

  • Tested locally
  • Added/updated tests
  • No tests needed

Local verification:

  • bunx vitest run --silent='passed-only' 'src/store/agent/selectors/selectors.test.ts' 'src/store/agent/slices/agent/action.test.ts'
  • bun run type-check

📸 Screenshots / Videos

Before After
Inbox agent avatar fell back to the generic agent default after deletion. Inbox agent avatar falls back to the dedicated inbox avatar after deletion.

📝 Additional Information

  • The branch was recreated from origin/canary to ensure the PR contains only this fix.

Copilot AI review requested due to automatic review settings April 12, 2026 08:22
@vercel

vercel Bot commented Apr 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lobehub Ready Ready Preview, Comment Apr 12, 2026 8:27am

Request Review

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We've reviewed this pull request using the Sourcery rules engine

@codecov

codecov Bot commented Apr 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 66.56%. Comparing base (37bf1bd) to head (5a1542a).
⚠️ Report is 2 commits behind head on canary.

Additional details and impacted files
@@            Coverage Diff             @@
##           canary   #13752      +/-   ##
==========================================
- Coverage   66.56%   66.56%   -0.01%     
==========================================
  Files        2022     2022              
  Lines      171262   171257       -5     
  Branches    20683    20682       -1     
==========================================
- Hits       113998   113991       -7     
- Misses      57139    57141       +2     
  Partials      125      125              
Flag Coverage Δ
app 58.61% <90.90%> (-0.01%) ⬇️
database 92.49% <ø> (ø)
packages/agent-runtime 79.72% <ø> (ø)
packages/context-engine 83.33% <ø> (ø)
packages/conversation-flow 92.36% <ø> (ø)
packages/file-loaders 87.02% <ø> (ø)
packages/memory-user-memory 74.74% <ø> (ø)
packages/model-bank 99.86% <ø> (ø)
packages/model-runtime 84.19% <ø> (-0.01%) ⬇️
packages/prompts 69.24% <ø> (ø)
packages/python-interpreter 92.90% <ø> (ø)
packages/ssrf-safe-fetch 0.00% <ø> (ø)
packages/utils 90.14% <ø> (ø)
packages/web-crawler 88.66% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Store 65.70% <90.00%> (+<0.01%) ⬆️
Services 52.19% <100.00%> (ø)
Server 66.31% <ø> (-0.01%) ⬇️
Libs 52.83% <ø> (ø)
Utils 91.07% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes inbox avatar fallback behavior after avatar deletion by ensuring avatar clearing is persisted and by applying an inbox-specific default avatar in agent selectors.

Changes:

  • Treat avatar deletion as an explicit null update so it isn’t dropped during merge/update flows.
  • Add inbox-specific avatar fallback logic to agent meta selectors.
  • Add regression tests covering inbox fallback and explicit avatar clearing behavior.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/store/agent/slices/agent/action.ts Narrows meta update typing to allow avatar: null (explicit clear) and aligns store action signatures.
src/store/agent/slices/agent/action.test.ts Adds regression test ensuring avatar: null is preserved through the update call path.
src/store/agent/selectors/selectors.ts Adds DEFAULT_INBOX_AVATAR fallback when the inbox agent has no custom avatar.
src/store/agent/selectors/selectors.test.ts Adds tests verifying inbox-specific avatar fallback for current and by-id meta selectors.
src/services/agent.ts Updates service typing for meta updates to allow nullable avatar clears.
src/routes/(main)/group/profile/features/MemberProfile/AgentHeader.tsx Switches avatar delete behavior from undefined to null for optimistic meta updates.
src/routes/(main)/agent/profile/features/ProfileEditor/AgentHeader.tsx Switches avatar delete behavior from undefined to null for meta updates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/services/agent.ts
Comment on lines +17 to +22
type AgentMetaUpdate = Partial<
Pick<
AgentItem,
'avatar' | 'backgroundColor' | 'description' | 'marketIdentifier' | 'tags' | 'title'
>
>;

Copilot AI Apr 12, 2026

Copy link

Choose a reason for hiding this comment

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

AgentMetaUpdate is defined locally here and also in src/store/agent/slices/agent/action.ts with the same shape. Consider extracting a single shared type (e.g., exported from a types module) to avoid the two definitions drifting over time when meta fields change.

Copilot uses AI. Check for mistakes.
@lobehub lobehub deleted a comment Apr 12, 2026
@Innei Innei merged commit f2ee67c into canary Apr 12, 2026
40 of 41 checks passed
@Innei Innei deleted the fix/inbox-avatar-fallback-pr branch April 12, 2026 09:40
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.

2 participants