[PR #614] [MERGED] Fix RP DM routing to linked conversations #4698

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/614
Author: @cha1latte
Created: 5/9/2026
Status: ✅ Merged
Merged: 5/9/2026
Merged by: @cha1latte

Base: main ← Head: fix/issue-601-rp-linked-conversation


📝 Commits (1)

  • 9de57f9 Fix RP DM routing to linked conversations

📊 Changes

1 file changed (+39 additions, -2 deletions)

View changed files

📝 packages/server/src/routes/generate.routes.ts (+39 -2)

📄 Description

Linked issue

Closes #601

Why this change

  • RP mode direct-message commands from a linked roleplay chat were creating a fresh DM with <character> Conversation thread every time, leaving the ongoing linked Conversation empty.

What changed

  • Route [dm] commands from a linked roleplay chat into the existing linked Conversation chat when that linked chat exists and is in conversation mode.
  • Keep the existing standalone DM with <character> creation fallback for unlinked roleplay chats.
  • Update the model-facing DM command reminder so it describes the linked-conversation behavior instead of always promising a new DM chat.

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

Codex-run proof:

  • pnpm --dir packages/server exec tsx ..\..\scratch\issue-601-rp-dm-route-repro.ts failed before the fix on the original issue symptom: linked Conversation message count was 0, and an extra DM with Mara chat was created.
  • pnpm --dir packages/server exec tsx ..\..\scratch\issue-601-rp-dm-route-repro.ts passed after the fix: the linked Conversation received exactly one assistant message containing all three DM sentences, and no extra DM chat was created for the linked case.
  • The same scratch harness also verified the unlinked fallback still creates exactly one standalone DM with Mara Conversation with one grouped assistant message.
  • pnpm check passed locally after the fix.

Manual verification notes

  • No human-only verification is needed for the core routing claim. The scratch harness exercises the real /api/generate route with a fake local OpenAI-compatible provider and verifies both the linked and unlinked DM command paths.
  • Local proof files: scratch/issue-601-before-output.txt, scratch/issue-601-after-output.txt, and scratch/bugfix-verification.json.

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, schema, dependency, or version files were changed.

UI evidence (if applicable)

N/A. This is backend/logic command routing with terminal proof from the scratch harness.


🔄 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/614 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/9/2026 **Status:** ✅ Merged **Merged:** 5/9/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `main` ← **Head:** `fix/issue-601-rp-linked-conversation` --- ### 📝 Commits (1) - [`9de57f9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9de57f9a2f60c50fe84366dded5c38a4675a13ec) Fix RP DM routing to linked conversations ### 📊 Changes **1 file changed** (+39 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/routes/generate.routes.ts` (+39 -2) </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 #601 ## Why this change <!-- What user problem, bug, or goal does this solve? --> - RP mode direct-message commands from a linked roleplay chat were creating a fresh `DM with <character>` Conversation thread every time, leaving the ongoing linked Conversation empty. ## What changed <!-- List the key changes in this PR --> - Route `[dm]` commands from a linked roleplay chat into the existing linked Conversation chat when that linked chat exists and is in `conversation` mode. - Keep the existing standalone `DM with <character>` creation fallback for unlinked roleplay chats. - Update the model-facing DM command reminder so it describes the linked-conversation behavior instead of always promising a new DM chat. ## Validation <!-- Required: include commands run and/or manual checks performed --> - [ ] `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` Codex-run proof: - `pnpm --dir packages/server exec tsx ..\..\scratch\issue-601-rp-dm-route-repro.ts` failed before the fix on the original issue symptom: linked Conversation message count was `0`, and an extra `DM with Mara` chat was created. - `pnpm --dir packages/server exec tsx ..\..\scratch\issue-601-rp-dm-route-repro.ts` passed after the fix: the linked Conversation received exactly one assistant message containing all three DM sentences, and no extra DM chat was created for the linked case. - The same scratch harness also verified the unlinked fallback still creates exactly one standalone `DM with Mara` Conversation with one grouped assistant message. - `pnpm check` passed locally after the fix. ### 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. --> - No human-only verification is needed for the core routing claim. The scratch harness exercises the real `/api/generate` route with a fake local OpenAI-compatible provider and verifies both the linked and unlinked DM command paths. - Local proof files: `scratch/issue-601-before-output.txt`, `scratch/issue-601-after-output.txt`, and `scratch/bugfix-verification.json`. ## 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, schema, dependency, or version files were changed. ## UI evidence (if applicable) N/A. This is backend/logic command routing with terminal proof from the scratch harness. --- <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:55 +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#4698
No description provided.