mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2760] [Issue]: Game-mode AV cue alignment and minor playback/leak nits #1399
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1399
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kolacheee on GitHub (Jun 21, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2760
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Game-mode AV cue alignment plus a few playback/leak nits. The notable one is that the scene-analyzer indexes narration 'beats' by raw source newlines, a different index space than the client's actual segmentation, so per-beat sfx/background/cinematic effects fire on the wrong (or no) narration segment.
Sub-bug 1: Beat-index mismatch mis-fires AV cues (#70) [primary]
scene-analyzer.ts:204builds beats vianarration.split(/\r?\n/).filter(...)and tells the model to key segmentEffects to those indices (261, 347). The client (parseNarrationSegments) and server mirror collapse consecutive prose lines into one fallback segment and can also expand dialogue, so the analyzer's line indices don't match the segment indices the client applies effects to (onSegmentEnter(sourceSegmentIndex), applied via raw equality in GameSurface with no remap). Late-beat effects are dropped or land on the wrong segment on most multi-line turns; failure is silent.Sub-bug 2: Game-voice object-URL cache leak (#12)
gameVoiceCacheRefstoresURL.createObjectURLblobs per message-identity key with no size cap and no per-turn eviction; the activeIndex/streaming effects never delete entries. Only unmount revokes. Keys are message-id-addressed so they grow monotonically over a long autoplay session.Sub-bug 3: autoplay-block tag rollback desync (#13)
pendingMusic={newTag}but rollscurrentMusicTagback to the previous tag (732) while the store already holds the new tag. A laterplayMusic(previousTag)hits the dedup early-return (649) without clearing pendingMusic, so the stale retry can fire the wrong track on the next gesture.Sub-bug 4: scoreAmbient double-count (#71) [disputed]
STATE_AMBIENT[state], duplicating it with line 449 — but only in the no-location branch (the if/else is mutually exclusive). Real one-line redundancy; the candidate's 'location vs state bias' framing is false. Low.Sub-bug 5: Shared in-flight signal (#6) [disputed/timing]
Sub-bug 6: pause() retains element + URL (#9)
this.audio+this.currentObjectUrl; cleanup() (the only revoker) only runs on stop/next-speak/onended/onerror, none of which fire for a paused-and-abandoned clip. Bounded to one element/URL (singleton). Call stop() on chat-view teardown.Suggested Fix
currentMusicTagback on autoplay-block (keep the requested tag, rely on pendingMusic), or clear pendingMusic when the dedup early-return hits.Verification checklist (all manual)
pnpm checkAffected files
packages/server/src/services/sidecar/scene-analyzer.tspackages/client/src/components/game/GameNarration.tsxpackages/client/src/lib/game-audio.tspackages/client/src/lib/tts-service.tspackages/shared/src/utils/music-score.tsAudit provenance
Found by a multi-agent static audit of the TTS/voice + image-generation subsystems (Round 1 + round-2 gap sweep + completeness critic, each finding adversarially verified) against the merged
stagingtree. Severity: MEDIUM.@SpicyMarinara commented on GitHub (Jun 21, 2026):
Addressed on PR #2747. Fixed scene-analyzer beat indices by building canonical narration beats instead of raw non-empty lines, capped/revoked game voice cache entries, decoupled shared cached TTS creation from per-caller abort signals, kept autoplay-blocked music retry state aligned, removed duplicate ambient state keywords, and added a GameSurface TTS stop on chat/view teardown. Validation so far: git diff --check. Full pnpm checks are intentionally deferred until the issue sweep is complete.