[PR #6235] [MERGED] feat: show package chat controls only when their package is installed #7099

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6235
Author: @Gunterlie
Created: 9/15/2026
Status: ✅ Merged
Merged: 9/15/2026
Merged by: @Gunterlie

Base: staging ← Head: feat/package-prompt-context-all-modes


📝 Commits (2)

  • 29df3e2 feat: show package chat controls only when their package is installed
  • eb8be22 fix: register slurp2 chat metadata namespace as engine-owned

📊 Changes

10 files changed (+128 additions, -30 deletions)

View changed files

📝 packages/client/src/components/characters/CharacterEditor.tsx (+6 -2)
📝 packages/client/src/components/characters/ConvoProfileFields.tsx (+13 -10)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+46 -18)
📝 packages/client/src/localization/locales/en.json (+2 -0)
📝 packages/server/src/routes/chats.routes.ts (+6 -0)
📝 packages/server/src/routes/generate.routes.ts (+1 -0)
📝 packages/server/src/services/capability-packages/capability-prompt-context.service.ts (+2 -0)
📝 packages/shared/src/schemas/gm-verb-table.schema.ts (+1 -0)
📝 packages/shared/src/types/chat.ts (+2 -0)
➕ scripts/regressions/capability-package-chat-controls.regression.ts (+49 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #6234

Why this change

  • Noodle integration controls were always visible in the base Engine, even when the Noodle package is not installed.
  • Slurp had no per-chat control to bring its activity into a chat, so it could not integrate as far as Noodle does.
  • Package prompt context did not receive the preset wrap format, so a package block could not match the prompt around it.

What changed

  • Chat settings: "Allow Noodle references" renders only while the noodle package is installed and active. A new "Include Slurp activity" switch renders only while the slurp2 package is active. It is off by default and is stored as slurp2ActivityContextEnabled in chat metadata.
  • Character editor: the "Also apply these instructions to this character's Noodle images" checkbox renders only while Noodle is active. The image instructions field stays visible, because other packages use it.
  • Server: PATCH /chats/:id/metadata validates slurp2ActivityContextEnabled as a boolean. The field is added to the shared ChatMetadata type.
  • Prompt context: the capability prompt-context request now includes an optional wrapFormat, passed from the preset. Conversation and roleplay already collect package prompt context on staging, so no mode change was needed.
  • Tests: added scripts/regressions/capability-package-chat-controls.regression.ts.
  • Stored values: no stored values are deleted. The controls are only hidden.

The Slurp package side, which reads slurp2ActivityContextEnabled and wrapFormat, ships separately in Marinara Agents.

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

Also ran node ./scripts/run-regressions.mjs --filter scripts/regressions/capability-package-chat-controls.regression.ts (passed) and --filter scripts/regressions/tracker-gallery-ui.regression.mjs (passed). The single pnpm check lint warning is an existing one in GameNarration.tsx.

Manual verification notes

Not yet verified in a browser. To verify manually:

  • With neither package installed, open chat settings in Conversation, Roleplay and Game chats. Neither package switch should show.
  • Install only Noodle. "Allow Noodle references" should show, and "Include Slurp activity" should not.
  • Install only Slurp. "Include Slurp activity" should show, off by default, and Noodle's switch should not. Toggle it and reload; the value should persist.
  • Install both packages. Both switches should show.
  • Open a character's Conversation tab without Noodle. The image instructions field should show, and the Noodle checkbox should not. With Noodle installed, the checkbox should show.

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] 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)

Not captured yet; see manual verification notes.

Summary by CodeRabbit

  • New Features

    • Added an opt-in “Include Slurp activity” chat setting for eligible chats.
    • Added Slurp activity context support, allowing recent posts, messages, commissions, and tips to inform conversations.
    • Image-generation instructions remain available independently from the Noodle-specific option.
  • Improvements

    • Chat context switches now appear only when their associated capability is installed and active.
    • Prompt context formatting now follows the selected XML, Markdown, or unwrapped format.
  • Bug Fixes

    • Added validation to prevent invalid Slurp activity settings from being saved.
  • Tests

    • Added regression coverage for capability-gated controls, prompt context, localization, and image instructions.

