[PR #4908] [MERGED] Address assigned Roleplay and tool-choice issues #6537

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4908
Author: @SpicyMarinara
Created: 8/11/2026
Status: ✅ Merged
Merged: 8/11/2026
Merged by: @SpicyMarinara

Base: staging ← Head: agent/assigned-issues-aug11-round2


📝 Commits (4)

📊 Changes

22 files changed (+959 additions, -256 deletions)

View changed files

📝 CHANGELOG.md (+3 -0)
📝 packages/client/src/components/chat/ChatArea.tsx (+4 -10)
📝 packages/client/src/components/chat/ChatMessage.tsx (+403 -97)
📝 packages/client/src/components/chat/ChatRoleplaySurface.tsx (+7 -2)
📝 packages/client/src/lib/slash-commands.ts (+101 -19)
📝 packages/client/src/localization/locales/en.json (+12 -0)
📝 packages/server/src/routes/chats.routes.ts (+30 -11)
📝 packages/server/src/routes/generate.routes.ts (+7 -1)
📝 packages/server/src/routes/generate/dry-run-route.ts (+8 -5)
📝 packages/server/src/routes/generate/generate-route-utils.ts (+28 -9)
📝 packages/server/src/services/generation/prompt-message-scope.ts (+18 -3)
📝 packages/server/src/services/llm/providers/anthropic.provider.ts (+41 -0)
📝 packages/server/src/services/llm/providers/google.provider.ts (+22 -1)
📝 packages/server/src/services/prompt/assembler.ts (+4 -13)
📝 packages/server/src/services/prompt/merger.ts (+6 -3)
📝 packages/server/src/services/storage/chats.storage.ts (+7 -10)
📝 packages/shared/src/types/chat.ts (+2 -0)
📝 packages/shared/src/types/prompt.ts (+2 -0)
📝 scripts/regressions/open-issues.regression.ts (+82 -16)
📝 scripts/regressions/prompt.regression.ts (+46 -11)

...and 2 more files

📄 Description

Linked issue

Closes #4905
Closes #4906
Closes #4907

Why this change

  • A character introduced midway through a group Roleplay should not inherit transcript context from before their entrance, while the existing cast may retain the complete story.
  • Authors need a concise way to hide message ranges from one Roleplay character without changing visibility for everyone else.
  • The Engine's Force To Call Tool choice must reach Google, Vertex, and Anthropic instead of silently becoming automatic tool selection.

What changed

  • Added shared and per-character New Start markers that can coexist on a Roleplay message, use the existing character-avatar picker vocabulary, persist across swipes, and trim history only for the matching generation audience.
  • Extended /hide to accept /hide <character> <message/range> (including quoted multi-word names) while preserving the existing global /hide <message/range> form.
  • Mapped forced first-round tool selection to Google/Vertex ANY and Anthropic any, with compatibility fallbacks for manual extended thinking and Mythos models.
  • Added localized UI/command copy, changelog entries, and focused regressions for each behavior.

Validation

Automated validation completed locally:

  • pnpm check
  • pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/prompt.regression.ts
  • pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/provider-compat.regression.ts
  • pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/regeneration-context.regression.ts
  • pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/open-issues.regression.ts
  • Targeted Playwright Function Calling flow on desktop Chromium (mobile variant is intentionally skipped by the suite)
  • CodeRabbit review completed with all actionable threads resolved

The full UI smoke suite was also sampled. Its relevant Function Calling flow passed; unrelated pre-existing What's New and Characters Library timeouts prevented a clean complete run.

  • 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 global and per-character New Start markers can coexist in a group Roleplay and only alter the intended character's context.
  • Manually verify the avatar picker and marker labels in desktop and mobile Roleplay layouts, including keyboard navigation and gradient character-name colors.
  • Manually verify targeted /hide with exact, partial, quoted, unknown, and ambiguous character names.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] <paths> follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

  • Browser-plugin visual capture was unavailable locally because its JavaScript bootstrap failed. The PR therefore leaves the Roleplay desktop/mobile visual checks explicitly for manual verification.

