[PR #1846] [MERGED] Fix remote chat avatar resolution #5315

Closed
opened 2026-10-22 04:15:10 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1846
Author: @cha1latte
Created: 6/1/2026
Status: ✅ Merged
Merged: 6/1/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/issue-1842-chat-avatar-auth


📝 Commits (3)

  • c12525c Fix remote chat avatar resolution
  • d4e2a41 Retrigger PR checks
  • 569c8e9 Avoid stale resolved avatar frames

📊 Changes

5 files changed (+348 additions, -34 deletions)

View changed files

📝 src/features/modes/shared/chat-ui/components/ChatMessage.tsx (+88 -30)
➕ src/features/modes/shared/chat-ui/components/ResolvedAvatarImage.test.tsx (+144 -0)
➕ src/features/modes/shared/chat-ui/components/ResolvedAvatarImage.tsx (+111 -0)
📝 src/features/modes/shared/chat-ui/hooks/use-chat-surface-data.ts (+3 -4)
📝 src/features/runtime/visuals/types.ts (+2 -0)

📄 Description

Linked issue

Closes #1842

Why this change

  • Chat transcript character avatars were still using a synchronous avatarUrl string. On authenticated remote runtimes that string could fall back to a stale absolute avatarFilePath from the upload machine, producing broken image requests like /Users/....
  • Other avatar surfaces resolve managed avatar files asynchronously so Basic Auth headers can be included; the chat transcript now follows the same managed-file contract.

What changed

  • Added ResolvedAvatarImage for chat avatars so managed avatar files resolve through resolveAvatarFileUrl() before rendering.
  • Threaded avatarFilePath and avatarFilename through useChatSurfaceData() and CharacterMap.
  • Swapped transcript character avatar render paths, including merged group avatars and roleplay panel/tail avatars, to use the resolver component.
  • Added focused jsdom coverage for stale filesystem paths, resolver failure fallback, and inline expression avatars.

Refactor impact

Primary owner:

  • shared chat UI

Impact areas reviewed:

  • Chat transcript avatar rendering.
  • Merged group avatar cycling/lightbox behavior.
  • Expression avatar rendering.
  • Character map data consumed by chat UI.

Boundary notes:

  • Feature/UI code now consumes the existing src/shared/api/local-file-api.ts resolver. No engine, Rust, storage schema, dependency, or remote runtime API changes.

Pressure points touched:

  • Shared mode UI ChatMessage.tsx.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • Codex ran pnpm exec vitest run src\features\modes\shared\chat-ui\components\ResolvedAvatarImage.test.tsx: 4 tests passed.
  • Codex ran pnpm check: line endings, architecture, frontend typecheck, Rust cargo check, docs, discovery metadata, and knip all passed.
  • Manual remote-server visual verification is still pending: test a remote Marinara server with Basic Auth and a character whose stored avatarFilePath points at a different machine, then confirm chat transcript avatars render and no /Users/... request appears in Network.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • Bugfix only; no new discoverable feature or workflow.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

  • No screenshot attached yet. Exact visual proof requires a remote Marinara server with Basic Auth plus stale absolute avatar paths from another machine; this draft should remain draft until that environment is checked.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/1846 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/1/2026 **Status:** ✅ Merged **Merged:** 6/1/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-1842-chat-avatar-auth` --- ### 📝 Commits (3) - [`c12525c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c12525cac3451fc3e241c36a63fe3f8557e9913d) Fix remote chat avatar resolution - [`d4e2a41`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d4e2a41377aff76050c4acdf6c926e3c71cd0186) Retrigger PR checks - [`569c8e9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/569c8e9535dfc0eeb3ec817568f80400fee682fa) Avoid stale resolved avatar frames ### 📊 Changes **5 files changed** (+348 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `src/features/modes/shared/chat-ui/components/ChatMessage.tsx` (+88 -30) ➕ `src/features/modes/shared/chat-ui/components/ResolvedAvatarImage.test.tsx` (+144 -0) ➕ `src/features/modes/shared/chat-ui/components/ResolvedAvatarImage.tsx` (+111 -0) 📝 `src/features/modes/shared/chat-ui/hooks/use-chat-surface-data.ts` (+3 -4) 📝 `src/features/runtime/visuals/types.ts` (+2 -0) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue Closes #1842 ## Why this change - Chat transcript character avatars were still using a synchronous `avatarUrl` string. On authenticated remote runtimes that string could fall back to a stale absolute `avatarFilePath` from the upload machine, producing broken image requests like `/Users/...`. - Other avatar surfaces resolve managed avatar files asynchronously so Basic Auth headers can be included; the chat transcript now follows the same managed-file contract. ## What changed - Added `ResolvedAvatarImage` for chat avatars so managed avatar files resolve through `resolveAvatarFileUrl()` before rendering. - Threaded `avatarFilePath` and `avatarFilename` through `useChatSurfaceData()` and `CharacterMap`. - Swapped transcript character avatar render paths, including merged group avatars and roleplay panel/tail avatars, to use the resolver component. - Added focused jsdom coverage for stale filesystem paths, resolver failure fallback, and inline expression avatars. ## Refactor impact Primary owner: - shared chat UI Impact areas reviewed: - Chat transcript avatar rendering. - Merged group avatar cycling/lightbox behavior. - Expression avatar rendering. - Character map data consumed by chat UI. Boundary notes: - Feature/UI code now consumes the existing `src/shared/api/local-file-api.ts` resolver. No engine, Rust, storage schema, dependency, or remote runtime API changes. Pressure points touched: - Shared mode UI `ChatMessage.tsx`. ## Validation <!-- Check only what you personally ran or manually verified. Treat unchecked items as explicit TODOs. --> <!-- Do not submit *.test.ts or *.test.tsx files as PR proof; cite existing checks, command output, app/browser/Tauri verification, or manual notes instead. --> - [ ] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [ ] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - Codex ran `pnpm exec vitest run src\features\modes\shared\chat-ui\components\ResolvedAvatarImage.test.tsx`: 4 tests passed. - Codex ran `pnpm check`: line endings, architecture, frontend typecheck, Rust cargo check, docs, discovery metadata, and knip all passed. - Manual remote-server visual verification is still pending: test a remote Marinara server with Basic Auth and a character whose stored `avatarFilePath` points at a different machine, then confirm chat transcript avatars render and no `/Users/...` request appears in Network. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [x] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - Bugfix only; no new discoverable feature or workflow. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence - No screenshot attached yet. Exact visual proof requires a remote Marinara server with Basic Auth plus stale absolute avatar paths from another machine; this draft should remain draft until that environment is checked. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:15:10 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#5315
No description provided.