[PR #3361] [MERGED] Fix message rendering and agent image prompt edges #5900

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/3361
Author: @SpicyMarinara
Created: 7/8/2026
Status: ✅ Merged
Merged: 7/8/2026
Merged by: @SpicyMarinara

Base: staging ← Head: agent/fix-message-agent-image-prompts


📝 Commits (1)

  • 8f677f7 Fix message and agent image prompt edges

📊 Changes

10 files changed (+81 additions, -21 deletions)

View changed files

📝 packages/client/src/components/chat/ChatImageLightbox.tsx (+2 -0)
📝 packages/client/src/components/chat/ChatMessage.tsx (+2 -2)
📝 packages/client/src/hooks/use-generate.ts (+30 -5)
📝 packages/client/src/lib/tts-dialogue.ts (+9 -7)
📝 packages/server/src/routes/generate/agent-connection-guards.ts (+3 -0)
📝 packages/server/src/routes/generate/retry-agents-route.ts (+1 -0)
📝 packages/server/src/services/game/game-asset-generation.ts (+1 -0)
📝 packages/server/src/services/generation/agent-resolution.ts (+1 -0)
📝 packages/shared/src/utils/image-prompt-compiler.ts (+7 -2)
📝 packages/shared/src/utils/speaker-segments.ts (+25 -5)

📄 Description

Summary

  • Keep gallery lightbox interactions from closing the gallery drawer while copying prompt text or using lightbox controls.
  • Suppress repeated default-agent-connection model warning toasts per chat until the agent connection/model changes.
  • Apply Style Profile prompt grammar to hardcoded Game Mode background and scene illustration prompts so Danbooru/Tags/Hybrid modes shape the whole provider prompt.
  • Decode encoded <speaker> tags in message rendering, grouping, and TTS so group dialogue coloring and speaker attribution keep working when tags arrive as &lt;...&gt;.

Why

Users reported gallery prompt interactions closing the gallery, noisy repeated agent model toasts, GM image prompts staying prose-first despite tag grammar settings, and encoded speaker tags breaking group chat dialogue coloring.

Related: #3225

Validation

  • pnpm check

Manual verification needed

  • Manually verify gallery lightbox prompt copy/select interactions keep the gallery open.
  • Manually verify default agent connection warning appears once per chat/connection/model and reappears after changing the agent connection/model.
  • Manually verify Game Mode image prompt review/provider prompts follow Danbooru/Tags/Natural/Hybrid profile grammar for background and scene illustration generation.
  • Manually verify encoded speaker tags display and color group chat dialogue correctly.

Summary by CodeRabbit

  • New Features

    • Improved handling of speaker-tagged content across chat, text-to-speech, and related message processing.
    • Image prompt generation now better supports certain prompt modes and tag formats.
  • Bug Fixes

    • Fixed duplicated agent warning notifications by making toast handling more consistent.
    • Improved parsing of encoded speaker tags and HTML-escaped content in messages and dialogue.
    • Better preserves intended prompt text for background and illustration generation.

🔄 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/3361 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 7/8/2026 **Status:** ✅ Merged **Merged:** 7/8/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `agent/fix-message-agent-image-prompts` --- ### 📝 Commits (1) - [`8f677f7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8f677f789d69ffe745a63f8631d1041d5aefc42e) Fix message and agent image prompt edges ### 📊 Changes **10 files changed** (+81 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/ChatImageLightbox.tsx` (+2 -0) 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+2 -2) 📝 `packages/client/src/hooks/use-generate.ts` (+30 -5) 📝 `packages/client/src/lib/tts-dialogue.ts` (+9 -7) 📝 `packages/server/src/routes/generate/agent-connection-guards.ts` (+3 -0) 📝 `packages/server/src/routes/generate/retry-agents-route.ts` (+1 -0) 📝 `packages/server/src/services/game/game-asset-generation.ts` (+1 -0) 📝 `packages/server/src/services/generation/agent-resolution.ts` (+1 -0) 📝 `packages/shared/src/utils/image-prompt-compiler.ts` (+7 -2) 📝 `packages/shared/src/utils/speaker-segments.ts` (+25 -5) </details> ### 📄 Description ## Summary - Keep gallery lightbox interactions from closing the gallery drawer while copying prompt text or using lightbox controls. - Suppress repeated default-agent-connection model warning toasts per chat until the agent connection/model changes. - Apply Style Profile prompt grammar to hardcoded Game Mode background and scene illustration prompts so Danbooru/Tags/Hybrid modes shape the whole provider prompt. - Decode encoded `<speaker>` tags in message rendering, grouping, and TTS so group dialogue coloring and speaker attribution keep working when tags arrive as `&lt;...&gt;`. ## Why Users reported gallery prompt interactions closing the gallery, noisy repeated agent model toasts, GM image prompts staying prose-first despite tag grammar settings, and encoded speaker tags breaking group chat dialogue coloring. Related: #3225 ## Validation - pnpm check ## Manual verification needed - Manually verify gallery lightbox prompt copy/select interactions keep the gallery open. - Manually verify default agent connection warning appears once per chat/connection/model and reappears after changing the agent connection/model. - Manually verify Game Mode image prompt review/provider prompts follow Danbooru/Tags/Natural/Hybrid profile grammar for background and scene illustration generation. - Manually verify encoded speaker tags display and color group chat dialogue correctly. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Improved handling of speaker-tagged content across chat, text-to-speech, and related message processing. * Image prompt generation now better supports certain prompt modes and tag formats. * **Bug Fixes** * Fixed duplicated agent warning notifications by making toast handling more consistent. * Improved parsing of encoded speaker tags and HTML-escaped content in messages and dialogue. * Better preserves intended prompt text for background and illustration generation. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:04:57 +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#5900
No description provided.