[GH-ISSUE #2294] [Issue]: Character Tracker "Auto-generate avatars" toggle is a dead control (NPC portraits are never generated) #1129

Closed
opened 2026-10-21 05:27:33 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @Romuromylus on GitHub (Jun 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2294

Originally assigned to: @SpicyMarinara on GitHub.

Summary

The Character Tracker agent's "Auto-generate avatars" setting (autoGenerateAvatars) is exposed in the roleplay HUD and the agent editor and persists when toggled, but no code path consumes it. Enabling it generates zero NPC portraits, unlike main which auto-generates them.

Expected behavior

When "Auto-generate avatars" is enabled on the Character Tracker agent and an image connection is configured, present NPCs that lack an avatar but have an appearance description should get portraits auto-generated (fire-and-forget) and streamed back into the tracker, in both roleplay and game modes.

Actual behavior

Toggling the control only persists settings.autoGenerateAvatars = true. Nothing reads it to trigger generation, so NPC portraits are never auto-generated and the user must manually upload every avatar. The toggle and its help text ("the Character Tracker will automatically generate portrait images for NPCs that don't have an avatar") are a falsely-advertised, dead control.

Steps to reproduce

  1. In a roleplay or game chat, enable the Character Tracker agent and configure an image-generation connection.
  2. Turn on "Auto-generate avatars" (the purple Sparkles "Auto" button in the roleplay HUD characters section, or the toggle in the agent editor).
  3. Continue the chat so the tracker surfaces a present NPC that has an appearance description and no avatar.
  4. Observe: no portrait is generated for the NPC; the avatar slot stays empty until a manual upload.

Impact area

  • App shell, navigation, startup, or providers
  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: refactor @ f56a3774 (compared against main @ b4ab97fb)
  • Run mode: Tauri desktop
  • OS + version: Windows 11
  • Node + pnpm versions: n/a (static source audit)
  • Rust version, if relevant: n/a (static source audit)
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: Any image-generation connection (Character Tracker imageConnectionId)

Logs, screenshots, or video

n/a (static source comparison of main vs refactor)

Regression notes

Worked in main. Main packages/server/src/routes/generate.routes.ts:8951-9040 implements the fire-and-forget auto-gen: gated on charTrackerAgent.settings.autoGenerateAvatars && imageConnectionId (8953-8955), filters present characters needing avatars (!avatarPath, non-manual id, has name + appearance; 8956-8962), generates via generateImage (8989-8997), saves under the NPC avatar dir (9004-9006), then re-persists and streams a game_state_patch back to the client (9017-9031).

Refactor: the setting is read only to render and persist the toggle. src/features/runtime/world-state/hooks/use-tracker-character-avatar-actions.ts:65 derives autoGenerateCharacterAvatars; :67-76 toggleAutoGenerateCharacterAvatars only flips the persisted key; uploadCharacterAvatar (:78-132) is manual upload only (npcAvatarApi.upload). The derived flag is consumed only by button rendering in src/features/modes/roleplay/components/RoleplayHUDCharactersTrackerSection.tsx:136,140 and src/features/runtime/tracker/components/TrackerSectionList.tsx:119,129, and persisted from src/features/catalog/agents/components/AgentEditor.tsx:297,547. The help text promising auto-generation is at AgentEditor.tsx:1089. Grepping autoGenerateAvatars / autoGenerateCharacterAvatars across the whole refactor tree (src + src-tauri incl crates) finds no generation trigger. The only avatar-generation entry point (avatar_generation command, src-tauri/src/commands/storage/images.rs) is a manual request handler with no tracker-settings-keyed caller, and the game-mode generatedNpcAvatars flow is gated on enableSpriteGeneration, not autoGenerateAvatars.

Additional context

Two ways to resolve: wire autoGenerateAvatars into the character-tracker result path so it generates portraits as main does, or remove the toggle and help text so the UI does not advertise a feature that currently does nothing.

Template check

Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Romuromylus on GitHub (Jun 5, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2294 Originally assigned to: @SpicyMarinara on GitHub. ## Summary The Character Tracker agent's "Auto-generate avatars" setting (`autoGenerateAvatars`) is exposed in the roleplay HUD and the agent editor and persists when toggled, but **no code path consumes it**. Enabling it generates zero NPC portraits, unlike main which auto-generates them. ## Expected behavior When "Auto-generate avatars" is enabled on the Character Tracker agent and an image connection is configured, present NPCs that lack an avatar but have an appearance description should get portraits auto-generated (fire-and-forget) and streamed back into the tracker, in both roleplay and game modes. ## Actual behavior Toggling the control only persists `settings.autoGenerateAvatars = true`. Nothing reads it to trigger generation, so NPC portraits are never auto-generated and the user must manually upload every avatar. The toggle and its help text ("the Character Tracker will automatically generate portrait images for NPCs that don't have an avatar") are a falsely-advertised, dead control. ## Steps to reproduce 1. In a roleplay or game chat, enable the Character Tracker agent and configure an image-generation connection. 2. Turn on "Auto-generate avatars" (the purple Sparkles "Auto" button in the roleplay HUD characters section, or the toggle in the agent editor). 3. Continue the chat so the tracker surfaces a present NPC that has an appearance description and no avatar. 4. Observe: no portrait is generated for the NPC; the avatar slot stays empty until a manual upload. ## Impact area - [ ] App shell, navigation, startup, or providers - [ ] Catalog resources - [ ] Chat mode - [x] Roleplay mode - [x] Game mode - [ ] Shared mode UI - [x] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [ ] React-free engine behavior, contracts, agents, or capability ports - [ ] Shared API wrapper or remote runtime routing - [ ] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: refactor @ f56a3774 (compared against main @ b4ab97fb) - Run mode: Tauri desktop - OS + version: Windows 11 - Node + pnpm versions: n/a (static source audit) - Rust version, if relevant: n/a (static source audit) - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: Any image-generation connection (Character Tracker imageConnectionId) ## Logs, screenshots, or video n/a (static source comparison of main vs refactor) ## Regression notes Worked in main. Main `packages/server/src/routes/generate.routes.ts:8951-9040` implements the fire-and-forget auto-gen: gated on `charTrackerAgent.settings.autoGenerateAvatars && imageConnectionId` (8953-8955), filters present characters needing avatars (`!avatarPath`, non-manual id, has name + appearance; 8956-8962), generates via `generateImage` (8989-8997), saves under the NPC avatar dir (9004-9006), then re-persists and streams a `game_state_patch` back to the client (9017-9031). Refactor: the setting is read only to render and persist the toggle. `src/features/runtime/world-state/hooks/use-tracker-character-avatar-actions.ts:65` derives `autoGenerateCharacterAvatars`; `:67-76` `toggleAutoGenerateCharacterAvatars` only flips the persisted key; `uploadCharacterAvatar` (`:78-132`) is manual upload only (`npcAvatarApi.upload`). The derived flag is consumed only by button rendering in `src/features/modes/roleplay/components/RoleplayHUDCharactersTrackerSection.tsx:136,140` and `src/features/runtime/tracker/components/TrackerSectionList.tsx:119,129`, and persisted from `src/features/catalog/agents/components/AgentEditor.tsx:297,547`. The help text promising auto-generation is at `AgentEditor.tsx:1089`. Grepping `autoGenerateAvatars` / `autoGenerateCharacterAvatars` across the whole refactor tree (src + src-tauri incl crates) finds no generation trigger. The only avatar-generation entry point (`avatar_generation` command, `src-tauri/src/commands/storage/images.rs`) is a manual request handler with no tracker-settings-keyed caller, and the game-mode `generatedNpcAvatars` flow is gated on `enableSpriteGeneration`, not `autoGenerateAvatars`. ## Additional context Two ways to resolve: wire `autoGenerateAvatars` into the character-tracker result path so it generates portraits as main does, or remove the toggle and help text so the UI does not advertise a feature that currently does nothing. ## Template check Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:27:33 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Jun 6, 2026):

Let's wire autoGenerateAvatars into the character-tracker result path.

<!-- gh-comment-id:4637994803 --> @SpicyMarinara commented on GitHub (Jun 6, 2026): Let's wire autoGenerateAvatars into the character-tracker result path.
Author
Owner

@SpicyMarinara commented on GitHub (Jun 6, 2026):

Fixed on refactor in commit 1844810e.

What changed:

  • Character Tracker results now consume autoGenerateAvatars.
  • Present NPCs with a name and appearance, no avatar, and no manual tracker id get an avatar generated through the configured/default agent image connection.
  • Generated images are saved through the NPC avatar upload path and patched back into the emitted tracker result before tracker snapshots and agent result storage are persisted.
  • Existing tracker avatar paths are preserved/reused so repeated tracker runs do not overwrite or regenerate portraits unnecessarily.
  • Cleaned a few unused internal exports surfaced by the full check.

Verification:

  • pnpm typecheck
  • pnpm check:architecture
  • pnpm check
  • pnpm check:unused after cleanup
<!-- gh-comment-id:4638098165 --> @SpicyMarinara commented on GitHub (Jun 6, 2026): Fixed on refactor in commit 1844810e. What changed: - Character Tracker results now consume autoGenerateAvatars. - Present NPCs with a name and appearance, no avatar, and no manual tracker id get an avatar generated through the configured/default agent image connection. - Generated images are saved through the NPC avatar upload path and patched back into the emitted tracker result before tracker snapshots and agent result storage are persisted. - Existing tracker avatar paths are preserved/reused so repeated tracker runs do not overwrite or regenerate portraits unnecessarily. - Cleaned a few unused internal exports surfaced by the full check. Verification: - pnpm typecheck - pnpm check:architecture - pnpm check - pnpm check:unused after cleanup
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#1129
No description provided.