[PR #650] [MERGED] Fix CYOA choices live update #4711

Closed
opened 2026-10-22 04:10:02 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/650
Author: @cha1latte
Created: 5/10/2026
Status: ✅ Merged
Merged: 5/10/2026
Merged by: @cha1latte

Base: main ← Head: fix/issue-649-cyoa-live-choices


📝 Commits (3)

  • 1f873b1 Fix CYOA choices live update
  • 38b1452 Clear empty CYOA reroll results
  • 9e1f1ba Preserve CYOA choices while messages load

📊 Changes

5 files changed (+62 additions, -15 deletions)

View changed files

➕ docs/pr-evidence/issue-649-after.png (+0 -0)
➕ docs/pr-evidence/issue-649-before.png (+0 -0)
📝 packages/client/src/components/chat/CyoaChoices.tsx (+54 -10)
📝 packages/client/src/hooks/use-generate.ts (+2 -2)
📝 packages/client/src/stores/agent.store.ts (+6 -3)

📄 Description

Linked issue

Closes #649

Why this change

  • CYOA Choices agent results were persisted to the assistant message, but the active roleplay UI could clear the live choices after streaming ended, so users had to refresh the page before the choices appeared.

What changed

  • Track which chat the live CYOA choice store belongs to.
  • Tag live CYOA results from normal generation and CYOA re-rolls with the chat id that produced them.
  • Preserve same-chat live choices across the post-stream CyoaChoices remount instead of clearing them from stale message props.

Validation

  • 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

  • Codex reproduced the post-stream remount failure with a focused browser harness: live SSE choices existed before the message cache had the persisted extra.cyoaChoices, but the UI displayed no choices.
  • Codex reran the same harness after the fix: live CYOA choices appeared immediately without waiting for the simulated persisted message refetch.
  • Codex ran focused store edge cases: live choices are tagged with a chat id, clearing choices clears ownership, and resetting the agent store clears ownership.
  • Codex ran pnpm check, which passed (impeccable:check, lint, shared/server/client build).
  • No human-only verification blockers remain for the core claim.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

No docs, release metadata, schema, storage, dependency, or version files changed.

UI evidence (if applicable)

Before, the same post-stream remount sequence had no visible choices:

Before: live CYOA choices missing

After, choices appear live without refresh:

After: live CYOA choices visible


🔄 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/650 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/10/2026 **Status:** ✅ Merged **Merged:** 5/10/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `main` ← **Head:** `fix/issue-649-cyoa-live-choices` --- ### 📝 Commits (3) - [`1f873b1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1f873b1e7e99debd425375d129698af47411d187) Fix CYOA choices live update - [`38b1452`](https://github.com/Pasta-Devs/Marinara-Engine/commit/38b1452d6bcab9137800485eb4cf0b85dba416e8) Clear empty CYOA reroll results - [`9e1f1ba`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9e1f1baf445005adbf465f0176c779071259b5b5) Preserve CYOA choices while messages load ### 📊 Changes **5 files changed** (+62 additions, -15 deletions) <details> <summary>View changed files</summary> ➕ `docs/pr-evidence/issue-649-after.png` (+0 -0) ➕ `docs/pr-evidence/issue-649-before.png` (+0 -0) 📝 `packages/client/src/components/chat/CyoaChoices.tsx` (+54 -10) 📝 `packages/client/src/hooks/use-generate.ts` (+2 -2) 📝 `packages/client/src/stores/agent.store.ts` (+6 -3) </details> ### 📄 Description ## Linked issue <!-- Every PR should reference a feature request or issue report. If there isn't one yet, open one first to gather opinions: --> <!-- https://github.com/Pasta-Devs/Marinara-Engine/issues/new/choose --> Closes #649 ## Why this change <!-- What user problem, bug, or goal does this solve? --> - CYOA Choices agent results were persisted to the assistant message, but the active roleplay UI could clear the live choices after streaming ended, so users had to refresh the page before the choices appeared. ## What changed <!-- List the key changes in this PR --> - Track which chat the live CYOA choice store belongs to. - Tag live CYOA results from normal generation and CYOA re-rolls with the chat id that produced them. - Preserve same-chat live choices across the post-stream `CyoaChoices` remount instead of clearing them from stale message props. ## Validation <!-- Required: include commands run and/or manual checks performed --> - [ ] `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 <!-- Describe exactly what you tested in a real browser/app, step by step. --> <!-- ⚠️ If an AI agent filled out or ticked these boxes for you, treat them --> <!-- as a TO-DO LIST, not as proof the work is done. Verify each item yourself --> <!-- before submitting. If you haven't verified it, untick the box. --> - Codex reproduced the post-stream remount failure with a focused browser harness: live SSE choices existed before the message cache had the persisted `extra.cyoaChoices`, but the UI displayed no choices. - Codex reran the same harness after the fix: live CYOA choices appeared immediately without waiting for the simulated persisted message refetch. - Codex ran focused store edge cases: live choices are tagged with a chat id, clearing choices clears ownership, and resetting the agent store clears ownership. - Codex ran `pnpm check`, which passed (`impeccable:check`, lint, shared/server/client build). - No human-only verification blockers remain for the core claim. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) No docs, release metadata, schema, storage, dependency, or version files changed. ## UI evidence (if applicable) <!-- Add before/after screenshots or recordings for UI changes --> Before, the same post-stream remount sequence had no visible choices: ![Before: live CYOA choices missing](https://raw.githubusercontent.com/cha1latte/Marinara-Engine/9e1f1baf445005adbf465f0176c779071259b5b5/docs/pr-evidence/issue-649-before.png) After, choices appear live without refresh: ![After: live CYOA choices visible](https://raw.githubusercontent.com/cha1latte/Marinara-Engine/9e1f1baf445005adbf465f0176c779071259b5b5/docs/pr-evidence/issue-649-after.png) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:10:02 +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#4711
No description provided.