[PR #619] [MERGED] Support random expression sprite groups #4702

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/619
Author: @cha1latte
Created: 5/9/2026
Status: ✅ Merged
Merged: 5/9/2026
Merged by: @cha1latte

Base: main ← Head: feat/issue-471-random-expression-sprites


📝 Commits (1)

  • 67b5b11 Support random expression sprite groups

📊 Changes

6 files changed (+100 additions, -18 deletions)

View changed files

📝 packages/server/src/routes/generate.routes.ts (+15 -11)
📝 packages/server/src/routes/generate/expression-agent-utils.ts (+17 -0)
📝 packages/server/src/routes/generate/retry-agents-route.ts (+13 -3)
📝 packages/server/src/services/agents/agent-executor.ts (+3 -1)
📝 packages/server/src/services/game/sprite.service.ts (+49 -1)
📝 packages/shared/src/constants/agent-prompts.ts (+3 -2)

📄 Description

Linked issue

Closes #471

Why this change

  • Expression Engine currently exposes concrete sprite filenames to the agent, which makes characters with multiple variants for the same mood harder to configure and bloats the available sprite prompt. This lets users keep simple SillyTavern-style keys like joy while the engine rotates through matching joy_* sprite variants.

What changed

  • Added compact expression choices that collapse repeated underscore-prefixed variants like joy_01 / joy_laugh into the group key joy for agent prompt context.
  • Updated Expression Engine validation to resolve group keys to a random concrete matching sprite before persisting or sending results to the client.
  • Reused the grouped sprite catalog in normal generation and retry-agent generation.
  • Updated the built-in Expression Engine prompt to explain group keys.

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

Manual verification notes

  • Codex verification in clean worktree C:\tmp\Marinara-Engine-issue-471:
    • pnpm --filter @marinara-engine/server exec tsx ../../scratch/verify-random-expression-groups.ts
    • pnpm check
  • Scratch proof confirmed compact choices expose joy, hide joy_01 / joy_laugh, resolve repeated joy selections across both concrete variants, and keep one-off side_eye exact.
  • Manual browser/app verification pending: create or use a character with multiple joy_* expression sprites, have Expression Engine choose joy, and confirm repeated runs rotate among matching variants.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

N/A. This is server-side expression selection behavior; no UI layout changed.


🔄 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/619 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/9/2026 **Status:** ✅ Merged **Merged:** 5/9/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `main` ← **Head:** `feat/issue-471-random-expression-sprites` --- ### 📝 Commits (1) - [`67b5b11`](https://github.com/Pasta-Devs/Marinara-Engine/commit/67b5b1141b8948fb6381974561c74837176e8a72) Support random expression sprite groups ### 📊 Changes **6 files changed** (+100 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/routes/generate.routes.ts` (+15 -11) 📝 `packages/server/src/routes/generate/expression-agent-utils.ts` (+17 -0) 📝 `packages/server/src/routes/generate/retry-agents-route.ts` (+13 -3) 📝 `packages/server/src/services/agents/agent-executor.ts` (+3 -1) 📝 `packages/server/src/services/game/sprite.service.ts` (+49 -1) 📝 `packages/shared/src/constants/agent-prompts.ts` (+3 -2) </details> ### 📄 Description ## Linked issue Closes #471 ## Why this change - Expression Engine currently exposes concrete sprite filenames to the agent, which makes characters with multiple variants for the same mood harder to configure and bloats the available sprite prompt. This lets users keep simple SillyTavern-style keys like `joy` while the engine rotates through matching `joy_*` sprite variants. ## What changed - Added compact expression choices that collapse repeated underscore-prefixed variants like `joy_01` / `joy_laugh` into the group key `joy` for agent prompt context. - Updated Expression Engine validation to resolve group keys to a random concrete matching sprite before persisting or sending results to the client. - Reused the grouped sprite catalog in normal generation and retry-agent generation. - Updated the built-in Expression Engine prompt to explain group keys. ## 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` ### Manual verification notes - Codex verification in clean worktree `C:\tmp\Marinara-Engine-issue-471`: - `pnpm --filter @marinara-engine/server exec tsx ../../scratch/verify-random-expression-groups.ts` - `pnpm check` - Scratch proof confirmed compact choices expose `joy`, hide `joy_01` / `joy_laugh`, resolve repeated `joy` selections across both concrete variants, and keep one-off `side_eye` exact. - Manual browser/app verification pending: create or use a character with multiple `joy_*` expression sprites, have Expression Engine choose `joy`, and confirm repeated runs rotate among matching variants. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) N/A. This is server-side expression selection behavior; no UI layout changed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:09: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#4702
No description provided.