[PR #5555] [MERGED] feat: add character card summaries #6814

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5555
Author: @Gunterlie
Created: 8/26/2026
Status: ✅ Merged
Merged: 8/26/2026
Merged by: @Gunterlie

Base: staging ← Head: sparknotes-the-cast


📝 Commits (7)

  • 06e1fc8 feat: add character card summaries
  • 905fc01 fix: address CodeRabbit findings on character summary feature
  • 85892d9 fix: use unsaved editor draft when generating a character summary
  • 1a16f56 fix: address remaining review findings on character summary feature
  • 2f6a27e fix: search the full character summary, not the truncated preview
  • 09ecf96 fix: share summary generation and stop bulk clobbering new summaries
  • 4510018 fix: make bulk missing-only summary writes atomic

📊 Changes

14 files changed (+478 additions, -14 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 packages/client/src/components/characters/CharacterEditor.tsx (+79 -0)
📝 packages/client/src/components/characters/CharacterLibraryView.tsx (+227 -4)
📝 packages/client/src/hooks/use-characters.ts (+22 -0)
📝 packages/client/src/localization/locales/en.json (+18 -0)
📝 packages/server/src/db/seed-mari.ts (+3 -2)
📝 packages/server/src/routes/characters.routes.ts (+98 -2)
📝 packages/server/src/services/chat-summary/connection-resolution.ts (+6 -1)
📝 packages/server/src/services/conversation/character-commands.ts (+3 -0)
📝 packages/server/src/services/generation/professor-mari-command-runtime.ts (+2 -0)
📝 packages/server/src/services/import/st-character.importer.ts (+3 -0)
📝 packages/server/src/services/mari-db/mari-db.service.ts (+12 -5)
📝 packages/shared/src/schemas/character.schema.ts (+1 -0)
📝 packages/shared/src/types/character.ts (+2 -0)

📄 Description

Closes #5554

Why

Character cards have no short, general-purpose synopsis field. The Character Library currently fakes one by concatenating creator_notes/description/personality, which is noisy, not user-editable, and duplicates model-facing prompt content in the UI. Users asked for a real summary datapoint per card to improve library previews, search, and sharing without adding prompt tokens.

What changed

  • Added data.summary (string, max 500 chars) to the shared character schema/type. Stored in the existing serialized characters.data JSON — no new DB column.
  • Metadata-only: summary is never injected into the model prompt.
  • Character Editor: new Summary field before Description, with character count, helper text, and a single-card AI "Generate" button (draft only, never auto-saves, guarded against stale results if the user switches characters mid-generation).
  • New route POST /api/characters/:id/summary/generate, using the existing connection-resolution fallback chain (chat-summary connection → agent default → normal default).
  • Character Library: explicit summary shown in grid cards and detail panel (labeled section), used in search, existing fallback preserved for cards without one.
  • Character Library selection mode: bulk "Generate missing summaries" / "Regenerate selected", with confirmation, bounded concurrency (2 workers), progress, cancel, retry, and partial-failure handling. "Select all matching" works across pagination and respects active filters.
  • Professor Mari, mari CLI, and character command paths can read/write summary (all normalized to the 500-char limit at the write boundary).
  • Version comparison includes summary.
  • Import paths (SillyTavern importer, native V2) preserve/truncate summary to the schema limit.
  • Localized English UI strings added; CHANGELOG updated.

Review history

Two independent CodeRabbit-style reviews were run against this diff during development; all 10 findings raised (stale-generation races, missing default-connection fallback, unsafe bulk "missing-only" overwrite risk, stale bulk progress on selection-mode re-entry, unhandled select-all-matching errors, non-retryable cancellation, unbounded imported/CLI/Mari summary length, and a locale string ordering bug) were fixed and re-validated.

Validation

  • pnpm check (TypeScript, ESLint, formatting, localization, server + client build) passes
  • pnpm localization:check passes
  • pnpm regression:prompt passes
  • No automated browser/UI test was run

Manual test plan (unchecked — needs human verification)

  • Generate and save a summary on a character card
  • Switch characters while generation is in flight — confirm result doesn't leak onto the wrong card
  • Bulk "Generate missing summaries" only fills cards without one
  • Bulk "Regenerate selected" overwrites existing summaries as expected
  • Cancel a bulk run mid-flight, then retry the remaining cards
  • Change search/filter after selecting cards, then run bulk generate — confirm it doesn't regenerate an existing summary
  • Trigger a provider failure and a failed "select all matching" — confirm user-visible errors
  • Check desktop and mobile layouts
  • Check light and dark themes
  • Export a summarized card and re-import it — summary is preserved
  • Restore an older card version — summary reflects the versioned value

Summary by CodeRabbit

  • New Features
    • Added editable character summaries with a 500-character limit.
    • Added AI-generated summary drafts in the character editor, with loading and error feedback.
    • Added bulk summary generation for character libraries, including missing-only or full regeneration, progress tracking, cancellation, retries, and failure reporting.
    • Character Library previews now display saved summaries when available.
  • Documentation
    • Updated character creation guidance and release notes to include summaries.

🔄 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/5555 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 8/26/2026 **Status:** ✅ Merged **Merged:** 8/26/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `staging` ← **Head:** `sparknotes-the-cast` --- ### 📝 Commits (7) - [`06e1fc8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/06e1fc8793cafadd6df747d638056187eeac6482) feat: add character card summaries - [`905fc01`](https://github.com/Pasta-Devs/Marinara-Engine/commit/905fc012e97f529965cc3cbb60107dc0e5bae319) fix: address CodeRabbit findings on character summary feature - [`85892d9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/85892d9dfc266c83a9d55437bf4389d395cf1c09) fix: use unsaved editor draft when generating a character summary - [`1a16f56`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1a16f5666d6746784994db14fcb1edff225dba02) fix: address remaining review findings on character summary feature - [`2f6a27e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2f6a27ecfa2b08aba17f1ddcdefee32ced4a0f70) fix: search the full character summary, not the truncated preview - [`09ecf96`](https://github.com/Pasta-Devs/Marinara-Engine/commit/09ecf968ada0dd98f36eb99b1e47b4d8db265520) fix: share summary generation and stop bulk clobbering new summaries - [`4510018`](https://github.com/Pasta-Devs/Marinara-Engine/commit/45100187f490350b02fcb17112202516f67e8fd9) fix: make bulk missing-only summary writes atomic ### 📊 Changes **14 files changed** (+478 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `packages/client/src/components/characters/CharacterEditor.tsx` (+79 -0) 📝 `packages/client/src/components/characters/CharacterLibraryView.tsx` (+227 -4) 📝 `packages/client/src/hooks/use-characters.ts` (+22 -0) 📝 `packages/client/src/localization/locales/en.json` (+18 -0) 📝 `packages/server/src/db/seed-mari.ts` (+3 -2) 📝 `packages/server/src/routes/characters.routes.ts` (+98 -2) 📝 `packages/server/src/services/chat-summary/connection-resolution.ts` (+6 -1) 📝 `packages/server/src/services/conversation/character-commands.ts` (+3 -0) 📝 `packages/server/src/services/generation/professor-mari-command-runtime.ts` (+2 -0) 📝 `packages/server/src/services/import/st-character.importer.ts` (+3 -0) 📝 `packages/server/src/services/mari-db/mari-db.service.ts` (+12 -5) 📝 `packages/shared/src/schemas/character.schema.ts` (+1 -0) 📝 `packages/shared/src/types/character.ts` (+2 -0) </details> ### 📄 Description Closes #5554 ## Why Character cards have no short, general-purpose synopsis field. The Character Library currently fakes one by concatenating `creator_notes`/`description`/`personality`, which is noisy, not user-editable, and duplicates model-facing prompt content in the UI. Users asked for a real summary datapoint per card to improve library previews, search, and sharing without adding prompt tokens. ## What changed - Added `data.summary` (string, max 500 chars) to the shared character schema/type. Stored in the existing serialized `characters.data` JSON — no new DB column. - Metadata-only: `summary` is never injected into the model prompt. - Character Editor: new Summary field before Description, with character count, helper text, and a single-card AI "Generate" button (draft only, never auto-saves, guarded against stale results if the user switches characters mid-generation). - New route `POST /api/characters/:id/summary/generate`, using the existing connection-resolution fallback chain (chat-summary connection → agent default → normal default). - Character Library: explicit summary shown in grid cards and detail panel (labeled section), used in search, existing fallback preserved for cards without one. - Character Library selection mode: bulk "Generate missing summaries" / "Regenerate selected", with confirmation, bounded concurrency (2 workers), progress, cancel, retry, and partial-failure handling. "Select all matching" works across pagination and respects active filters. - Professor Mari, `mari` CLI, and character command paths can read/write `summary` (all normalized to the 500-char limit at the write boundary). - Version comparison includes `summary`. - Import paths (SillyTavern importer, native V2) preserve/truncate `summary` to the schema limit. - Localized English UI strings added; CHANGELOG updated. ## Review history Two independent CodeRabbit-style reviews were run against this diff during development; all 10 findings raised (stale-generation races, missing default-connection fallback, unsafe bulk "missing-only" overwrite risk, stale bulk progress on selection-mode re-entry, unhandled select-all-matching errors, non-retryable cancellation, unbounded imported/CLI/Mari summary length, and a locale string ordering bug) were fixed and re-validated. ## Validation - `pnpm check` (TypeScript, ESLint, formatting, localization, server + client build) passes - `pnpm localization:check` passes - `pnpm regression:prompt` passes - No automated browser/UI test was run ## Manual test plan (unchecked — needs human verification) - [ ] Generate and save a summary on a character card - [ ] Switch characters while generation is in flight — confirm result doesn't leak onto the wrong card - [ ] Bulk "Generate missing summaries" only fills cards without one - [ ] Bulk "Regenerate selected" overwrites existing summaries as expected - [ ] Cancel a bulk run mid-flight, then retry the remaining cards - [ ] Change search/filter after selecting cards, then run bulk generate — confirm it doesn't regenerate an existing summary - [ ] Trigger a provider failure and a failed "select all matching" — confirm user-visible errors - [ ] Check desktop and mobile layouts - [ ] Check light and dark themes - [ ] Export a summarized card and re-import it — summary is preserved - [ ] Restore an older card version — summary reflects the versioned value <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added editable character summaries with a 500-character limit. * Added AI-generated summary drafts in the character editor, with loading and error feedback. * Added bulk summary generation for character libraries, including missing-only or full regeneration, progress tracking, cancellation, retries, and failure reporting. * Character Library previews now display saved summaries when available. * **Documentation** * Updated character creation guidance and release notes to include summaries. <!-- 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:13: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#6814
No description provided.