[PR #1826] [MERGED] Fix generation runtime parity gaps #5298

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1826
Author: @Xelvanis
Created: 6/1/2026
Status: ✅ Merged
Merged: 6/1/2026
Merged by: @Xelvanis

Base: refactor ← Head: issue-1799-generation-parity


📝 Commits (2)

  • b606a86 Fix generation runtime parity gaps
  • 48ba4b6 Address generation review findings

📊 Changes

4 files changed (+517 additions, -20 deletions)

View changed files

📝 src/engine/generation/generation-events.ts (+4 -0)
➕ src/engine/generation/persona-snapshot.ts (+89 -0)
📝 src/engine/generation/start-generation.ts (+280 -12)
📝 src/features/runtime/generation/hooks/use-generate.ts (+144 -8)

📄 Description

Linked issue

Closes #1799

Why this change

  • Runtime generation had parity gaps in the user-message and multi-character response paths.
  • Generated user messages did not keep persona snapshots, so message projection could lose user persona context.
  • Conversation availability states were resolved in engine code but not surfaced as delayed, typing, or offline UI events.
  • Individual roleplay group turns collapsed to one target instead of iterating the selected characters.

What changed

  • Added a shared persona snapshot resolver and attach snapshots to optimistic and persisted generated user messages.
  • Wired conversation availability into generation events for delayed, typing, and offline states.
  • Restored individual group-turn orchestration so eligible characters run one turn each while saving the user message once.
  • Updated runtime generation UI handling so group turns, availability events, and saved user-message echoes do not prematurely end streaming UI.

Refactor impact

Primary owner:

runtime generation / engine generation

Impact areas reviewed:

  • Chat message projection and optimistic message insertion.
  • Conversation availability and busy-delay scheduling.
  • Roleplay individual group-turn target selection and event sequencing.
  • Runtime generation hook buffering, cache updates, and foreground streaming state.

Boundary notes:

  • Engine generation stays React-free and uses existing storage/runtime contracts.
  • Feature UI reads persona/chat cache state and calls focused engine helpers; no raw Tauri or remote-runtime calls were added.
  • Conversation, roleplay, and group-turn ownership stayed inside existing generation surfaces.

Pressure points touched:

  • Runtime generation hook streaming state and cached message upserts.
  • startGeneration event order for user messages, availability, and group turns.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • pnpm check passes locally before PR push/handoff, including the unused-code check
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Browser screenshot/recording evidence added when UI/browser state is the claim
  • Remote runtime smoke checked when relevant

Manual verification notes

Automated local validation run:

  • pnpm check
  • pnpm vitest run --config scratch/vitest.issue-1799.config.ts
  • pnpm exec prettier --check src/engine/generation/persona-snapshot.ts src/engine/generation/start-generation.ts src/engine/generation/generation-events.ts src/features/runtime/generation/hooks/use-generate.ts
  • git diff --cached --check

No browser or native Tauri manual QA was run.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • Existing generation behavior fix; no new discoverable feature or entry point.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

No docs or changelog update was made because this fixes existing runtime behavior without adding a new documented workflow.

UI evidence

N/A. This changes generation event wiring and runtime state handling, not visual layout.

Summary by CodeRabbit

Release Notes

  • New Features
    • Added new event types for generation streaming: typing indicators, delayed message states, offline status, and group turn tracking
    • Enhanced persona awareness in chat messages with automatic character snapshot capture
    • Improved roleplay group chat functionality with individual character turn management and smart character selection
    • Added real-time conversation availability detection with offline, delayed, and typing status indicators

🔄 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/1826 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 6/1/2026 **Status:** ✅ Merged **Merged:** 6/1/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `issue-1799-generation-parity` --- ### 📝 Commits (2) - [`b606a86`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b606a8672be5e6618fc42a31ec45dba7275ad28f) Fix generation runtime parity gaps - [`48ba4b6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/48ba4b6ddfec4de1d8144079a0d91797b573d3fd) Address generation review findings ### 📊 Changes **4 files changed** (+517 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `src/engine/generation/generation-events.ts` (+4 -0) ➕ `src/engine/generation/persona-snapshot.ts` (+89 -0) 📝 `src/engine/generation/start-generation.ts` (+280 -12) 📝 `src/features/runtime/generation/hooks/use-generate.ts` (+144 -8) </details> ### 📄 Description ## Linked issue Closes #1799 ## Why this change - Runtime generation had parity gaps in the user-message and multi-character response paths. - Generated user messages did not keep persona snapshots, so message projection could lose user persona context. - Conversation availability states were resolved in engine code but not surfaced as delayed, typing, or offline UI events. - Individual roleplay group turns collapsed to one target instead of iterating the selected characters. ## What changed - Added a shared persona snapshot resolver and attach snapshots to optimistic and persisted generated user messages. - Wired conversation availability into generation events for delayed, typing, and offline states. - Restored individual group-turn orchestration so eligible characters run one turn each while saving the user message once. - Updated runtime generation UI handling so group turns, availability events, and saved user-message echoes do not prematurely end streaming UI. ## Refactor impact Primary owner: runtime generation / engine generation Impact areas reviewed: - Chat message projection and optimistic message insertion. - Conversation availability and busy-delay scheduling. - Roleplay individual group-turn target selection and event sequencing. - Runtime generation hook buffering, cache updates, and foreground streaming state. Boundary notes: - Engine generation stays React-free and uses existing storage/runtime contracts. - Feature UI reads persona/chat cache state and calls focused engine helpers; no raw Tauri or remote-runtime calls were added. - Conversation, roleplay, and group-turn ownership stayed inside existing generation surfaces. Pressure points touched: - Runtime generation hook streaming state and cached message upserts. - `startGeneration` event order for user messages, availability, and group turns. ## Validation - [x] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [x] `pnpm check` passes locally before PR push/handoff, including the unused-code check - [ ] `pnpm typecheck` passes locally - [ ] `pnpm build` passes locally - [ ] `pnpm check:architecture` passes locally - [ ] `pnpm check:docs` passes locally - [ ] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Browser screenshot/recording evidence added when UI/browser state is the claim - [ ] Remote runtime smoke checked when relevant ### Manual verification notes Automated local validation run: - `pnpm check` - `pnpm vitest run --config scratch/vitest.issue-1799.config.ts` - `pnpm exec prettier --check src/engine/generation/persona-snapshot.ts src/engine/generation/start-generation.ts src/engine/generation/generation-events.ts src/features/runtime/generation/hooks/use-generate.ts` - `git diff --cached --check` No browser or native Tauri manual QA was run. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [x] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - Existing generation behavior fix; no new discoverable feature or entry point. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [x] Confirmed this PR does not restore old staging/package-workspace/release claims No docs or changelog update was made because this fixes existing runtime behavior without adding a new documented workflow. ## UI evidence N/A. This changes generation event wiring and runtime state handling, not visual layout. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Added new event types for generation streaming: typing indicators, delayed message states, offline status, and group turn tracking * Enhanced persona awareness in chat messages with automatic character snapshot capture * Improved roleplay group chat functionality with individual character turn management and smart character selection * Added real-time conversation availability detection with offline, delayed, and typing status indicators <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:15:01 +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#5298
No description provided.