[PR #467] [MERGED] feat(impersonate): add configurable impersonation controls #4632

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/467
Author: @Xelvanis
Created: 5/6/2026
Status: ✅ Merged
Merged: 5/6/2026
Merged by: @SpicyMarinara

Base: main ← Head: feat/impersonate-suite


📝 Commits (1)

  • 47441a3 feat(impersonate): add configurable impersonation controls

📊 Changes

20 files changed (+842 additions, -41 deletions)

View changed files

📝 docs/CONVERSATION.md (+14 -0)
📝 docs/ROLEPLAY.md (+14 -0)
📝 packages/client/src/components/chat/ChatInput.tsx (+65 -1)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+165 -0)
📝 packages/client/src/components/chat/ConversationInput.tsx (+55 -1)
📝 packages/client/src/components/chat/ConversationView.tsx (+10 -0)
📝 packages/client/src/hooks/use-generate.ts (+4 -0)
📝 packages/client/src/lib/slash-commands.ts (+11 -0)
📝 packages/client/src/stores/ui.store.ts (+48 -1)
📝 packages/server/package.json (+1 -1)
📝 packages/server/src/routes/chats.routes.ts (+172 -2)
📝 packages/server/src/routes/generate.routes.ts (+79 -15)
📝 packages/server/src/routes/generate/dry-run-route.ts (+22 -5)
📝 packages/server/src/routes/generate/generate-route-utils.ts (+14 -0)
📝 packages/server/src/services/conversation/impersonate-prompt.ts (+45 -15)
➕ packages/server/test/generate-route-utils.test.ts (+85 -0)
📝 packages/server/test/impersonate-prompt.test.ts (+12 -0)
➕ packages/shared/src/constants/impersonate.ts (+19 -0)
📝 packages/shared/src/index.ts (+1 -0)
📝 packages/shared/src/schemas/chat.schema.ts (+6 -0)

📄 Description

Linked issue

Closes #

Why this change

  • Adds a configurable impersonation workflow so users can more easily generate persona-side messages without manually switching context or rewriting prompts each time.
  • Makes the Impersonate settings drawer more compact and easier to scan, especially around preset, connection, quick button, and agent pipeline options.

What changed

  • Added shared impersonation defaults and configuration plumbing.
  • Added /impersonate and impersonation prompt handling.
  • Added configurable Impersonate settings for prompt template, preset, connection, quick button visibility, and agent pipeline behavior.
  • Polished the Impersonate settings drawer layout for better alignment and compactness.
  • Added/updated docs for the impersonation workflow in conversation and roleplay docs.

Validation

  • 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

  • pnpm check passed locally.
  • pnpm build passed while preparing the AppData test install.
  • Manual browser/app verification:
    • Open the Impersonate settings drawer.
    • Confirm preset and connection selectors display correctly.
    • Toggle Quick button and Agent pipeline settings.
    • Confirm /impersonate works with the selected settings.
    • Confirm /impersonate_prompt updates/resets the prompt template as expected.
    • Check the drawer layout at normal and narrow widths.

Docs and release impact

  • No docs changes needed

  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed

  • Version/release files updated (only if this PR includes a version bump)

  • Updated docs:

    • docs/CONVERSATION.md
    • docs/ROLEPLAY.md
  • No version or release files were changed.

  • No README, CONTRIBUTING, Android, or CHANGELOG changes appeared necessary for this feature.

UI evidence (if applicable)

Screenshot 2026-05-07 000529

Quick button

image

Summary by CodeRabbit

  • New Features

    • Impersonation: generate as your persona via /impersonate and a new quick-action button
    • Impersonate settings: customizable prompt template, presets, connection, quick button, and per-chat prompt tuning
    • Hide messages: support for messages hidden from user view
  • Documentation

    • Added impersonation guides to Conversation Mode and Roleplay docs
  • Tests

    • Added tests for impersonation prompt rendering and agent-enablement logic

