[PR #3607] [MERGED] Fix recurring tracker character continuity #6014

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

📋 Pull Request Information

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

Base: staging ← Head: fix/3606-recurring-character-continuity


📝 Commits (3)

  • 093f8e8 Restore recurring tracker character continuity
  • db753b3 Harden tracker continuity history
  • 5fa7141 Tighten RPG attribute validation

📊 Changes

10 files changed (+271 additions, -13 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 docs/agents/built-in-agents.md (+2 -0)
📝 packages/server/src/routes/generate.routes.ts (+11 -0)
📝 packages/server/src/routes/generate/generate-route-utils.ts (+76 -12)
📝 packages/server/src/routes/generate/retry-agents-route.ts (+17 -0)
📝 packages/server/src/services/agents/agent-executor.ts (+22 -0)
📝 packages/server/src/services/generation/character-prompt-context.ts (+32 -0)
📝 packages/server/src/services/storage/game-state.storage.ts (+18 -1)
📝 packages/shared/src/types/agent.ts (+5 -0)
📝 scripts/regressions/prompt.regression.ts (+87 -0)

📄 Description

Why

Issue #3606 reports that recurring Character Tracker characters lose prior tracker data and can receive the wrong avatar after leaving and returning to a scene. Character-card RPG configuration was also absent from the tracker prompt, and retry generation did not share the normal route's identity handling.

What changed

  • Provide the tracker with bounded, newest-first character history so returning characters can recover omitted stats and custom fields.
  • Keep freshly generated values authoritative while filling only missing named stats from history.
  • Include character-card RPG pools and attributes in tracker context.
  • Resolve card identity by stable ID first, then by an unambiguous normalized name, and enforce the card avatar/crop over NPC fallbacks.
  • Apply the same continuity and identity rules to agent retries, bounded to the retry snapshot.
  • Document the behavior and update the v2.2.2 changelog.

Closes #3606

Validation

  • Manually verify a character leaves a scene, returns later, and retains omitted tracker fields.
  • Manually verify fresh tracker stat values override older history values.
  • Manually verify character-card avatars remain authoritative in normal generation and retry.
  • Manually verify card RPG pools and attributes appear in tracker behavior.
  • Run pnpm regression:prompt.
  • Run pnpm check.

Automated validation run locally: pnpm regression:prompt, pnpm check, focused server/shared lint.

Summary by CodeRabbit

  • Bug Fixes

    • Recurring roleplay characters now consistently retain tracker stats and custom fields, and keep their character-card avatar after multiple scenes and across retry updates.
    • Character-card identity and artwork now match reliably, and RPG settings/attributes are preserved.
    • Auto-generated portraits are still restricted to NPCs without a matching character card.
  • Documentation

    • Expanded Character Tracker guidance to clarify recurring continuity, RPG settings, and avatar behavior.
  • Tests

    • Added regression coverage for recurring history handling and RPG configuration in the Character Tracker prompt.

🔄 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/3607 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 7/14/2026 **Status:** ✅ Merged **Merged:** 7/14/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/3606-recurring-character-continuity` --- ### 📝 Commits (3) - [`093f8e8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/093f8e86802910372ddcc33f8b903edf01b6e4a7) Restore recurring tracker character continuity - [`db753b3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/db753b3a728aead4b06aa8ad1ea86f57e3484769) Harden tracker continuity history - [`5fa7141`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5fa7141d708f6674944025d8f9b7c50494fefc94) Tighten RPG attribute validation ### 📊 Changes **10 files changed** (+271 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `docs/agents/built-in-agents.md` (+2 -0) 📝 `packages/server/src/routes/generate.routes.ts` (+11 -0) 📝 `packages/server/src/routes/generate/generate-route-utils.ts` (+76 -12) 📝 `packages/server/src/routes/generate/retry-agents-route.ts` (+17 -0) 📝 `packages/server/src/services/agents/agent-executor.ts` (+22 -0) 📝 `packages/server/src/services/generation/character-prompt-context.ts` (+32 -0) 📝 `packages/server/src/services/storage/game-state.storage.ts` (+18 -1) 📝 `packages/shared/src/types/agent.ts` (+5 -0) 📝 `scripts/regressions/prompt.regression.ts` (+87 -0) </details> ### 📄 Description ## Why Issue #3606 reports that recurring Character Tracker characters lose prior tracker data and can receive the wrong avatar after leaving and returning to a scene. Character-card RPG configuration was also absent from the tracker prompt, and retry generation did not share the normal route's identity handling. ## What changed - Provide the tracker with bounded, newest-first character history so returning characters can recover omitted stats and custom fields. - Keep freshly generated values authoritative while filling only missing named stats from history. - Include character-card RPG pools and attributes in tracker context. - Resolve card identity by stable ID first, then by an unambiguous normalized name, and enforce the card avatar/crop over NPC fallbacks. - Apply the same continuity and identity rules to agent retries, bounded to the retry snapshot. - Document the behavior and update the v2.2.2 changelog. Closes #3606 ## Validation - [ ] Manually verify a character leaves a scene, returns later, and retains omitted tracker fields. - [ ] Manually verify fresh tracker stat values override older history values. - [ ] Manually verify character-card avatars remain authoritative in normal generation and retry. - [ ] Manually verify card RPG pools and attributes appear in tracker behavior. - [ ] Run `pnpm regression:prompt`. - [ ] Run `pnpm check`. Automated validation run locally: `pnpm regression:prompt`, `pnpm check`, focused server/shared lint. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Recurring roleplay characters now consistently retain tracker stats and custom fields, and keep their character-card avatar after multiple scenes and across retry updates. * Character-card identity and artwork now match reliably, and RPG settings/attributes are preserved. * Auto-generated portraits are still restricted to NPCs without a matching character card. * **Documentation** * Expanded Character Tracker guidance to clarify recurring continuity, RPG settings, and avatar behavior. * **Tests** * Added regression coverage for recurring history handling and RPG configuration in the Character Tracker prompt. <!-- 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:06:13 +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#6014
No description provided.