[PR #7695] [MERGED] feat(video): file Conversation video messages under the characters they show #7887

Closed
opened 2026-10-24 04:08:29 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7695
Author: @JamesMowery
Created: 10/15/2026
Status: ✅ Merged
Merged: 10/16/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feat/convo-video-character-galleries


📝 Commits (10+)

  • ae770bd feat(video): file Conversation videos under the characters they show
  • c36602b fix(video): list Conversation clips in a persona's gallery only when they show the persona
  • 8002629 fix(video): count a unique first name as naming a chat member in a clip
  • 8eccc70 Merge branch 'staging' into feat/convo-video-character-galleries
  • d7d4e5d Merge branch 'feat/convo-video-command' into feat/convo-video-character-galleries
  • 9fc02d7 fix(video): match character names in video prompts more carefully
  • 520df8e fix(video): match only capitalised names, by id for the persona, and fix the gallery docs
  • 6668ef1 fix(video): skip single-quoted speech and match two-letter names in video clips
  • 5b7e033 fix(video): let quoted speech wrap onto the next line, stopping at a blank line
  • dc159da Merge branch 'staging' into feat/convo-video-character-galleries

📊 Changes

9 files changed (+441 additions, -52 deletions)

View changed files

📝 docs/characters/galleries.md (+1 -1)
📝 packages/server/src/db/schema/game-scene-videos.ts (+5 -0)
📝 packages/server/src/routes/characters.routes.ts (+58 -48)
📝 packages/server/src/routes/gallery.routes.ts (+4 -0)
📝 packages/server/src/services/generation/conversation-video-runtime.ts (+109 -2)
📝 packages/server/src/services/image/illustrator-references.ts (+1 -1)
📝 packages/server/src/services/storage/game-scene-videos.storage.ts (+14 -0)
📝 packages/server/src/services/video/chat-video-generation.ts (+3 -0)
➕ scripts/regressions/convo-video-character-galleries.regression.ts (+246 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Note

Depends on #7651 (item 3). This branch is built on #7651's current head, so until that merges, GitHub also shows its commits here. This PR's own changes are ae770bd70, c36602b71 and 80026290c, plus the review fixes 9fc02d740, 520df8ef3, 6668ef13d and 5b7e033bc.

Linked issue

Closes #7693
Part of #7545 (item 4). @SpicyMarinara

Why this change

  • A character's Gallery Videos tab listed every scene video from every chat the character was in. With Conversation video messages (#7651), each character in a group chat collected every other character's clips, including clips they aren't in.
  • A persona's gallery had the same problem: it listed every video from the persona's chats, whether or not the persona was in them.
  • A lot of this builds the foundation for future PRs that make videos a first-class citizen in Marinara Engine, and ensures videos show up to the characters/personas where it makes the most sense. Will be expanded to accommodate the RolePlay mode in a future PR as well.

What changed

  • Each Conversation video message records who it shows: the character who sent it, every chat character the clip names, and everyone in the chat when the text asks for a group photo or selfie (the selfie group wording; see the known limit below).
  • Character galleries list a tagged clip only for those characters.
  • Persona galleries (added while testing; second commit c36602b71) list a Conversation clip only when it names the persona. Before, a persona's gallery listed every video from its chats.
  • First names count (third commit 80026290c): a clip that says "Lena" is filed under "Dr. Lena Kowalski" when no one else in the chat shares that name; a surname two people share ("Kowalski") names neither. This applies to video messages only. The shared character matcher keeps its full-name rule, so pictures are unchanged.
  • Name matching rules after review (9fc02d740, 520df8ef3, 6668ef13d, 5b7e033bc):
    • A possessive names its owner ("Lena's arm" files the clip under Lena).
    • A name, or part of one, counts only when it is capitalised (scripts without capitals always count), so "hazel eyes", "her will to dance" or "a bob of hair" name no one.
    • Names inside quoted speech don't count: "…", “…”, «…» and single-quoted lines ('I'm here, Bob!'). A quote may wrap onto the next line but never crosses a blank line, so a stray quote mark (5'10") can't hide a paragraph of narration. Possessive and plural apostrophes are not quotes.
    • The persona is matched by id from the same name-part check, not through the character lookup, so a character whose name is part of the persona's, or a library character outside the chat, can't stand in for it.
    • Two-letter name parts count ("Al" for "Al Rivers").
    • When a gallery picture is animated, its own prompt is matched too, so the characters in the picture keep the clip.
    • The shared NAME_STOPWORDS list is now exported and reused here; picture matching is unchanged.
  • Older videos, and videos from Roleplay and Game Mode chats, have no tags and keep belonging to the whole chat, so they still list for every character and the persona of their chat. Nothing is deleted; only what each gallery lists changes.
  • Storage: game_scene_videos gains a nullable character_ids column (a JSON list). Older rows read it as null, so no migration or STORAGE_VERSION bump is needed (the file-backed store reads a missing column as null).

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Automated runs on 1106ac66f (based on #7651's head 8dd425b96, which includes staging):

  • pnpm check: passes.
  • Regression convo-video-character-galleries: passes. Through the real routes with fake text and ComfyUI services, it covers, in a group chat: a clip Aster sends that names Bob listed in Aster's and Bob's galleries but not Carol's; an untagged older video still listed for every character and the persona; the persona's gallery listing a clip only when it names the persona (and naming the persona adding no character); a first name ("Lena") filing the clip under Dr. Lena Kowalski; and a shared surname ("Kowalski") naming neither Lena nor Carol Kowalski. The persona and first-name checks fail without their fixes.
  • Related regressions pass: the convo-video, video, gallery, chat-profile, open-issues, advanced-memory-recall and localization filters.
  • Full pnpm regression: 893/893 pass.
  • After rebasing onto #7651's review fixes (eba7c2f51, 0ca0fcc0d), as 80026290c: pnpm check and the convo-video and gallery regressions pass again.
  • Local CodeRabbit review (CLI 0.9.0, base #7651's branch, with .coderabbit.yaml): 0 findings.
  • Not run: pnpm smoke:ui / pnpm regression:ui (Playwright browsers not installed locally). This PR has no client changes.

Manual verification notes

  • Manually verify in a group Conversation chat: a video message from one character appears in that character's Gallery Videos tab and not in the other characters'.
  • Manually verify a clip that names a second character by first name (for example "Lena") appears in both characters' galleries.
  • Known limit, not a check: a name at the start of a sentence is capitalised, so "Will she dance?" or "Rose petals fall." still files the clip under a character named Will or Rose. Video prompts usually open sentences with a character's name, so skipping sentence-initial words would miss far more real mentions.
  • Manually verify a clip that says "hazel eyes", or puts a character's name only inside quoted speech, is not filed under that character.
  • Known limit, not a check: the whole chat is included only when the prompt uses the selfie group wording ("group photo/picture/selfie", or "photo … together"), which video prompts rarely do. Characters a group clip names by name are still filed. Recognising "video" and "clip" there is an open follow-up in #7545.
  • Manually verify your persona's gallery shows a clip only when it names your persona.
  • Manually verify videos made before this change, and Roleplay and Game Mode videos, still appear in every character's gallery and the persona's.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

English docs updated: docs/characters/galleries.md (which gallery lists a video). Translations: #7694 (updated to the post-review wording)

UI evidence (if applicable)

No UI changes: only what each gallery lists changes.

Summary by CodeRabbit

  • New Features
    • Generate short character video messages in Conversation chats using /video or the Gallery. Choose a character, animate a gallery image, and review or edit prompts before generation.
    • Configure the video connection and choose a starting frame, such as a selfie, avatar, or no image. Videos can be generated when Illustrator is installed, even if selfies are turned off.
    • Clips are added to chat replies or saved to the Gallery when they can’t be attached.
  • Updates
    • Conversation galleries show clips for the sender and characters named in the clip; personas see clips only when named. Group-photo requests include all chat characters. Older clips and clips from other chat modes remain visible to all characters and the chat’s persona.
  • Documentation
    • Guides now cover video commands, setup, delivery, and gallery visibility.

🔄 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/7695 **Author:** [@JamesMowery](https://github.com/JamesMowery) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/16/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/convo-video-character-galleries` --- ### 📝 Commits (10+) - [`ae770bd`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ae770bd708fae17d817e7c2396fb223b67b21c43) feat(video): file Conversation videos under the characters they show - [`c36602b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c36602b719860ed156d867902fcd73aa61e4d624) fix(video): list Conversation clips in a persona's gallery only when they show the persona - [`8002629`](https://github.com/Pasta-Devs/Marinara-Engine/commit/80026290c51887451698cb284141f7343e7ef43c) fix(video): count a unique first name as naming a chat member in a clip - [`8eccc70`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8eccc70553f8d4bf2769dbdbbb6ae6b08147d534) Merge branch 'staging' into feat/convo-video-character-galleries - [`d7d4e5d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d7d4e5d9531d06da3cf8a06a02313395a8c444ca) Merge branch 'feat/convo-video-command' into feat/convo-video-character-galleries - [`9fc02d7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9fc02d74025b6f3bd8fcc906fe20e4ae90fd5f17) fix(video): match character names in video prompts more carefully - [`520df8e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/520df8ef3adc2434e5d4a468b4b6d0b8579b1f4f) fix(video): match only capitalised names, by id for the persona, and fix the gallery docs - [`6668ef1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6668ef13d6415a5ebf3c5ca67c930632bc28cf86) fix(video): skip single-quoted speech and match two-letter names in video clips - [`5b7e033`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5b7e033bc8de266393ecca283c18b84074ff151c) fix(video): let quoted speech wrap onto the next line, stopping at a blank line - [`dc159da`](https://github.com/Pasta-Devs/Marinara-Engine/commit/dc159da0201a5ea6484344b89f33a3d728e6becf) Merge branch 'staging' into feat/convo-video-character-galleries ### 📊 Changes **9 files changed** (+441 additions, -52 deletions) <details> <summary>View changed files</summary> 📝 `docs/characters/galleries.md` (+1 -1) 📝 `packages/server/src/db/schema/game-scene-videos.ts` (+5 -0) 📝 `packages/server/src/routes/characters.routes.ts` (+58 -48) 📝 `packages/server/src/routes/gallery.routes.ts` (+4 -0) 📝 `packages/server/src/services/generation/conversation-video-runtime.ts` (+109 -2) 📝 `packages/server/src/services/image/illustrator-references.ts` (+1 -1) 📝 `packages/server/src/services/storage/game-scene-videos.storage.ts` (+14 -0) 📝 `packages/server/src/services/video/chat-video-generation.ts` (+3 -0) ➕ `scripts/regressions/convo-video-character-galleries.regression.ts` (+246 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> > [!NOTE] > **Depends on #7651 (item 3).** This branch is built on #7651's current head, so until that merges, GitHub also shows its commits here. This PR's own changes are `ae770bd70`, `c36602b71` and `80026290c`, plus the review fixes `9fc02d740`, `520df8ef3`, `6668ef13d` and `5b7e033bc`. ## Linked issue Closes #7693 Part of #7545 (item 4). @SpicyMarinara ## Why this change - A character's Gallery **Videos** tab listed every scene video from every chat the character was in. With Conversation video messages (#7651), each character in a group chat collected every other character's clips, including clips they aren't in. - A persona's gallery had the same problem: it listed every video from the persona's chats, whether or not the persona was in them. - A lot of this builds the foundation for future PRs that make videos a first-class citizen in Marinara Engine, and ensures videos show up to the characters/personas where it makes the most sense. Will be expanded to accommodate the RolePlay mode in a future PR as well. ## What changed - **Each Conversation video message records who it shows**: the character who sent it, every chat character the clip names, and everyone in the chat when the text asks for a group photo or selfie (the selfie group wording; see the known limit below). - **Character galleries** list a tagged clip only for those characters. - **Persona galleries** (added while testing; second commit `c36602b71`) list a Conversation clip only when it names the persona. Before, a persona's gallery listed every video from its chats. - **First names count** (third commit `80026290c`): a clip that says "Lena" is filed under "Dr. Lena Kowalski" when no one else in the chat shares that name; a surname two people share ("Kowalski") names neither. This applies to video messages only. The shared character matcher keeps its full-name rule, so pictures are unchanged. - **Name matching rules after review** (`9fc02d740`, `520df8ef3`, `6668ef13d`, `5b7e033bc`): - A possessive names its owner ("Lena's arm" files the clip under Lena). - A name, or part of one, counts only when it is capitalised (scripts without capitals always count), so "hazel eyes", "her will to dance" or "a bob of hair" name no one. - Names inside quoted speech don't count: `"…"`, `“…”`, `«…»` and single-quoted lines (`'I'm here, Bob!'`). A quote may wrap onto the next line but never crosses a blank line, so a stray quote mark (`5'10"`) can't hide a paragraph of narration. Possessive and plural apostrophes are not quotes. - The persona is matched by id from the same name-part check, not through the character lookup, so a character whose name is part of the persona's, or a library character outside the chat, can't stand in for it. - Two-letter name parts count ("Al" for "Al Rivers"). - When a gallery picture is animated, its own prompt is matched too, so the characters in the picture keep the clip. - The shared `NAME_STOPWORDS` list is now exported and reused here; picture matching is unchanged. - **Older videos, and videos from Roleplay and Game Mode chats**, have no tags and keep belonging to the whole chat, so they still list for every character and the persona of their chat. Nothing is deleted; only what each gallery lists changes. - **Storage**: `game_scene_videos` gains a nullable `character_ids` column (a JSON list). Older rows read it as null, so no migration or `STORAGE_VERSION` bump is needed (the file-backed store reads a missing column as null). ## Validation <!-- Required: include commands run and/or manual checks performed --> - [x] `pnpm check` passes locally - [x] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` Automated runs on `1106ac66f` (based on #7651's head `8dd425b96`, which includes `staging`): - `pnpm check`: passes. - Regression `convo-video-character-galleries`: passes. Through the real routes with fake text and ComfyUI services, it covers, in a group chat: a clip Aster sends that names Bob listed in Aster's and Bob's galleries but not Carol's; an untagged older video still listed for every character and the persona; the persona's gallery listing a clip only when it names the persona (and naming the persona adding no character); a first name ("Lena") filing the clip under Dr. Lena Kowalski; and a shared surname ("Kowalski") naming neither Lena nor Carol Kowalski. The persona and first-name checks fail without their fixes. - Related regressions pass: the `convo-video`, `video`, `gallery`, `chat-profile`, `open-issues`, `advanced-memory-recall` and `localization` filters. - Full `pnpm regression`: 893/893 pass. - After rebasing onto #7651's review fixes (`eba7c2f51`, `0ca0fcc0d`), as `80026290c`: `pnpm check` and the `convo-video` and `gallery` regressions pass again. - Local CodeRabbit review (CLI 0.9.0, base #7651's branch, with `.coderabbit.yaml`): 0 findings. - Not run: `pnpm smoke:ui` / `pnpm regression:ui` (Playwright browsers not installed locally). This PR has no client changes. ### Manual verification notes - Manually verify in a group Conversation chat: a video message from one character appears in that character's Gallery **Videos** tab and not in the other characters'. - Manually verify a clip that names a second character by first name (for example "Lena") appears in both characters' galleries. - Known limit, not a check: a name at the start of a sentence is capitalised, so "Will she dance?" or "Rose petals fall." still files the clip under a character named Will or Rose. Video prompts usually open sentences with a character's name, so skipping sentence-initial words would miss far more real mentions. - Manually verify a clip that says "hazel eyes", or puts a character's name only inside quoted speech, is not filed under that character. - Known limit, not a check: the whole chat is included only when the prompt uses the selfie group wording ("group photo/picture/selfie", or "photo … together"), which video prompts rarely do. Characters a group clip names by name are still filed. Recognising "video" and "clip" there is an open follow-up in #7545. - Manually verify your persona's gallery shows a clip only when it names your persona. - Manually verify videos made before this change, and Roleplay and Game Mode videos, still appear in every character's gallery and the persona's. ## Docs and release impact - [ ] No docs changes needed - [x] Updated docs (README / CONTRIBUTING / android/README) as needed - [x] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) English docs updated: `docs/characters/galleries.md` (which gallery lists a video). Translations: #7694 (updated to the post-review wording) ## UI evidence (if applicable) No UI changes: only what each gallery lists changes. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Generate short character video messages in Conversation chats using `/video` or the Gallery. Choose a character, animate a gallery image, and review or edit prompts before generation. * Configure the video connection and choose a starting frame, such as a selfie, avatar, or no image. Videos can be generated when Illustrator is installed, even if selfies are turned off. * Clips are added to chat replies or saved to the Gallery when they can’t be attached. * **Updates** * Conversation galleries show clips for the sender and characters named in the clip; personas see clips only when named. Group-photo requests include all chat characters. Older clips and clips from other chat modes remain visible to all characters and the chat’s persona. * **Documentation** * Guides now cover video commands, setup, delivery, and gallery visibility. <!-- 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-24 04:08:29 +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#7887
No description provided.