[GH-ISSUE #2866] [Issue]: /continue appends to the latest assistant message instead of creating a new reply #1453

Closed
opened 2026-10-21 05:35:29 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Romuromylus on GitHub (Jun 25, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2866

Originally assigned to: @Romuromylus on GitHub.

Summary

In Roleplay mode, the /continue slash command appends the generated continuation to the latest assistant message even when that message is no longer the last message in the chat. After the user posts a new message, /continue writes onto an earlier assistant message (e.g. the scenario / first message) instead of creating a new reply.

Expected behavior

When the last message in the chat is a user message, /continue should generate a fresh assistant reply (a new message), the same way the /continue toolbar button only offers to continue when the last message is an assistant reply.

Actual behavior

/continue always targets the latest assistant message regardless of position. If the user has posted since that reply, the new text is appended onto the older assistant message (in the reported case, the scenario message at index 0) rather than creating a new message.

Steps to reproduce

  1. Create a Roleplay chat with a single character that has a first message / scenario message (message 0).
  2. Use /impersonate "Hi" (or any path that makes the user post the most recent message).
  3. Run /continue.
  4. Observe the character's response is appended to the scenario message (message 0) instead of being created as a new message.

Using /guided respond for CharA. do not respond for User in place of /continue does not exhibit this, because that path always generates a new message.

Environment

  • Marinara Engine version: 2.0.5
  • Install type: reproduced on multiple installs, including Termux
  • OS + version: Android (Termux) confirmed by a second reporter; also seen with desktop installs
  • Browser or app shell: app shell / multiple

Logs, screenshots, or video

Reported and corroborated in the community Discord. No console errors; the misbehavior is in slash-command target selection.

Additional context

Root cause is client-side: the /continue slash handler in packages/client/src/lib/slash-commands.ts uses latestAssistantMessageId unconditionally, with no equivalent of the toolbar button's lastMessageRole === "assistant" gate (ChatInput.tsx). When the trailing message is a user message, the only/last assistant message is an earlier one (the scenario), so the continuation appends there.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Romuromylus on GitHub (Jun 25, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2866 Originally assigned to: @Romuromylus on GitHub. ## Summary In Roleplay mode, the `/continue` slash command appends the generated continuation to the latest assistant message even when that message is no longer the last message in the chat. After the user posts a new message, `/continue` writes onto an earlier assistant message (e.g. the scenario / first message) instead of creating a new reply. ## Expected behavior When the last message in the chat is a user message, `/continue` should generate a fresh assistant reply (a new message), the same way the `/continue` toolbar button only offers to continue when the last message is an assistant reply. ## Actual behavior `/continue` always targets the latest assistant message regardless of position. If the user has posted since that reply, the new text is appended onto the older assistant message (in the reported case, the scenario message at index 0) rather than creating a new message. ## Steps to reproduce 1. Create a Roleplay chat with a single character that has a first message / scenario message (message 0). 2. Use `/impersonate "Hi"` (or any path that makes the user post the most recent message). 3. Run `/continue`. 4. Observe the character's response is appended to the scenario message (message 0) instead of being created as a new message. Using `/guided respond for CharA. do not respond for User` in place of `/continue` does not exhibit this, because that path always generates a new message. ## Environment - Marinara Engine version: 2.0.5 - Install type: reproduced on multiple installs, including Termux - OS + version: Android (Termux) confirmed by a second reporter; also seen with desktop installs - Browser or app shell: app shell / multiple ## Logs, screenshots, or video Reported and corroborated in the community Discord. No console errors; the misbehavior is in slash-command target selection. ## Additional context Root cause is client-side: the `/continue` slash handler in `packages/client/src/lib/slash-commands.ts` uses `latestAssistantMessageId` unconditionally, with no equivalent of the toolbar button's `lastMessageRole === "assistant"` gate (`ChatInput.tsx`). When the trailing message is a user message, the only/last assistant message is an earlier one (the scenario), so the continuation appends there. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:35:29 +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#1453
No description provided.