🔄 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/467 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 5/6/2026 **Status:** ✅ Merged **Merged:** 5/6/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `main` ← **Head:** `feat/impersonate-suite` --- ### 📝 Commits (1) - [`47441a3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/47441a336030697d5366ad786d7856ad6c5e2768) feat(impersonate): add configurable impersonation controls ### 📊 Changes **20 files changed** (+842 additions, -41 deletions) <details> <summary>View changed files</summary> 📝 `docs/CONVERSATION.md` (+14 -0) 📝 `docs/ROLEPLAY.md` (+14 -0) 📝 `packages/client/src/components/chat/ChatInput.tsx` (+65 -1) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+165 -0) 📝 `packages/client/src/components/chat/ConversationInput.tsx` (+55 -1) 📝 `packages/client/src/components/chat/ConversationView.tsx` (+10 -0) 📝 `packages/client/src/hooks/use-generate.ts` (+4 -0) 📝 `packages/client/src/lib/slash-commands.ts` (+11 -0) 📝 `packages/client/src/stores/ui.store.ts` (+48 -1) 📝 `packages/server/package.json` (+1 -1) 📝 `packages/server/src/routes/chats.routes.ts` (+172 -2) 📝 `packages/server/src/routes/generate.routes.ts` (+79 -15) 📝 `packages/server/src/routes/generate/dry-run-route.ts` (+22 -5) 📝 `packages/server/src/routes/generate/generate-route-utils.ts` (+14 -0) 📝 `packages/server/src/services/conversation/impersonate-prompt.ts` (+45 -15) ➕ `packages/server/test/generate-route-utils.test.ts` (+85 -0) 📝 `packages/server/test/impersonate-prompt.test.ts` (+12 -0) ➕ `packages/shared/src/constants/impersonate.ts` (+19 -0) 📝 `packages/shared/src/index.ts` (+1 -0) 📝 `packages/shared/src/schemas/chat.schema.ts` (+6 -0) </details> ### 📄 Description ## Linked issue <!-- Every PR should reference a feature request or issue report. If there isn't one yet, open one first to gather opinions: --> <!-- https://github.com/Pasta-Devs/Marinara-Engine/issues/new/choose --> Closes # ## Why this change <!-- What user problem, bug, or goal does this solve? --> - Adds a configurable impersonation workflow so users can more easily generate persona-side messages without manually switching context or rewriting prompts each time. - Makes the Impersonate settings drawer more compact and easier to scan, especially around preset, connection, quick button, and agent pipeline options. ## What changed <!-- List the key changes in this PR --> - Added shared impersonation defaults and configuration plumbing. - Added `/impersonate` and impersonation prompt handling. - Added configurable Impersonate settings for prompt template, preset, connection, quick button visibility, and agent pipeline behavior. - Polished the Impersonate settings drawer layout for better alignment and compactness. - Added/updated docs for the impersonation workflow in conversation and roleplay docs. ## Validation <!-- Required: include commands run and/or manual checks performed --> - [X] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [X] Ran the app, clicked through the changes manually - [X] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [X] Above manual verification completed (describe below) - [X] Read and followed `CONTRIBUTING.md` ### Manual verification notes <!-- Describe exactly what you tested in a real browser/app, step by step. --> <!-- ⚠️ If an AI agent filled out or ticked these boxes for you, treat them --> <!-- as a TO-DO LIST, not as proof the work is done. Verify each item yourself --> <!-- before submitting. If you haven't verified it, untick the box. --> - [X] `pnpm check` passed locally. - [X] `pnpm build` passed while preparing the AppData test install. - Manual browser/app verification: - [X] Open the Impersonate settings drawer. - [X] Confirm preset and connection selectors display correctly. - [X] Toggle Quick button and Agent pipeline settings. - [X] Confirm `/impersonate` works with the selected settings. - [X] Confirm `/impersonate_prompt` updates/resets the prompt template as expected. - [X] Check the drawer layout at normal and narrow widths. ## Docs and release impact - [ ] No docs changes needed - [X] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) - Updated docs: - `docs/CONVERSATION.md` - `docs/ROLEPLAY.md` - No version or release files were changed. - No README, CONTRIBUTING, Android, or CHANGELOG changes appeared necessary for this feature. ## UI evidence (if applicable) <img width="337" height="537" alt="Screenshot 2026-05-07 000529" src="https://github.com/user-attachments/assets/1c30c1c3-fa92-41e6-bbcd-36cce2665c15" /> Quick button <img width="196" height="73" alt="image" src="https://github.com/user-attachments/assets/a20667ff-ab93-4c03-9e9b-25219d623237" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Impersonation: generate as your persona via /impersonate and a new quick-action button * Impersonate settings: customizable prompt template, presets, connection, quick button, and per-chat prompt tuning * Hide messages: support for messages hidden from user view * **Documentation** * Added impersonation guides to Conversation Mode and Roleplay docs * **Tests** * Added tests for impersonation prompt rendering and agent-enablement logic <!-- 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-22 04:09:20 +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#4632
No description provided.