🔄 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/4908 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 8/11/2026 **Status:** ✅ Merged **Merged:** 8/11/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `agent/assigned-issues-aug11-round2` --- ### 📝 Commits (4) - [`2956e48`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2956e48cbd36f37ed24be1bbf0b5decd868a7d4c) Start assigned issue sweep (#4905 #4906 #4907) - [`6ac7b85`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6ac7b852ddcb4f59e78143d4b4a308588f1b9491) Add per-character Roleplay context controls - [`28b03c8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/28b03c8fe2cb8003f101d77e84d5feda1a0525fb) Apply CodeRabbit review fixes - [`9858fb9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9858fb901d2193fe3b02ecb57accbe662fb631c8) Cover shared swipe context marker ### 📊 Changes **22 files changed** (+959 additions, -256 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+3 -0) 📝 `packages/client/src/components/chat/ChatArea.tsx` (+4 -10) 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+403 -97) 📝 `packages/client/src/components/chat/ChatRoleplaySurface.tsx` (+7 -2) 📝 `packages/client/src/lib/slash-commands.ts` (+101 -19) 📝 `packages/client/src/localization/locales/en.json` (+12 -0) 📝 `packages/server/src/routes/chats.routes.ts` (+30 -11) 📝 `packages/server/src/routes/generate.routes.ts` (+7 -1) 📝 `packages/server/src/routes/generate/dry-run-route.ts` (+8 -5) 📝 `packages/server/src/routes/generate/generate-route-utils.ts` (+28 -9) 📝 `packages/server/src/services/generation/prompt-message-scope.ts` (+18 -3) 📝 `packages/server/src/services/llm/providers/anthropic.provider.ts` (+41 -0) 📝 `packages/server/src/services/llm/providers/google.provider.ts` (+22 -1) 📝 `packages/server/src/services/prompt/assembler.ts` (+4 -13) 📝 `packages/server/src/services/prompt/merger.ts` (+6 -3) 📝 `packages/server/src/services/storage/chats.storage.ts` (+7 -10) 📝 `packages/shared/src/types/chat.ts` (+2 -0) 📝 `packages/shared/src/types/prompt.ts` (+2 -0) 📝 `scripts/regressions/open-issues.regression.ts` (+82 -16) 📝 `scripts/regressions/prompt.regression.ts` (+46 -11) _...and 2 more files_ </details> ### 📄 Description ## Linked issue Closes #4905 Closes #4906 Closes #4907 ## Why this change - A character introduced midway through a group Roleplay should not inherit transcript context from before their entrance, while the existing cast may retain the complete story. - Authors need a concise way to hide message ranges from one Roleplay character without changing visibility for everyone else. - The Engine's **Force To Call Tool** choice must reach Google, Vertex, and Anthropic instead of silently becoming automatic tool selection. ## What changed - Added shared and per-character **New Start** markers that can coexist on a Roleplay message, use the existing character-avatar picker vocabulary, persist across swipes, and trim history only for the matching generation audience. - Extended `/hide` to accept `/hide <character> <message/range>` (including quoted multi-word names) while preserving the existing global `/hide <message/range>` form. - Mapped forced first-round tool selection to Google/Vertex `ANY` and Anthropic `any`, with compatibility fallbacks for manual extended thinking and Mythos models. - Added localized UI/command copy, changelog entries, and focused regressions for each behavior. ## Validation Automated validation completed locally: - `pnpm check` - `pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/prompt.regression.ts` - `pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/provider-compat.regression.ts` - `pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/regeneration-context.regression.ts` - `pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/open-issues.regression.ts` - Targeted Playwright Function Calling flow on desktop Chromium (mobile variant is intentionally skipped by the suite) - CodeRabbit review completed with all actionable threads resolved The full UI smoke suite was also sampled. Its relevant Function Calling flow passed; unrelated pre-existing What's New and Characters Library timeouts prevented a clean complete run. - [ ] `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 global and per-character New Start markers can coexist in a group Roleplay and only alter the intended character's context. - Manually verify the avatar picker and marker labels in desktop and mobile Roleplay layouts, including keyboard navigation and gradient character-name colors. - Manually verify targeted `/hide` with exact, partial, quoted, unknown, and ambiguous character names. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n] <paths>` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) - Browser-plugin visual capture was unavailable locally because its JavaScript bootstrap failed. The PR therefore leaves the Roleplay desktop/mobile visual checks explicitly for manual verification. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:11:22 +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#6537
No description provided.