[GH-ISSUE #6080] [Issue]: Roleplay/Conversation completion sound only plays after navigating to another chat #3371

Closed
opened 2026-10-21 06:02:24 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @ghost on GitHub (Sep 12, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6080

Summary

In Roleplay and Conversation chats the completion notification sound only plays if you have navigated to a different chat before the reply finishes. If you stay on the chat and look away (another window, another tab), no sound plays, even with the mode's notification sound enabled and "only when unfocused" on. Game mode already pings regardless of which chat is active.

Expected behavior

With the Roleplay (or Conversation) notification sound enabled, a finished reply plays the ping whether or not the chat is still the active one, subject to the existing "only play when unfocused" setting.

Actual behavior

The ping plays only when currentActive !== params.chatId. The Roleplay/Conversation playConfiguredNotificationPing(...) call is inside the navigated-away block that also increments the unread count and shows the avatar bubble (packages/client/src/hooks/use-generate.ts, the block ending around line 3262 on staging 9bf5baaf0). Game mode's ping sits outside that condition (around line 3208), so Game behaves as expected.

Steps to reproduce

  1. Settings → enable the Roleplay notification sound; leave "only play sounds when unfocused" on.
  2. Open a Roleplay chat and send a message.
  3. While it generates, switch to another application or browser tab. Do not open another Marinara chat.
  4. Wait for the reply to finish. No sound.
  5. Repeat, but this time open a different Marinara chat during generation. The sound plays.
  6. Repeat step 3 in a Game chat: the sound plays.

Environment

  • Marinara Engine version: 2.4.5, staging 9bf5baaf0 (also reproduced on 2.4.3 and 2.4.4)
  • Install type: source
  • OS + version: macOS 26.6
  • Browser or app shell: Firefox

Logs, screenshots, or video

Not needed to reproduce; the condition is visible in the source at the line above.

Additional context

Related: #1808 asked for the navigated-away case and #1841 fixed it; the stay-on-chat case was never covered. I have been running a fix on my fork since 2026-08-13 (one ping site in the success path, gated by the same mode toggles and the unfocused-only setting; Game keeps its single ping via gameTurnLoadedSoundPlayed). I am taking this one: draft PR follows today.

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 @ghost on GitHub (Sep 12, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6080 ## Summary In Roleplay and Conversation chats the completion notification sound only plays if you have navigated to a *different* chat before the reply finishes. If you stay on the chat and look away (another window, another tab), no sound plays, even with the mode's notification sound enabled and "only when unfocused" on. Game mode already pings regardless of which chat is active. ## Expected behavior With the Roleplay (or Conversation) notification sound enabled, a finished reply plays the ping whether or not the chat is still the active one, subject to the existing "only play when unfocused" setting. ## Actual behavior The ping plays only when `currentActive !== params.chatId`. The Roleplay/Conversation `playConfiguredNotificationPing(...)` call is inside the navigated-away block that also increments the unread count and shows the avatar bubble (`packages/client/src/hooks/use-generate.ts`, the block ending around line 3262 on staging `9bf5baaf0`). Game mode's ping sits outside that condition (around line 3208), so Game behaves as expected. ## Steps to reproduce 1. Settings → enable the Roleplay notification sound; leave "only play sounds when unfocused" on. 2. Open a Roleplay chat and send a message. 3. While it generates, switch to another application or browser tab. Do not open another Marinara chat. 4. Wait for the reply to finish. No sound. 5. Repeat, but this time open a different Marinara chat during generation. The sound plays. 6. Repeat step 3 in a Game chat: the sound plays. ## Environment - Marinara Engine version: 2.4.5, staging `9bf5baaf0` (also reproduced on 2.4.3 and 2.4.4) - Install type: source - OS + version: macOS 26.6 - Browser or app shell: Firefox ## Logs, screenshots, or video Not needed to reproduce; the condition is visible in the source at the line above. ## Additional context Related: #1808 asked for the navigated-away case and #1841 fixed it; the stay-on-chat case was never covered. I have been running a fix on my fork since 2026-08-13 (one ping site in the success path, gated by the same mode toggles and the unfocused-only setting; Game keeps its single ping via `gameTurnLoadedSoundPlayed`). I am taking this one: draft PR follows today. ## 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 06:02:24 +07:00
  • closed this issue
  • added the
    in-pr
    label
Author
Owner

@ghost commented on GitHub (Sep 12, 2026):

Correction after measuring, before anyone spends time on this.

Staging 9bf5baaf0, built clean beside a build of my branch, same cloned data, a mock OpenAI-compatible provider, Web Audio faked to count synthesized pings, Playwright driving the composer:

build stay on chat, 0.2 s reply stay on chat, 20 s reply
staging 9bf5baaf0 1 ping (t+214 ms) 1 ping (t+20.1 s)
my branch (PR #6081) 2 pings, 7 ms apart 2 pings, 7 ms apart

The stay-on-chat ping already exists: ChatRoleplaySurface.tsx:1897 (and ConversationView.tsx:1166 for Conversation) plays it when a fresh assistant message appears in the active chat, since v2.0.3. use-generate.ts pings only for the navigated-away case because that is when no surface is mounted. One ping each way, by design. My reading missed the surface, and #6081 would have added a second ping on top of it.

What I actually observe on my install is different and I will file it separately with a precise repro once I have one without my own patch in the way: with post-processing agents on, the surface's ping comes when the agents finish (the message leaves postProcessingPending), not when the text finishes — and a held rewrite that never lands means no ping at all.

Closing this as not a bug as stated. #6081 is closed too.

<!-- gh-comment-id:5646512614 --> @ghost commented on GitHub (Sep 12, 2026): Correction after measuring, before anyone spends time on this. Staging `9bf5baaf0`, built clean beside a build of my branch, same cloned data, a mock OpenAI-compatible provider, Web Audio faked to count synthesized pings, Playwright driving the composer: | build | stay on chat, 0.2 s reply | stay on chat, 20 s reply | |---|---|---| | staging `9bf5baaf0` | **1 ping** (t+214 ms) | **1 ping** (t+20.1 s) | | my branch (PR #6081) | 2 pings, 7 ms apart | 2 pings, 7 ms apart | The stay-on-chat ping already exists: `ChatRoleplaySurface.tsx:1897` (and `ConversationView.tsx:1166` for Conversation) plays it when a fresh assistant message appears in the active chat, since v2.0.3. `use-generate.ts` pings only for the navigated-away case because that is when no surface is mounted. One ping each way, by design. My reading missed the surface, and #6081 would have added a second ping on top of it. What I actually observe on my install is different and I will file it separately with a precise repro once I have one without my own patch in the way: with post-processing agents on, the surface's ping comes when the agents finish (the message leaves `postProcessingPending`), not when the text finishes — and a held rewrite that never lands means no ping at all. Closing this as not a bug as stated. #6081 is closed too.
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#3371
No description provided.