mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1713] [Issue]: Remote avatar endpoint only serves character avatars — persona and NPC avatars always 404 #851
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#851
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Gunterlie on GitHub (May 31, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1713
Originally assigned to: @cha1latte on GitHub.
Summary
The
/api/assets/avatar/endpoint only serves avatars fromavatars/characters/but persona and NPC avatars are saved to different subdirectories that the endpoint never looks at. Files are written to locations they can never be served from.Expected behavior
Persona and NPC avatars are served correctly via the remote asset endpoint when using a remote runtime, just like character avatars.
Actual behavior
avatars/personas/but the endpoint only serves fromavatars/characters/→ 404avatars/npc/{chat_id}/{name}→ endpoint rejects the subdirectory path entirely → 404avatarPathfallback in the DB, but files are written to locations they can never be served fromavatarPathis not a base64 data URL (e.g. built-in characters referencing/sprites/...)Steps to reproduce
To confirm directly:
Environment
Additional context
Root cause is in
http_server.rs—avatar_asset_pathhardcodesavatars/characters/:But saves go to different locations depending on type:
persona_avatar_upload):avatars/personas/npc_avatar_upload):avatars/npc/{chat_id}/{name}The NPC case is additionally broken because the path includes a subdirectory (
{chat_id}) whichavatar_asset_filenameexplicitly rejects (contains/).Why it's not always visible:
avatarPathin each record stores a base64 data URL as a fallback. The frontend falls back to this if the file endpoint fails. This masks the issue but means large base64 blobs are embedded in every API response instead of serving files efficiently.Possible fixes:
avatar_asset_pathto accept a collection prefix and update the frontend to pass it in the URL (e.g./api/assets/avatar/personas/{filename})Template check
@cha1latte commented on GitHub (May 31, 2026):
Fixed in #1741