[PR #1731] fix(gacha-forge): voice player dialogue through persona assignments #1714

Open
opened 2026-10-27 06:06:08 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1731
Author: @SpicyMarinara
Created: 10/26/2026
Status: 🔄 Open

Base: staging ← Head: feat/gacha-persona-tts


📝 Commits (4)

  • 8b7d064 chore: start Gacha Forge persona speech for #1730
  • f3ece9a fix(gacha-forge): reuse persona voices for story and sent letters
  • f4737f7 fix(gacha-forge): bind speech to acknowledged message IDs
  • 8cbe6fd fix(gacha-forge): hold sends through failure recovery

📊 Changes

17 files changed (+1395 additions, -89 deletions)

View changed files

📝 .github/workflows/pull-request-checks.yml (+1 -0)
➕ artifacts/gacha-forge-1.24.1.zip (+0 -0)
📝 catalog/catalog.json (+8 -8)
📝 catalog/notes.json (+6 -6)
📝 catalog/v2/catalog.json (+8 -8)
📝 catalog/v2/notes.json (+6 -6)
📝 catalog/v3/catalog.json (+8 -8)
📝 catalog/v3/notes.json (+6 -6)
📝 packages/gacha-forge/CHANGELOG.md (+4 -0)
📝 packages/gacha-forge/README.md (+2 -0)
📝 packages/gacha-forge/bundle-patches.json (+80 -0)
📝 packages/gacha-forge/client.js (+130 -21)
📝 packages/gacha-forge/manifest.json (+5 -5)
📝 packages/gacha-forge/server.mjs (+2 -2)
📝 packages/gacha-forge/src/chat-continuity-client.mjs (+127 -18)
➕ tests/gacha-forge-persona-voices.regression.mjs (+738 -0)
📝 tests/package-gacha-forge-audio.e2e.ts (+264 -1)

📄 Description

Linked issue

Closes #1730

Why this change

Mari requested that personas use the existing Connections → Text-to-Speech assignments for both sent messages and generated persona dialogue. Engine support is merged in Pasta-Devs/Marinara-Engine#8370. Gacha Forge still dropped the existing persona ID from its story cast and had no voice path for sent character messages.

What changed

  • Project the protagonist’s existing persona ID into the same story-cast characterId used by character cards, so the existing audio controller can find its explicit voice.
  • Echo the existing canonical player-message ID in send responses, only after persistence succeeds. Success and known post-save failures acknowledge the same saved ID; retries, rejected sends and failed player writes do not invent one.
  • Read a newly confirmed player row only when its ID matches that exact send’s acknowledgement and its original chat window remains active. Text matching can recover visible history but cannot authorize speech. Ambiguous or lost-response recovery stays silent.
  • Queue readings in send order, reserve acknowledged IDs before recovering older rows, and retain normal rejection errors/drafts. Closing, changing contacts or ending a conversation cancels queued speech and invalidates late completions.
  • Hold the existing Send busy flag through failed-response reconciliation. Per-operation ownership prevents stale cleanup from clearing a newer Send or Close operation; navigation still releases the old operation safely. This closes the normal HUD-refresh/Enter path that could expose Send too early.
  • Reuse existing dialogue enable/mute/volume controls, the selected speech connection, shared TTS service and stable audio cache.
  • Rebuild Gacha Forge 1.24.1 and its artifact, manifest, catalog lanes and release notes. The Settings version readout now matches the manifest. Add the persona regression to CI.

Package and security impact

Only gacha-forge is affected. Existing client/server entrypoints, permissions, Engine compatibility (>=2.5.1 <4.0.0, Capability API 1.385), dependencies and storage lifecycle are unchanged.

No new persisted persona, voice, message or settings fields. playerMessageId is response metadata for an already-existing saved row. Voice-session tokens and attempt bookkeeping remain in memory and are not sent as request fields or stored in documents.

Validation

Tested head: 8cbe6fdbc94e30745b19dc20642f5b7dfc47d7ef. Committed source and artifact hashes match the validated bytes.

  • npm ci, npm run check, catalog lane routing, package locales, full catalog/archive validation, release-notes regression and git diff --check: passed. Existing repository lint warnings remain; zero errors.
  • Persona/SDK: 28/28 passed, including actual send-route identity after success/model failure/reply-write failure, absence before persistence, exact-ID attribution, ambiguous history silence, FIFO, same-text recovery, session cancellation and rejection draft preservation, native Vigor-refresh/Enter ordering and busy-operation cleanup after navigation.
  • Existing chat continuity: 21/21; audio: 26/26; dialogue cache: 1/1 passed.
  • Existing location/landscape/version regression passed after reproducing and fixing the Settings readout mismatch.
  • Official rebuild is byte-identical on repeat for both payloads, manifest, archive and all catalog lanes. The broad reversible-source/tamper rebuild regression also passed earlier on f3; its builder is unchanged.
  • Browser matrix: 18/18 passed across desktop Chromium, mobile Chromium and mobile WebKit, using the rebuilt archive in disposable Engine profiles and actual package SDK fixtures. Both synthesis requests and shared-service playback starts are counted, including cached-replay detection.
  • Final local CodeRabbit: completed with zero findings after the send-guard repair.

Review repairs

Dottore’s f3 full review identified two LOW reconciliation defects: an old same-text attempt could steal a new row, and failed-reply recovery could reverse speech order. Both were reproduced and repaired. CodeRabbit then exposed why voice-session priority was insufficient when only a late historical row existed; the repair now uses the server’s authoritative saved ID instead of guessing. The pre-build test-helper omission was also reproduced and fixed. Independent final identity review found no further defect. Its f473 Dottore re-review was Viable With Notes and explicitly passed both original contracts; those threads were resolved. The remaining timing question was then reproduced with the actual Vigor-refresh/template/Enter path: B could be admitted while A failure recovery awaited a read. The existing busy flag now spans that promise, with exact operation ownership protecting newer work. Independent guard review passed.

A successful send still stashes its acknowledged row synchronously before starting its history refresh; only failed reconciliation needs the extended hold. The native ordering and cleanup controls exercise this distinction.

The optional helper-naming suggestion is retained as a nonfunctional note: the small token accessor initializes its per-run state explicitly, and send/session controls cover that behavior.

Initial browser fixture navigation/readiness errors were corrected without removing assertions or increasing timeouts. Original failure logs and traces are retained. Local tests use synthetic speech and loopback model fixtures; physical-device and external-provider playback remain manual checks.

Manual verification tasks

  • Assign a real provider voice to a persona and listen to story dialogue and newly sent letters.
  • Verify audio permission and playback behavior on a physical iPhone and Android device.
  • Manually exercise Download Agents update, restart and uninstall controls with the published package.

Documentation impact

Package guidance and catalog/in-game version notes explain persona speech. Existing Engine Connections instructions apply. No Engine guide, community UI catalog or storage migration changes.


🔄 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-Agents/pull/1731 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/26/2026 **Status:** 🔄 Open **Base:** `staging` ← **Head:** `feat/gacha-persona-tts` --- ### 📝 Commits (4) - [`8b7d064`](https://github.com/Pasta-Devs/Marinara-Agents/commit/8b7d0649f27d4b6ee3d7a01ac3ab1dda61438ede) chore: start Gacha Forge persona speech for #1730 - [`f3ece9a`](https://github.com/Pasta-Devs/Marinara-Agents/commit/f3ece9a5d20022acaffdb981230f515c0d5f3286) fix(gacha-forge): reuse persona voices for story and sent letters - [`f4737f7`](https://github.com/Pasta-Devs/Marinara-Agents/commit/f4737f72cf55fef9192f1e663b3d84004ce41848) fix(gacha-forge): bind speech to acknowledged message IDs - [`8cbe6fd`](https://github.com/Pasta-Devs/Marinara-Agents/commit/8cbe6fdbc94e30745b19dc20642f5b7dfc47d7ef) fix(gacha-forge): hold sends through failure recovery ### 📊 Changes **17 files changed** (+1395 additions, -89 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/pull-request-checks.yml` (+1 -0) ➕ `artifacts/gacha-forge-1.24.1.zip` (+0 -0) 📝 `catalog/catalog.json` (+8 -8) 📝 `catalog/notes.json` (+6 -6) 📝 `catalog/v2/catalog.json` (+8 -8) 📝 `catalog/v2/notes.json` (+6 -6) 📝 `catalog/v3/catalog.json` (+8 -8) 📝 `catalog/v3/notes.json` (+6 -6) 📝 `packages/gacha-forge/CHANGELOG.md` (+4 -0) 📝 `packages/gacha-forge/README.md` (+2 -0) 📝 `packages/gacha-forge/bundle-patches.json` (+80 -0) 📝 `packages/gacha-forge/client.js` (+130 -21) 📝 `packages/gacha-forge/manifest.json` (+5 -5) 📝 `packages/gacha-forge/server.mjs` (+2 -2) 📝 `packages/gacha-forge/src/chat-continuity-client.mjs` (+127 -18) ➕ `tests/gacha-forge-persona-voices.regression.mjs` (+738 -0) 📝 `tests/package-gacha-forge-audio.e2e.ts` (+264 -1) </details> ### 📄 Description ## Linked issue Closes #1730 ## Why this change Mari requested that personas use the existing Connections → Text-to-Speech assignments for both sent messages and generated persona dialogue. Engine support is merged in Pasta-Devs/Marinara-Engine#8370. Gacha Forge still dropped the existing persona ID from its story cast and had no voice path for sent character messages. ## What changed - Project the protagonist’s existing persona ID into the same story-cast `characterId` used by character cards, so the existing audio controller can find its explicit voice. - Echo the existing canonical player-message ID in send responses, only after persistence succeeds. Success and known post-save failures acknowledge the same saved ID; retries, rejected sends and failed player writes do not invent one. - Read a newly confirmed player row only when its ID matches that exact send’s acknowledgement and its original chat window remains active. Text matching can recover visible history but cannot authorize speech. Ambiguous or lost-response recovery stays silent. - Queue readings in send order, reserve acknowledged IDs before recovering older rows, and retain normal rejection errors/drafts. Closing, changing contacts or ending a conversation cancels queued speech and invalidates late completions. - Hold the existing Send busy flag through failed-response reconciliation. Per-operation ownership prevents stale cleanup from clearing a newer Send or Close operation; navigation still releases the old operation safely. This closes the normal HUD-refresh/Enter path that could expose Send too early. - Reuse existing dialogue enable/mute/volume controls, the selected speech connection, shared TTS service and stable audio cache. - Rebuild Gacha Forge 1.24.1 and its artifact, manifest, catalog lanes and release notes. The Settings version readout now matches the manifest. Add the persona regression to CI. ## Package and security impact Only `gacha-forge` is affected. Existing client/server entrypoints, permissions, Engine compatibility (`>=2.5.1 <4.0.0`, Capability API 1.385), dependencies and storage lifecycle are unchanged. No new persisted persona, voice, message or settings fields. `playerMessageId` is response metadata for an already-existing saved row. Voice-session tokens and attempt bookkeeping remain in memory and are not sent as request fields or stored in documents. ## Validation Tested head: `8cbe6fdbc94e30745b19dc20642f5b7dfc47d7ef`. Committed source and artifact hashes match the validated bytes. - `npm ci`, `npm run check`, catalog lane routing, package locales, full catalog/archive validation, release-notes regression and `git diff --check`: passed. Existing repository lint warnings remain; zero errors. - Persona/SDK: 28/28 passed, including actual send-route identity after success/model failure/reply-write failure, absence before persistence, exact-ID attribution, ambiguous history silence, FIFO, same-text recovery, session cancellation and rejection draft preservation, native Vigor-refresh/Enter ordering and busy-operation cleanup after navigation. - Existing chat continuity: 21/21; audio: 26/26; dialogue cache: 1/1 passed. - Existing location/landscape/version regression passed after reproducing and fixing the Settings readout mismatch. - Official rebuild is byte-identical on repeat for both payloads, manifest, archive and all catalog lanes. The broad reversible-source/tamper rebuild regression also passed earlier on f3; its builder is unchanged. - Browser matrix: 18/18 passed across desktop Chromium, mobile Chromium and mobile WebKit, using the rebuilt archive in disposable Engine profiles and actual package SDK fixtures. Both synthesis requests and shared-service playback starts are counted, including cached-replay detection. - Final local CodeRabbit: completed with zero findings after the send-guard repair. ### Review repairs Dottore’s f3 full review identified two LOW reconciliation defects: an old same-text attempt could steal a new row, and failed-reply recovery could reverse speech order. Both were reproduced and repaired. CodeRabbit then exposed why voice-session priority was insufficient when only a late historical row existed; the repair now uses the server’s authoritative saved ID instead of guessing. The pre-build test-helper omission was also reproduced and fixed. Independent final identity review found no further defect. Its f473 Dottore re-review was Viable With Notes and explicitly passed both original contracts; those threads were resolved. The remaining timing question was then reproduced with the actual Vigor-refresh/template/Enter path: B could be admitted while A failure recovery awaited a read. The existing busy flag now spans that promise, with exact operation ownership protecting newer work. Independent guard review passed. A successful send still stashes its acknowledged row synchronously before starting its history refresh; only failed reconciliation needs the extended hold. The native ordering and cleanup controls exercise this distinction. The optional helper-naming suggestion is retained as a nonfunctional note: the small token accessor initializes its per-run state explicitly, and send/session controls cover that behavior. Initial browser fixture navigation/readiness errors were corrected without removing assertions or increasing timeouts. Original failure logs and traces are retained. Local tests use synthetic speech and loopback model fixtures; physical-device and external-provider playback remain manual checks. ### Manual verification tasks - [ ] Assign a real provider voice to a persona and listen to story dialogue and newly sent letters. - [ ] Verify audio permission and playback behavior on a physical iPhone and Android device. - [ ] Manually exercise Download Agents update, restart and uninstall controls with the published package. ## Documentation impact Package guidance and catalog/in-game version notes explain persona speech. Existing Engine Connections instructions apply. No Engine guide, community UI catalog or storage migration changes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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-Agents#1714
No description provided.