[PR #8444] [MERGED] fix: include inactive names in the characters macro #8605

Closed
opened 2026-11-07 16:45:55 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: staging ← Head: fix/full-roster-macro-8438


📝 Commits (3)

  • 1982434 docs: clarify full chat roster macro semantics
  • 124a219 fix: keep full names roster separate from active character cards
  • e3fd9ce fix: normalize agent rosters and preserve Game party macro scope

📊 Changes

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

View changed files

📝 docs/prompts/macros.md (+1 -1)
📝 packages/client/src/components/chat/ChatMessage.tsx (+4 -3)
📝 packages/client/src/components/chat/ConversationMessage.tsx (+3 -1)
📝 packages/client/src/lib/chat-macros.ts (+15 -1)
📝 packages/server/src/routes/generate.routes.ts (+4 -0)
📝 packages/server/src/routes/generate/retry-agents-route.ts (+4 -0)
📝 packages/server/src/services/advanced-memory.ts (+6 -2)
📝 packages/server/src/services/agents/agent-executor.ts (+9 -1)
📝 packages/server/src/services/prompt/macro-context.ts (+16 -1)
📝 packages/shared/src/types/agent.ts (+1 -1)
📝 packages/shared/src/utils/macro-engine.ts (+2 -2)
📝 scripts/regressions/advanced-memory-audience.regression.ts (+15 -0)
➕ scripts/regressions/full-roster-macro.regression.ts (+282 -0)
📝 scripts/regressions/image-appearance-game.regression.ts (+3 -1)

📄 Description

Linked issue

Closes #8438

Why this change

Disabling an off-scene character removed their name from scenario text such as The crew consists of {{characters}}, so the setting lost its full cast. The maintainer approved distinct full-roster and active-roster semantics in https://github.com/Pasta-Devs/Marinara-Engine/issues/8438#issuecomment-6491534520.

What changed

  • {{characters}} now includes inactive character names, so existing presets can no longer use it as an active-only roster. This follows the maintainer's decision. Use {{char}} with {{group}} when you need the current responder plus the other active characters.
  • Keep {{group}} limited to other active characters, including composer messages and rendered messages. Use the full names-only roster in prompt previews, generation, agent templates, and recalled summaries.
  • Keep card expansion, referenced-card discovery, decision readers, and summary knowledge separate from the full names roster. This macro adds names only; explicit card-ID macros retain their existing behavior. Renaming or removing a chat member updates the roster without editing prompt text.
  • Trim agent roster names and omit blank entries while preserving inactive members, fallback contexts, and escaping.
  • Preserve the caller's authoritative Game party scope, including legacy sessions whose party lives in metadata while the chat's character-ID column is empty.
  • Clarify the canonical macro guide; translations are tracked in #8443 and prepared in #8445.

Validation

Final repair head: e3fd9cea4c3cb961e31556f20e751fa5ec8a96bf.

  • pnpm install completed.
  • pnpm check passed, including production build and localization checks. It reported one existing, unrelated hook-dependency warning in HomeProfessorMariChat.tsx.
  • pnpm regression:prompt passed all three files.
  • node scripts/run-regressions.mjs --filter full-roster-macro passed. It covers full versus active names, inactive card/reference exclusions, previews and captured provider requests, composer/display macros, renaming/removal, agent blank/padded names, fallback/escaping, and one active reader with a larger names roster.
  • node scripts/run-regressions.mjs --filter image-appearance-game passed: five plain-text and eight macro preview/dispatch pairs, two historical storyboard planner cases, and the Character Tracker portrait path. The fixture includes both a legacy metadata-only party and a synchronized current session.
  • node scripts/run-regressions.mjs --filter decision --concurrency 2 passed 18/18 files. The focused roster guard also checks missing-profile and multi-profile conservative planning controls.
  • The new blank-name and legacy Game regression checks both failed on the reviewed 124a2194b runtime before their respective fixes, then passed on the final head.
  • coderabbit review --committed --base 124a2194b0236c372a0892bf20b81420e8200d27 --agent completed on the final head, reviewed all four repair files, and reported zero findings. The preceding full-PR local review covered all 13 files at 124a2194b with zero findings; the repair adds one existing Game regression file to the PR.

Earlier UI proof at parent 124a2194b remains explicitly separate: pnpm smoke:ui passed 7/7, the macro-filtered Node suite passed 12/12, and a temporary browser harness passed 12/12 cases across Roleplay/Conversation, dark/light, desktop Chromium, mobile Chromium, and mobile WebKit. The repair changes server macro handling and regression proof; client source and documentation are unchanged from that tested parent. Browser proof was not rerun for this repair.

Review trace: Game setup, recruit/remove, and checkpoint writes normally synchronize the chat's library IDs; the existing illustration reader also supports an authoritative metadata/setup party when a legacy row is empty. Activity, main-generation, and retry-agent base contexts all provide chatCharacters; pipeline, knowledge, historical, capability, and post-reply contexts preserve it by spreading their base context. The standalone builder's fallback remains covered.

Optional Dottore notes left unchanged: parseChatMetadata returns current normalized metadata objects directly, so memo extraction is not required to repair the demonstrated defects. The two small route roster projections remain explicit; extracting a shared abstraction would add scope without changing their behavior.

  • 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

  • Manually verify a group scenario override lists inactive members through {{characters}}, while {{group}} lists only other active members.
  • Manually review existing presets that depended on the previous active-only {{characters}} behavior.
  • Automated provider-boundary proof captured requests to local fixture providers. No external model provider was called.
  • Browser mobile coverage is emulation. No physical-device claim is made.
  • The local Docker daemon was unavailable (/Users/marysia/.orbstack/run/docker.sock missing). Hosted container checks are separate merge-gate evidence.

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
  • Version/release files updated (only if this PR includes a version bump)

Updated docs/prompts/macros.md; #8443 / #8445 cover translated guides. No version or changelog change. No documentation changes in the review repair.

UI evidence (if applicable)

No layout or styling changes. Parent-head browser screenshots were captured for all 12 focused cases; desktop Roleplay dark and mobile Conversation light screenshots were inspected for readable, correct roster text. Permanent executable proofs are scripts/regressions/full-roster-macro.regression.ts and scripts/regressions/image-appearance-game.regression.ts.

Combined integration validation

Latest isolated candidate 9f7e6771bae3be3e5bd26a9579c43976c991dc43 (tree 16723f5210f18e86de41df66b38fe6adc4ff2532) combines #8441 at 4d0c8d3c, #8444 at e3fd9cea, and merged #8442 at aaa9ab0e. All 29 changed file blobs match their owning heads exactly. pnpm check, the prompt suite, 12 macro regressions, the real Game image route fixture, 18 decision regressions, card-search/pagination and memory-audience regressions all passed. Focused desktop/mobile Chromium/WebKit cases passed 9/9; shell smokes passed 7/7. Browser emulation, local fixture-provider proof, hosted checks and physical-device testing remain distinct evidence.

Game scope audit: inactive flags do not apply to Game. The legacy dry-run path still derives IDs from the empty chat column and cannot select a named target; that blank-roster limitation is identical in the pre-change base. This PR restores party-aware Game callers without claiming a new legacy dry-run fallback.


🔄 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/8444 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/full-roster-macro-8438` --- ### 📝 Commits (3) - [`1982434`](https://github.com/Pasta-Devs/Marinara-Engine/commit/19824347bf98dd34c647188494570bf9e2652501) docs: clarify full chat roster macro semantics - [`124a219`](https://github.com/Pasta-Devs/Marinara-Engine/commit/124a2194b0236c372a0892bf20b81420e8200d27) fix: keep full names roster separate from active character cards - [`e3fd9ce`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e3fd9cea4c3cb961e31556f20e751fa5ec8a96bf) fix: normalize agent rosters and preserve Game party macro scope ### 📊 Changes **14 files changed** (+365 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `docs/prompts/macros.md` (+1 -1) 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+4 -3) 📝 `packages/client/src/components/chat/ConversationMessage.tsx` (+3 -1) 📝 `packages/client/src/lib/chat-macros.ts` (+15 -1) 📝 `packages/server/src/routes/generate.routes.ts` (+4 -0) 📝 `packages/server/src/routes/generate/retry-agents-route.ts` (+4 -0) 📝 `packages/server/src/services/advanced-memory.ts` (+6 -2) 📝 `packages/server/src/services/agents/agent-executor.ts` (+9 -1) 📝 `packages/server/src/services/prompt/macro-context.ts` (+16 -1) 📝 `packages/shared/src/types/agent.ts` (+1 -1) 📝 `packages/shared/src/utils/macro-engine.ts` (+2 -2) 📝 `scripts/regressions/advanced-memory-audience.regression.ts` (+15 -0) ➕ `scripts/regressions/full-roster-macro.regression.ts` (+282 -0) 📝 `scripts/regressions/image-appearance-game.regression.ts` (+3 -1) </details> ### 📄 Description ## Linked issue Closes #8438 ## Why this change Disabling an off-scene character removed their name from scenario text such as `The crew consists of {{characters}}`, so the setting lost its full cast. The maintainer approved distinct full-roster and active-roster semantics in https://github.com/Pasta-Devs/Marinara-Engine/issues/8438#issuecomment-6491534520. ## What changed - `{{characters}}` now includes inactive character names, so existing presets can no longer use it as an active-only roster. This follows the maintainer's decision. Use `{{char}}` with `{{group}}` when you need the current responder plus the other active characters. - Keep `{{group}}` limited to other active characters, including composer messages and rendered messages. Use the full names-only roster in prompt previews, generation, agent templates, and recalled summaries. - Keep card expansion, referenced-card discovery, decision readers, and summary knowledge separate from the full names roster. This macro adds names only; explicit card-ID macros retain their existing behavior. Renaming or removing a chat member updates the roster without editing prompt text. - Trim agent roster names and omit blank entries while preserving inactive members, fallback contexts, and escaping. - Preserve the caller's authoritative Game party scope, including legacy sessions whose party lives in metadata while the chat's character-ID column is empty. - Clarify the canonical macro guide; translations are tracked in #8443 and prepared in #8445. ## Validation Final repair head: `e3fd9cea4c3cb961e31556f20e751fa5ec8a96bf`. - `pnpm install` completed. - `pnpm check` passed, including production build and localization checks. It reported one existing, unrelated hook-dependency warning in `HomeProfessorMariChat.tsx`. - `pnpm regression:prompt` passed all three files. - `node scripts/run-regressions.mjs --filter full-roster-macro` passed. It covers full versus active names, inactive card/reference exclusions, previews and captured provider requests, composer/display macros, renaming/removal, agent blank/padded names, fallback/escaping, and one active reader with a larger names roster. - `node scripts/run-regressions.mjs --filter image-appearance-game` passed: five plain-text and eight macro preview/dispatch pairs, two historical storyboard planner cases, and the Character Tracker portrait path. The fixture includes both a legacy metadata-only party and a synchronized current session. - `node scripts/run-regressions.mjs --filter decision --concurrency 2` passed 18/18 files. The focused roster guard also checks missing-profile and multi-profile conservative planning controls. - The new blank-name and legacy Game regression checks both failed on the reviewed `124a2194b` runtime before their respective fixes, then passed on the final head. - `coderabbit review --committed --base 124a2194b0236c372a0892bf20b81420e8200d27 --agent` completed on the final head, reviewed all four repair files, and reported zero findings. The preceding full-PR local review covered all 13 files at `124a2194b` with zero findings; the repair adds one existing Game regression file to the PR. Earlier UI proof at parent `124a2194b` remains explicitly separate: `pnpm smoke:ui` passed 7/7, the macro-filtered Node suite passed 12/12, and a temporary browser harness passed 12/12 cases across Roleplay/Conversation, dark/light, desktop Chromium, mobile Chromium, and mobile WebKit. The repair changes server macro handling and regression proof; client source and documentation are unchanged from that tested parent. Browser proof was not rerun for this repair. Review trace: Game setup, recruit/remove, and checkpoint writes normally synchronize the chat's library IDs; the existing illustration reader also supports an authoritative metadata/setup party when a legacy row is empty. Activity, main-generation, and retry-agent base contexts all provide `chatCharacters`; pipeline, knowledge, historical, capability, and post-reply contexts preserve it by spreading their base context. The standalone builder's fallback remains covered. Optional Dottore notes left unchanged: `parseChatMetadata` returns current normalized metadata objects directly, so memo extraction is not required to repair the demonstrated defects. The two small route roster projections remain explicit; extracting a shared abstraction would add scope without changing their behavior. - [ ] `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 - Manually verify a group scenario override lists inactive members through `{{characters}}`, while `{{group}}` lists only other active members. - Manually review existing presets that depended on the previous active-only `{{characters}}` behavior. - Automated provider-boundary proof captured requests to local fixture providers. No external model provider was called. - Browser mobile coverage is emulation. No physical-device claim is made. - The local Docker daemon was unavailable (`/Users/marysia/.orbstack/run/docker.sock` missing). Hosted container checks are separate merge-gate evidence. ## 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 - [ ] Version/release files updated (only if this PR includes a version bump) Updated `docs/prompts/macros.md`; #8443 / #8445 cover translated guides. No version or changelog change. No documentation changes in the review repair. ## UI evidence (if applicable) No layout or styling changes. Parent-head browser screenshots were captured for all 12 focused cases; desktop Roleplay dark and mobile Conversation light screenshots were inspected for readable, correct roster text. Permanent executable proofs are `scripts/regressions/full-roster-macro.regression.ts` and `scripts/regressions/image-appearance-game.regression.ts`. ## Combined integration validation Latest isolated candidate `9f7e6771bae3be3e5bd26a9579c43976c991dc43` (tree `16723f5210f18e86de41df66b38fe6adc4ff2532`) combines #8441 at `4d0c8d3c`, #8444 at `e3fd9cea`, and merged #8442 at `aaa9ab0e`. All 29 changed file blobs match their owning heads exactly. `pnpm check`, the prompt suite, 12 macro regressions, the real Game image route fixture, 18 decision regressions, card-search/pagination and memory-audience regressions all passed. Focused desktop/mobile Chromium/WebKit cases passed 9/9; shell smokes passed 7/7. Browser emulation, local fixture-provider proof, hosted checks and physical-device testing remain distinct evidence. Game scope audit: inactive flags do not apply to Game. The legacy dry-run path still derives IDs from the empty chat column and cannot select a named target; that blank-roster limitation is identical in the pre-change base. This PR restores party-aware Game callers without claiming a new legacy dry-run fallback. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:45:55 +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#8605
No description provided.