[PR #6007] [MERGED] Fix assigned chat issues and Narrative Director prompt duplication #7024

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

📋 Pull Request Information

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

Base: staging ← Head: fix/6006-assigned-issue-sweep


📝 Commits (4)

  • c5e36c1 docs(changelog): start assigned issue sweep
  • 26bc5af feat(chat): finish assigned reply, display, DM, and local backend fixes
  • e896e38 test(chat): handle context probes and preserve responsive reply proof
  • c47179c Fix Director nudges and sweep review edge cases

📊 Changes

34 files changed (+1237 additions, -181 deletions)

View changed files

📝 CHANGELOG.md (+10 -0)
➕ e2e/assigned-chat-sweep.e2e.ts (+230 -0)
📝 e2e/game-native-dice.e2e.ts (+5 -0)
📝 e2e/roleplay-commands.e2e.ts (+25 -0)
📝 packages/client/src/App.tsx (+2 -0)
📝 packages/client/src/components/chat/ChatInput.tsx (+28 -2)
📝 packages/client/src/components/chat/ChatMessage.tsx (+76 -62)
📝 packages/client/src/components/chat/ConversationInput.tsx (+34 -7)
📝 packages/client/src/components/chat/ConversationMessage.tsx (+5 -0)
📝 packages/client/src/components/chat/ConversationMessageActions.tsx (+10 -16)
📝 packages/client/src/components/chat/ConversationMessageGrouped.tsx (+3 -0)
➕ packages/client/src/components/chat/MessageReplyPreview.tsx (+77 -0)
📝 packages/client/src/components/panels/SettingsPanel.tsx (+6 -3)
📝 packages/client/src/hooks/use-connections.ts (+19 -0)
📝 packages/client/src/hooks/use-generate.ts (+2 -0)
📝 packages/client/src/localization/locales/en.json (+7 -0)
📝 packages/client/src/stores/chat.store.ts (+12 -0)
📝 packages/client/src/stores/ui.store.ts (+1 -1)
📝 packages/server/src/routes/connections.routes.ts (+21 -0)
📝 packages/server/src/routes/generate.routes.ts (+64 -34)

...and 14 more files

📄 Description

Linked issue

Closes #6006
Closes #6005
Closes #6003
Closes #6002
Closes #6000
Closes #5994
Closes #5902
Closes #6008

Memory Nag #5999 and Pixelforge #5903 are handled in their owning repository by Pasta-Devs/Marinara-Agents#776.

Why this change

This assigned-issue sweep fixes chat controls and state that made ordinary conversations harder to follow: widely spaced desktop buttons, insufficient large-display text sizes, missing reply quotes, unmarked Roleplay DMs, and display regexes that appeared only after streaming finished. It also refreshes local runtime context limits on reload, retains actionable Game turns with no prose, and fixes an extra Narrative Director planning prompt reported during the sweep.

What changed

  • Add Reply to existing Conversation/Roleplay message actions. Quote the selected text or the full message, preview/cancel above the composer, and persist a bounded plain-text snapshot in message extras. Existing quotes remain visible in history; only the latest user message's quote enters the model prompt. Normal generation, continuation, delayed Conversation history refresh, post-only/manual sends, and prompt preview share that rule.
  • Offer 26/30/34 px interface sizes and chat text up to 72 px. Keep desktop actions grouped at the start of the row, preserve mobile spacing, and expose Conversation actions to keyboard focus.
  • On page load, probe supported metadata from local OpenAI-compatible backends using the existing safe-fetch boundary. Refresh stored context capacity and invalidate the connection cache; preserve the configured limit for offline/unsupported/invalid responses and when a concurrent settings save wins. Refreshes process three connections at a time; a file-storage transaction compares the captured fields before writing, including saves within the same millisecond. Authenticated HTTP probes retain the existing configured local-provider transport contract, with credentials restricted to the exact configured origin across redirects. llama.cpp, KoboldCpp, and TabbyAPI response shapes are covered. Stock Oobabooga metadata currently exposes no reliable runtime capacity, so its configured value is retained; forks exposing truncation settings are accepted.
  • Apply the existing scoped display-regex/macro pipeline to streamed Roleplay text and reuse durable unread counts for new, reused, and linked character DMs.
  • Narrative Director push actions now append the chosen fixed nudge once in merged and individual Roleplay prompts, without a second planning-model call. Regeneration excludes old generated Director/legacy Secret Plot injections while retaining the original chosen nudge. Secret Plot maintenance remains separate, runs only when enabled, and keeps its stored arc when switched off (#6008).
  • Give the existing hidden-anchor gate a general actionable-output flag, including package verbs and pending Game state tools, without creating visible empty rows.
  • Add canonical English localization, focused browser/server regressions, and Unreleased changelog entries. No dependency or version changes.

Outside-contributor work intentionally excluded: #5963 / #5965; #5868 and #5869 / #5872; #5836 / #5837; #5833 / #5835; #5856 / #5771. Translation follow-ups #5968 and #5834 already have translations merged in #5993 and remain pending their outside English-source PRs. #5779 remains an active contributor notice. #6009 and #6010 were filed after this sweep began and remain queued for a later pass; they are not claimed by this PR.

Validation

Observed local results:

  • pnpm check, pnpm localization:check, and pnpm regression:prompt — passed.
  • New assigned-chat-sweep.regression.ts — passed against real Fastify routes, isolated file storage, and local mock providers: quote persistence and latest-only prompt inclusion in both modes; continuation; malformed/oversized quote rejection; local capacity refresh, unsupported/offline preservation, concurrent settings; new/reused/linked DM unread counters, clearing, and preservation after badge-write failures; bounded probes, same-timestamp concurrent saves, and cross-origin redirect refusal. A synthetic Director fixture reproduces two requests before the fix, then proves one nudge/request with Secret Plot off, fresh/regen cache handling, both push modes and group settings, Secret Plot maintenance when enabled, and stored-arc preservation when disabled.
  • Complete Node regression run reached 241/244. The added delayed-history code exceeded an existing source assertion's size bound; that assertion was adjusted and the full open-issues file now passes. The other two failures (mari-guard-sibling-paths, storage-writer-lock) reproduce unchanged on staging commit 712621d43 on this Mac. The complete Linux Node suite passed in CI.
  • Browser verification exercises keyboard access in both Conversation layouts, Element/text selection anchors, reply selection/cancellation, persisted post-only quotes after reload, desktop spacing, scoped streaming regex, 3840×2160 layout at maximum sizes, and existing command/dice flows across desktop Chromium, mobile Chromium, and mobile WebKit. The focused command was pnpm smoke:ui e2e/assigned-chat-sweep.e2e.ts e2e/roleplay-commands.e2e.ts e2e/game-native-dice.e2e.ts --workers 1: 43 passed, with the two 4K-on-mobile cases intentionally skipped.
  • Existing message-action and swipe-preference browser checks: pnpm smoke:ui e2e/core-flows.e2e.ts --grep 'message actions (follow|fit)' --workers 1 — 9 passed across all three browser projects.
  • On final implementation commit c47179cbe, the affected browser command again passed 43 tests (2 intentional skips), including both keyboard layouts and selection-anchor cases. The full browser matrix runs in CI. A local parallel smoke run exposed shared-setting resets between pre-existing tests, so affected local checks are run serially.
  • git diff --check — passed.

The checkboxes below remain human verification tasks.

  • 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 reply selection/cancellation and streaming cleanup with your usual characters and regex scripts in both themes.
  • Manually verify a Roleplay DM raises the Conversation badge and opening the DM clears it.
  • Manually verify reloading after changing the loaded model in your real local backend updates the context limit. Endpoint tests use mock responses; no local inference model was launched for this PR.
  • Manually verify preferred scaling on physical 4K hardware. Automated proof is a 3840×2160 browser viewport with the composer reachable and no horizontal overflow.
  • Manually verify natural/random Narrative Director pushes with Secret Plot off in your usual Roleplay chat, then toggle Secret Plot on/off and inspect the assembled request. Automated proof uses synthetic conversations and a local mock provider; private chat screenshots are not included here.
  • Manually verify command-only Game turns with your installed package. The gate and existing dice/command runtime paths have regression coverage; this does not claim Pixelforge visual weather rewind support.

Docs and release impact

Unreleased changelog and canonical English UI strings are updated. No Engine docs paths, installer/update behavior, or version-bearing metadata changed; no docs-i18n follow-up is required.

  • 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
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Before/after screenshots and provenance. Synthetic fixtures compare untouched staging 712621d43 with this branch; desktop, mobile, and maximum-size captures are included.

Before After
Desktop actions before Reply preview and compact actions

🔄 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/6007 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 9/9/2026 **Status:** ✅ Merged **Merged:** 9/9/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/6006-assigned-issue-sweep` --- ### 📝 Commits (4) - [`c5e36c1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c5e36c1759e885d19a43ba9d21a4d8f30c15ac4a) docs(changelog): start assigned issue sweep - [`26bc5af`](https://github.com/Pasta-Devs/Marinara-Engine/commit/26bc5afcc1e7021a708b22e357988dede7861e1e) feat(chat): finish assigned reply, display, DM, and local backend fixes - [`e896e38`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e896e38402831d2156f76b3c65ec4b2e81aed85c) test(chat): handle context probes and preserve responsive reply proof - [`c47179c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c47179cbe78c344768e809c695a325fc3e7b6b0d) Fix Director nudges and sweep review edge cases ### 📊 Changes **34 files changed** (+1237 additions, -181 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+10 -0) ➕ `e2e/assigned-chat-sweep.e2e.ts` (+230 -0) 📝 `e2e/game-native-dice.e2e.ts` (+5 -0) 📝 `e2e/roleplay-commands.e2e.ts` (+25 -0) 📝 `packages/client/src/App.tsx` (+2 -0) 📝 `packages/client/src/components/chat/ChatInput.tsx` (+28 -2) 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+76 -62) 📝 `packages/client/src/components/chat/ConversationInput.tsx` (+34 -7) 📝 `packages/client/src/components/chat/ConversationMessage.tsx` (+5 -0) 📝 `packages/client/src/components/chat/ConversationMessageActions.tsx` (+10 -16) 📝 `packages/client/src/components/chat/ConversationMessageGrouped.tsx` (+3 -0) ➕ `packages/client/src/components/chat/MessageReplyPreview.tsx` (+77 -0) 📝 `packages/client/src/components/panels/SettingsPanel.tsx` (+6 -3) 📝 `packages/client/src/hooks/use-connections.ts` (+19 -0) 📝 `packages/client/src/hooks/use-generate.ts` (+2 -0) 📝 `packages/client/src/localization/locales/en.json` (+7 -0) 📝 `packages/client/src/stores/chat.store.ts` (+12 -0) 📝 `packages/client/src/stores/ui.store.ts` (+1 -1) 📝 `packages/server/src/routes/connections.routes.ts` (+21 -0) 📝 `packages/server/src/routes/generate.routes.ts` (+64 -34) _...and 14 more files_ </details> ### 📄 Description ## Linked issue Closes #6006 Closes #6005 Closes #6003 Closes #6002 Closes #6000 Closes #5994 Closes #5902 Closes #6008 Memory Nag #5999 and Pixelforge #5903 are handled in their owning repository by Pasta-Devs/Marinara-Agents#776. ## Why this change This assigned-issue sweep fixes chat controls and state that made ordinary conversations harder to follow: widely spaced desktop buttons, insufficient large-display text sizes, missing reply quotes, unmarked Roleplay DMs, and display regexes that appeared only after streaming finished. It also refreshes local runtime context limits on reload, retains actionable Game turns with no prose, and fixes an extra Narrative Director planning prompt reported during the sweep. ## What changed - Add Reply to existing Conversation/Roleplay message actions. Quote the selected text or the full message, preview/cancel above the composer, and persist a bounded plain-text snapshot in message extras. Existing quotes remain visible in history; only the latest user message's quote enters the model prompt. Normal generation, continuation, delayed Conversation history refresh, post-only/manual sends, and prompt preview share that rule. - Offer 26/30/34 px interface sizes and chat text up to 72 px. Keep desktop actions grouped at the start of the row, preserve mobile spacing, and expose Conversation actions to keyboard focus. - On page load, probe supported metadata from local OpenAI-compatible backends using the existing safe-fetch boundary. Refresh stored context capacity and invalidate the connection cache; preserve the configured limit for offline/unsupported/invalid responses and when a concurrent settings save wins. Refreshes process three connections at a time; a file-storage transaction compares the captured fields before writing, including saves within the same millisecond. Authenticated HTTP probes retain the existing configured local-provider transport contract, with credentials restricted to the exact configured origin across redirects. llama.cpp, KoboldCpp, and TabbyAPI response shapes are covered. Stock Oobabooga metadata currently exposes no reliable runtime capacity, so its configured value is retained; forks exposing truncation settings are accepted. - Apply the existing scoped display-regex/macro pipeline to streamed Roleplay text and reuse durable unread counts for new, reused, and linked character DMs. - Narrative Director push actions now append the chosen fixed nudge once in merged and individual Roleplay prompts, without a second planning-model call. Regeneration excludes old generated Director/legacy Secret Plot injections while retaining the original chosen nudge. Secret Plot maintenance remains separate, runs only when enabled, and keeps its stored arc when switched off (#6008). - Give the existing hidden-anchor gate a general actionable-output flag, including package verbs and pending Game state tools, without creating visible empty rows. - Add canonical English localization, focused browser/server regressions, and Unreleased changelog entries. No dependency or version changes. Outside-contributor work intentionally excluded: #5963 / #5965; #5868 and #5869 / #5872; #5836 / #5837; #5833 / #5835; #5856 / #5771. Translation follow-ups #5968 and #5834 already have translations merged in #5993 and remain pending their outside English-source PRs. #5779 remains an active contributor notice. #6009 and #6010 were filed after this sweep began and remain queued for a later pass; they are not claimed by this PR. ## Validation Observed local results: - `pnpm check`, `pnpm localization:check`, and `pnpm regression:prompt` — passed. - New `assigned-chat-sweep.regression.ts` — passed against real Fastify routes, isolated file storage, and local mock providers: quote persistence and latest-only prompt inclusion in both modes; continuation; malformed/oversized quote rejection; local capacity refresh, unsupported/offline preservation, concurrent settings; new/reused/linked DM unread counters, clearing, and preservation after badge-write failures; bounded probes, same-timestamp concurrent saves, and cross-origin redirect refusal. A synthetic Director fixture reproduces two requests before the fix, then proves one nudge/request with Secret Plot off, fresh/regen cache handling, both push modes and group settings, Secret Plot maintenance when enabled, and stored-arc preservation when disabled. - Complete Node regression run reached 241/244. The added delayed-history code exceeded an existing source assertion's size bound; that assertion was adjusted and the full `open-issues` file now passes. The other two failures (`mari-guard-sibling-paths`, `storage-writer-lock`) reproduce unchanged on staging commit 712621d43 on this Mac. The [complete Linux Node suite passed in CI](https://github.com/Pasta-Devs/Marinara-Engine/actions/runs/34399368507/job/102627119956). - Browser verification exercises keyboard access in both Conversation layouts, Element/text selection anchors, reply selection/cancellation, persisted post-only quotes after reload, desktop spacing, scoped streaming regex, 3840×2160 layout at maximum sizes, and existing command/dice flows across desktop Chromium, mobile Chromium, and mobile WebKit. The focused command was `pnpm smoke:ui e2e/assigned-chat-sweep.e2e.ts e2e/roleplay-commands.e2e.ts e2e/game-native-dice.e2e.ts --workers 1`: 43 passed, with the two 4K-on-mobile cases intentionally skipped. - Existing message-action and swipe-preference browser checks: `pnpm smoke:ui e2e/core-flows.e2e.ts --grep 'message actions (follow|fit)' --workers 1` — 9 passed across all three browser projects. - On final implementation commit c47179cbe, the affected browser command again passed 43 tests (2 intentional skips), including both keyboard layouts and selection-anchor cases. The full browser matrix runs in CI. A local parallel smoke run exposed shared-setting resets between pre-existing tests, so affected local checks are run serially. - `git diff --check` — passed. The checkboxes below remain human verification tasks. - [ ] `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 reply selection/cancellation and streaming cleanup with your usual characters and regex scripts in both themes. - Manually verify a Roleplay DM raises the Conversation badge and opening the DM clears it. - Manually verify reloading after changing the loaded model in your real local backend updates the context limit. Endpoint tests use mock responses; no local inference model was launched for this PR. - Manually verify preferred scaling on physical 4K hardware. Automated proof is a 3840×2160 browser viewport with the composer reachable and no horizontal overflow. - Manually verify natural/random Narrative Director pushes with Secret Plot off in your usual Roleplay chat, then toggle Secret Plot on/off and inspect the assembled request. Automated proof uses synthetic conversations and a local mock provider; private chat screenshots are not included here. - Manually verify command-only Game turns with your installed package. The gate and existing dice/command runtime paths have regression coverage; this does not claim Pixelforge visual weather rewind support. ## Docs and release impact Unreleased changelog and canonical English UI strings are updated. No Engine docs paths, installer/update behavior, or version-bearing metadata changed; no docs-i18n follow-up is required. - [ ] 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 - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) [Before/after screenshots and provenance](https://gist.github.com/SpicyMarinara/89f081fc677d5efec80f4a4a1769bb38). Synthetic fixtures compare untouched staging 712621d43 with this branch; desktop, mobile, and maximum-size captures are included. | Before | After | | --- | --- | | ![Desktop actions before](https://gist.githubusercontent.com/SpicyMarinara/89f081fc677d5efec80f4a4a1769bb38/raw/before-desktop.png) | ![Reply preview and compact actions](https://gist.githubusercontent.com/SpicyMarinara/89f081fc677d5efec80f4a4a1769bb38/raw/desktop-roleplay-classic-reply.png) | --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:15:50 +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#7024
No description provided.