#10314: fix(webui): read avatar from ui.assistant.avatar config path
agents
stale
## Summary
- Fix avatar serving endpoint to read from `ui.assistant.avatar` config path
- Aligns `resolveAvatarSource` with `resolveAssistantIdentity` priority order
- Add test case for `ui.assistant.avatar` priority over `agents.list[].identity.avatar`
**Root cause:** The webui settings page saves avatar configuration to `ui.assistant.avatar`, but `resolveAgentAvatar` (used by `/avatar/{agentId}` endpoint) only checked `agents.list[].identity.avatar`, causing configured avatars to return 404.
## Test plan
- [x] Added test: `prioritizes ui.assistant.avatar over agents.list[].identity.avatar`
- [x] Existing tests pass
Fixes #10249
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
- Updates agent avatar resolution to prioritize `ui.assistant.avatar` over `agents.list[].identity.avatar`, matching WebUI config behavior.
- Adds a regression test ensuring the WebUI avatar setting is preferred when both are present.
- Plumbs `sandboxRoot` into the message tool and adds tests validating sandbox path enforcement for `filePath`/`path`.
<h3>Confidence Score: 3/5</h3>
- This PR is mostly safe to merge, but sandbox enforcement can still be bypassed if sandboxRoot isn’t consistently provided in sandboxed contexts.
- Avatar-path priority change is small and covered by a new regression test. However, the newly added sandbox validation in `message-tool` is conditional on `sandboxRoot` being present, so any sandboxed execution path that forgets to pass it would negate the intended security fix.
- src/agents/tools/message-tool.ts; ensure all sandboxed tool creation paths always pass sandboxRoot (or enforce validation based on sandboxed mode).
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
lobster-biscuit
Most Similar PRs
#11603: feat(gateway): avatar upload + config identity
by advaitpaliwal · 2026-02-08
76.7%
#22808: test(ui): split baseline browser-test fixes from webchat feature
by opnsec · 2026-02-21
73.8%
#3721: fix(ui): webchat not displaying chat responses
by maxmaxrouge-rgb · 2026-01-29
73.2%
#14309: fix(ui): resolve chat event session key mismatch
by justonlyforyou · 2026-02-11
72.8%
#15852: fix: pass agentId when resolving IRC session paths
by MisterGuy420 · 2026-02-14
72.1%
#4226: Fix/sandbox containerworkdir rw access
by ozgur-polat · 2026-01-29
71.4%
#13318: fix(agents): prevent sanitizeUserFacingText from rewriting conversa...
by hleliofficiel · 2026-02-10
71.4%
#22977: fix(ui): resolve agent names from config in session dropdown
by NikhilGaddam · 2026-02-21
71.3%
#21679: fix: Mission Control dashboard issues for agent status, stale sessi...
by thejawdoc · 2026-02-20
71.0%
#12974: fix: intermittent (no output) reported by users
by vincentkoc · 2026-02-10
70.8%