🔄 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/6235 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 9/15/2026 **Status:** ✅ Merged **Merged:** 9/15/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `staging` ← **Head:** `feat/package-prompt-context-all-modes` --- ### 📝 Commits (2) - [`29df3e2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/29df3e289e43c5f2acfa1d6722b08b6baa74e38a) feat: show package chat controls only when their package is installed - [`eb8be22`](https://github.com/Pasta-Devs/Marinara-Engine/commit/eb8be22c5a030c9d73412bccb90ef80fbe83e59d) fix: register slurp2 chat metadata namespace as engine-owned ### 📊 Changes **10 files changed** (+128 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/characters/CharacterEditor.tsx` (+6 -2) 📝 `packages/client/src/components/characters/ConvoProfileFields.tsx` (+13 -10) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+46 -18) 📝 `packages/client/src/localization/locales/en.json` (+2 -0) 📝 `packages/server/src/routes/chats.routes.ts` (+6 -0) 📝 `packages/server/src/routes/generate.routes.ts` (+1 -0) 📝 `packages/server/src/services/capability-packages/capability-prompt-context.service.ts` (+2 -0) 📝 `packages/shared/src/schemas/gm-verb-table.schema.ts` (+1 -0) 📝 `packages/shared/src/types/chat.ts` (+2 -0) ➕ `scripts/regressions/capability-package-chat-controls.regression.ts` (+49 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Closes #6234 ## Why this change - Noodle integration controls were always visible in the base Engine, even when the Noodle package is not installed. - Slurp had no per-chat control to bring its activity into a chat, so it could not integrate as far as Noodle does. - Package prompt context did not receive the preset wrap format, so a package block could not match the prompt around it. ## What changed - **Chat settings:** "Allow Noodle references" renders only while the `noodle` package is installed and active. A new "Include Slurp activity" switch renders only while the `slurp2` package is active. It is off by default and is stored as `slurp2ActivityContextEnabled` in chat metadata. - **Character editor:** the "Also apply these instructions to this character's Noodle images" checkbox renders only while Noodle is active. The image instructions field stays visible, because other packages use it. - **Server:** `PATCH /chats/:id/metadata` validates `slurp2ActivityContextEnabled` as a boolean. The field is added to the shared `ChatMetadata` type. - **Prompt context:** the capability `prompt-context` request now includes an optional `wrapFormat`, passed from the preset. Conversation and roleplay already collect package prompt context on `staging`, so no mode change was needed. - **Tests:** added `scripts/regressions/capability-package-chat-controls.regression.ts`. - **Stored values:** no stored values are deleted. The controls are only hidden. The Slurp package side, which reads `slurp2ActivityContextEnabled` and `wrapFormat`, ships separately in Marinara Agents. ## Validation - [x] `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) - [x] Read and followed `CONTRIBUTING.md` Also ran `node ./scripts/run-regressions.mjs --filter scripts/regressions/capability-package-chat-controls.regression.ts` (passed) and `--filter scripts/regressions/tracker-gallery-ui.regression.mjs` (passed). The single `pnpm check` lint warning is an existing one in `GameNarration.tsx`. ### Manual verification notes Not yet verified in a browser. To verify manually: - With neither package installed, open chat settings in Conversation, Roleplay and Game chats. Neither package switch should show. - Install only Noodle. "Allow Noodle references" should show, and "Include Slurp activity" should not. - Install only Slurp. "Include Slurp activity" should show, off by default, and Noodle's switch should not. Toggle it and reload; the value should persist. - Install both packages. Both switches should show. - Open a character's Conversation tab without Noodle. The image instructions field should show, and the Noodle checkbox should not. With Noodle installed, the checkbox should show. ## Docs and release impact - [x] 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]` 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) Not captured yet; see manual verification notes. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added an opt-in “Include Slurp activity” chat setting for eligible chats. - Added Slurp activity context support, allowing recent posts, messages, commissions, and tips to inform conversations. - Image-generation instructions remain available independently from the Noodle-specific option. - **Improvements** - Chat context switches now appear only when their associated capability is installed and active. - Prompt context formatting now follows the selected XML, Markdown, or unwrapped format. - **Bug Fixes** - Added validation to prevent invalid Slurp activity settings from being saved. - **Tests** - Added regression coverage for capability-gated controls, prompt context, localization, and image instructions. <!-- 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:16:31 +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#7099
No description provided.