[PR #2221] [MERGED] Fix game generation failure retry event #5484

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2221
Author: @cha1latte
Created: 6/4/2026
Status: ✅ Merged
Merged: 6/4/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/issue-2141-generation-error


📝 Commits (3)

  • 48be3f4 Fix game generation failure retry event
  • 3c10473 Remove duplicate lorebook atomic row aliases
  • 7f37463 Refresh discovery PR body check

📊 Changes

2 files changed (+9 additions, -4 deletions)

View changed files

📝 src-tauri/src/commands/storage/commands/entities.rs (+0 -4)
📝 src/features/runtime/generation/hooks/use-generate.ts (+9 -0)

📄 Description

Linked issue

Closes #2141

Why this change

  • Failed game GM generations only showed a toast in the refactor branch, even though GameSurface still had the inline Retry UI wired to marinara:generation-error.

What changed

  • Dispatch marinara:generation-error from the shared generation failure path for non-aborted errors.
  • Include the failing chatId and error message in the event detail so the existing GameSurface listener can gate the inline Retry state to the active chat.
  • Keep abort/cancel paths quiet so user-initiated cancellation does not show a retry failure affordance.
  • Remove duplicate lorebook atomic row type aliases that were breaking the current refactor Rust check baseline.

Refactor impact

Primary owner:

game mode, runtime generation

Impact areas reviewed:

  • GameSurface already listens for marinara:generation-error and sets generationFailed only for the active chat.
  • runGenerationWithUi handles the non-abort generation failure path and still shows the existing toast.
  • Abort failures remain excluded from the retry event.
  • Rust storage command aliases were reviewed only enough to remove duplicate definitions; behavior is unchanged.

Boundary notes:

  • The user-facing fix stays in src/features/runtime/generation; no engine, shared API, storage behavior, prompt, import/export, or remote-runtime contracts changed. The Rust edit is a mechanical duplicate-alias removal to restore the refactor baseline.

Pressure points touched:

  • src/features/runtime/generation/hooks/use-generate.ts
  • src-tauri/src/commands/storage/commands/entities.rs
  • Reviewed existing GameSurface retry listener; no UI patch was needed.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • pnpm exec vitest run --config scratch/vitest.issue2141.config.ts scratch/issue-2141-generation-error.test.ts passed with 2 tests: provider failure dispatches marinara:generation-error; AbortError does not dispatch it.
  • pnpm typecheck passed.
  • git diff --check passed.
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passed.
  • pnpm check passed after removing duplicate lorebook atomic row type aliases that were already present on origin/refactor.

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:

  • Bugfix only. It restores an existing GameSurface retry affordance by reconnecting the existing generation failure event.

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

UI evidence

N/A for screenshots. The UI listener already existed; the production change restores the DOM event that drives it. The scratch jsdom proof exercises the event contract directly.


🔄 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/2221 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/4/2026 **Status:** ✅ Merged **Merged:** 6/4/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-2141-generation-error` --- ### 📝 Commits (3) - [`48be3f4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/48be3f46d35e21d3dc0b9cc76f31aaba7baae794) Fix game generation failure retry event - [`3c10473`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3c10473cf64fb8fb144a8b2768cca8fbadef57e0) Remove duplicate lorebook atomic row aliases - [`7f37463`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7f374638a3b6912d4c1e5d7355e7ce1672901de0) Refresh discovery PR body check ### 📊 Changes **2 files changed** (+9 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/commands/entities.rs` (+0 -4) 📝 `src/features/runtime/generation/hooks/use-generate.ts` (+9 -0) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue Closes #2141 ## Why this change - Failed game GM generations only showed a toast in the refactor branch, even though `GameSurface` still had the inline Retry UI wired to `marinara:generation-error`. ## What changed - Dispatch `marinara:generation-error` from the shared generation failure path for non-aborted errors. - Include the failing `chatId` and error message in the event detail so the existing GameSurface listener can gate the inline Retry state to the active chat. - Keep abort/cancel paths quiet so user-initiated cancellation does not show a retry failure affordance. - Remove duplicate lorebook atomic row type aliases that were breaking the current `refactor` Rust check baseline. ## Refactor impact Primary owner: game mode, runtime generation Impact areas reviewed: - `GameSurface` already listens for `marinara:generation-error` and sets `generationFailed` only for the active chat. - `runGenerationWithUi` handles the non-abort generation failure path and still shows the existing toast. - Abort failures remain excluded from the retry event. - Rust storage command aliases were reviewed only enough to remove duplicate definitions; behavior is unchanged. Boundary notes: - The user-facing fix stays in `src/features/runtime/generation`; no engine, shared API, storage behavior, prompt, import/export, or remote-runtime contracts changed. The Rust edit is a mechanical duplicate-alias removal to restore the `refactor` baseline. Pressure points touched: - `src/features/runtime/generation/hooks/use-generate.ts` - `src-tauri/src/commands/storage/commands/entities.rs` - Reviewed existing `GameSurface` retry listener; no UI patch was needed. ## Validation <!-- Check only what you personally ran or manually verified. Treat unchecked items as explicit TODOs. --> <!-- Do not submit *.test.ts or *.test.tsx files as PR proof; cite existing checks, command output, app/browser/Tauri verification, or manual notes instead. --> - [ ] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [ ] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - `pnpm exec vitest run --config scratch/vitest.issue2141.config.ts scratch/issue-2141-generation-error.test.ts` passed with 2 tests: provider failure dispatches `marinara:generation-error`; `AbortError` does not dispatch it. - `pnpm typecheck` passed. - `git diff --check` passed. - `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passed. - `pnpm check` passed after removing duplicate lorebook atomic row type aliases that were already present on `origin/refactor`. ## 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: - Bugfix only. It restores an existing GameSurface retry affordance by reconnecting the existing generation failure event. ## 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 ## UI evidence N/A for screenshots. The UI listener already existed; the production change restores the DOM event that drives it. The scratch jsdom proof exercises the event contract directly. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:16:43 +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#5484
No description provided.