[PR #727] [MERGED] Add connection prompt preset overrides #4749

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

📋 Pull Request Information

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

Base: main ← Head: feat/connection-preset-override


📝 Commits (2)

  • 78f8126 feat: add connection prompt preset overrides
  • 6ee630e fix: reuse dry-run prompt preset lookup

📊 Changes

11 files changed (+410 additions, -140 deletions)

View changed files

📝 packages/client/src/components/connections/ConnectionEditor.tsx (+36 -0)
📝 packages/server/src/db/migrate.ts (+6 -0)
📝 packages/server/src/db/schema/connections.ts (+2 -0)
📝 packages/server/src/routes/generate.routes.ts (+47 -30)
📝 packages/server/src/routes/generate/dry-run-route.ts (+124 -110)
➕ packages/server/src/routes/generate/prompt-preset-selection.ts (+63 -0)
📝 packages/server/src/services/storage/connections.storage.ts (+5 -0)
➕ packages/server/test/connection-prompt-preset-selection.test.ts (+78 -0)
📝 packages/server/test/db-migrations.test.ts (+46 -0)
📝 packages/shared/src/schemas/connection.schema.ts (+1 -0)
📝 packages/shared/src/types/connection.ts (+2 -0)

📄 Description

Linked issue

No linked issue yet; this came from a maintainer-requested feature for model-specific connection behavior.

Why this change

Some models need a different prompt structure than the chat's normal prompt preset. Before this change, switching a chat to a specialized Connection still used the chat-level preset, so users had to manually change chat settings or keep duplicate chats just to target a model-specific prompt format.

What changed

  • Added an optional prompt preset override on API Connections.
  • Updated roleplay and visual novel generation to prefer impersonate/request presets, then the connection override, then the chat preset.
  • Mirrored the same selection behavior in prompt dry-run previews.
  • Added the Connection editor control and schema/storage/migration support for prompt_preset_id.
  • Added focused tests for preset priority and the startup migration.

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

  • Local validation run: pnpm --filter @marinara-engine/server exec tsx --import ./test/setup-env.ts --test test/connection-prompt-preset-selection.test.ts test/db-migrations.test.ts
  • Local validation run: pnpm check
  • Maintainer manually tested that generation uses the selected connection preset, preserves the right preset choices, and falls back correctly if the selected connection preset is later deleted.

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)

No docs, release, or version files changed.

UI evidence (if applicable)

image

Summary by CodeRabbit

  • New Features
    • Users can now assign a specific prompt preset to API connections, overriding the chat's default preset when that connection is active (for roleplay and visual novel chats).

Review Change Stack


🔄 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/727 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 5/12/2026 **Status:** ✅ Merged **Merged:** 5/12/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `main` ← **Head:** `feat/connection-preset-override` --- ### 📝 Commits (2) - [`78f8126`](https://github.com/Pasta-Devs/Marinara-Engine/commit/78f812678cc9bef632024341d88b479c314fa6a4) feat: add connection prompt preset overrides - [`6ee630e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6ee630e1d89cc4a16495372600a071461686cbae) fix: reuse dry-run prompt preset lookup ### 📊 Changes **11 files changed** (+410 additions, -140 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/connections/ConnectionEditor.tsx` (+36 -0) 📝 `packages/server/src/db/migrate.ts` (+6 -0) 📝 `packages/server/src/db/schema/connections.ts` (+2 -0) 📝 `packages/server/src/routes/generate.routes.ts` (+47 -30) 📝 `packages/server/src/routes/generate/dry-run-route.ts` (+124 -110) ➕ `packages/server/src/routes/generate/prompt-preset-selection.ts` (+63 -0) 📝 `packages/server/src/services/storage/connections.storage.ts` (+5 -0) ➕ `packages/server/test/connection-prompt-preset-selection.test.ts` (+78 -0) 📝 `packages/server/test/db-migrations.test.ts` (+46 -0) 📝 `packages/shared/src/schemas/connection.schema.ts` (+1 -0) 📝 `packages/shared/src/types/connection.ts` (+2 -0) </details> ### 📄 Description ## Linked issue No linked issue yet; this came from a maintainer-requested feature for model-specific connection behavior. ## Why this change Some models need a different prompt structure than the chat's normal prompt preset. Before this change, switching a chat to a specialized Connection still used the chat-level preset, so users had to manually change chat settings or keep duplicate chats just to target a model-specific prompt format. ## What changed - Added an optional prompt preset override on API Connections. - Updated roleplay and visual novel generation to prefer impersonate/request presets, then the connection override, then the chat preset. - Mirrored the same selection behavior in prompt dry-run previews. - Added the Connection editor control and schema/storage/migration support for `prompt_preset_id`. - Added focused tests for preset priority and the startup migration. ## Validation - [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 - Local validation run: `pnpm --filter @marinara-engine/server exec tsx --import ./test/setup-env.ts --test test/connection-prompt-preset-selection.test.ts test/db-migrations.test.ts` - Local validation run: `pnpm check` - Maintainer manually tested that generation uses the selected connection preset, preserves the right preset choices, and falls back correctly if the selected connection preset is later deleted. ## Docs and release impact - [x] 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) No docs, release, or version files changed. ## UI evidence (if applicable) <img width="1119" height="317" alt="image" src="https://github.com/user-attachments/assets/2eb85b9a-d93e-4a5d-885c-1b3ab1e3f76b" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Users can now assign a specific prompt preset to API connections, overriding the chat's default preset when that connection is active (for roleplay and visual novel chats). [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/727) <!-- 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:10: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#4749
No description provided.