[PR #3905] [MERGED] Fix Individual Conversation prompt scoping #6152

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

📋 Pull Request Information

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

Base: staging ← Head: agent/3887-individual-conversation-prompt-scope


📝 Commits (2)

  • c467c8b Scope individual Conversation prompts to responder
  • 5a92a82 Merge branch 'staging' into agent/3887-individual-conversation-prompt-scope

📊 Changes

4 files changed (+189 additions, -35 deletions)

View changed files

📝 packages/server/src/routes/generate.routes.ts (+67 -19)
📝 packages/server/src/routes/generate/conversation-context-block.ts (+40 -6)
📝 packages/server/src/routes/generate/conversation-prompt-formatting.ts (+4 -9)
📝 scripts/regressions/prompt.regression.ts (+78 -1)

📄 Description

Closes #3887

Why

Individual Conversation group generations were receiving a mixture of Grouped-mode and target-character instructions. Character identity could resolve to the full group before the responder was selected, the status block described every character as "your" status, and Output Format contained both group-wide and single-character rules.

What changed

  • defer Conversation identity macros until the actual Individual responder is selected, including Manual mode mentions
  • keep a short This is a group DM with other participants. context line in Individual mode without the multi-speaker/prefix rules
  • scope Your current status to the responder and list other participants' statuses separately
  • emit only Respond only as <character>. in Individual Output Format
  • preserve the established Grouped prompt contract while removing its extra blank separator
  • avoid falling back to Grouped Output Format when the Individual turn-prompt option is disabled
  • add positive and negative prompt regressions for identity, status, output rules, and context replacement

Root cause

The Conversation system prompt and current-context block were assembled before the per-character generation target was known. The final provider-bound macro pass could scope unresolved character macros, but the prompt had already replaced {{charName}} with the group list and the shared status block had no target-specific variant. The Output Format helper also appended Individual guidance on top of the Grouped contract instead of choosing one contract.

Validation

  • pnpm regression:prompt
  • pnpm check

Manual verification

  • Manually verify a Sequential Individual Conversation group turn sends only the selected character identity/status/output contract.
  • Manually verify a Smart or @mentioned Manual Individual turn scopes the prompt to the selected responder.
  • Manually verify Grouped Conversation mode retains its prior multi-speaker behavior with single-newline instruction spacing.

Summary by CodeRabbit

  • New Features

    • Improved conversation-mode group chats when generating individual responses for each character.
    • Each character now receives relevant, personalized conversation context and status information.
    • Primary and participating characters are identified more clearly in current-status details.
  • Bug Fixes

    • Prevented duplicated or unnecessary formatting instructions in individual character responses.
    • Improved character-name resolution and response instructions across different output formats.
    • Ensured manual response ordering works correctly in conversation mode.

🔄 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/3905 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 7/21/2026 **Status:** ✅ Merged **Merged:** 7/21/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `agent/3887-individual-conversation-prompt-scope` --- ### 📝 Commits (2) - [`c467c8b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c467c8bd41b2d92ed97dc4338d67910348e82208) Scope individual Conversation prompts to responder - [`5a92a82`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5a92a8238dc35d3d7607c35abbb96c582ac2fdc0) Merge branch 'staging' into agent/3887-individual-conversation-prompt-scope ### 📊 Changes **4 files changed** (+189 additions, -35 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/routes/generate.routes.ts` (+67 -19) 📝 `packages/server/src/routes/generate/conversation-context-block.ts` (+40 -6) 📝 `packages/server/src/routes/generate/conversation-prompt-formatting.ts` (+4 -9) 📝 `scripts/regressions/prompt.regression.ts` (+78 -1) </details> ### 📄 Description Closes #3887 ## Why Individual Conversation group generations were receiving a mixture of Grouped-mode and target-character instructions. Character identity could resolve to the full group before the responder was selected, the status block described every character as "your" status, and Output Format contained both group-wide and single-character rules. ## What changed - defer Conversation identity macros until the actual Individual responder is selected, including Manual mode mentions - keep a short `This is a group DM with other participants.` context line in Individual mode without the multi-speaker/prefix rules - scope `Your current status` to the responder and list other participants' statuses separately - emit only `Respond only as <character>.` in Individual Output Format - preserve the established Grouped prompt contract while removing its extra blank separator - avoid falling back to Grouped Output Format when the Individual turn-prompt option is disabled - add positive and negative prompt regressions for identity, status, output rules, and context replacement ## Root cause The Conversation system prompt and current-context block were assembled before the per-character generation target was known. The final provider-bound macro pass could scope unresolved character macros, but the prompt had already replaced `{{charName}}` with the group list and the shared status block had no target-specific variant. The Output Format helper also appended Individual guidance on top of the Grouped contract instead of choosing one contract. ## Validation - `pnpm regression:prompt` - `pnpm check` ## Manual verification - [ ] Manually verify a Sequential Individual Conversation group turn sends only the selected character identity/status/output contract. - [ ] Manually verify a Smart or @mentioned Manual Individual turn scopes the prompt to the selected responder. - [ ] Manually verify Grouped Conversation mode retains its prior multi-speaker behavior with single-newline instruction spacing. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Improved conversation-mode group chats when generating individual responses for each character. - Each character now receives relevant, personalized conversation context and status information. - Primary and participating characters are identified more clearly in current-status details. - **Bug Fixes** - Prevented duplicated or unnecessary formatting instructions in individual character responses. - Improved character-name resolution and response instructions across different output formats. - Ensured manual response ordering works correctly in conversation mode. <!-- 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:07:35 +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#6152
No description provided.