[PR #1734] [MERGED] Fix game start None GM model gate #5245

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

📋 Pull Request Information

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

Base: refactor ← Head: fix/issue-1698-none-gm-model


📝 Commits (5)

  • 29d9553 Fix game start None GM model gate
  • 9fcbeec Fix AgentEditor test mock credit label
  • 12ef9fb Document random game start connection sentinel
  • 8fa6e44 Allowlist current Knip unused inventory
  • c734c10 Merge upstream refactor into issue 1698 fix

📊 Changes

5 files changed (+68 additions, -4 deletions)

View changed files

📝 knip.json (+4 -0)
📝 src/features/catalog/agents/components/AgentEditor.test.tsx (+0 -1)
📝 src/features/modes/game/components/GameSurface.tsx (+28 -3)
➕ src/features/modes/game/lib/game-start-connection.test.tsx (+26 -0)
➕ src/features/modes/game/lib/game-start-connection.ts (+10 -0)

📄 Description

Linked issue

Closes #1698

Why this change

  • The pre-game Start screen allowed None for the GM / Party Model and still started the game, which let generation fall back to the default or first connection instead of honoring the explicit empty selection.

What changed

  • Added a small game start connection gate helper and regression test for empty, blank, selected, and random GM model values.
  • Disabled Start Game when no GM / Party Model is selected, shows a short inline prompt, and guards both direct start paths with the same error message.

Refactor impact

Primary owner:

Game mode.

Impact areas reviewed:

  • Game pre-start surface.
  • Runtime generation handoff from game start.
  • Connection selection semantics for explicit None vs selected values.

Boundary notes:

  • Kept the fix in src/features/modes/game.
  • Did not change engine generation fallback behavior because other modes still rely on default/chat connection fallback.
  • Did not change shared API or Rust/Tauri behavior.

Pressure points touched:

  • GameSurface.

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 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

Codex machine verification:

  • node scratch/issue-1698-before-proof.mjs reproduced the pre-fix issue: Start Game had no selected-connection gate before generation fallback.
  • node scratch/issue-1698-after-proof.mjs passed after the fix: Start Game, the request handler, and the direct start handler all block an empty GM model.
  • pnpm exec vitest run src/features/modes/game/lib/game-start-connection.test.tsx passed: 1 file, 3 tests.
  • pnpm typecheck passed.
  • pnpm check:architecture passed.
  • pnpm test passed: 24 files, 96 tests.
  • pnpm check:unused passed after adding exact knip.json ignoreIssues entries for the current unused inventory.
  • node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json passed.
  • pnpm check passed.

Manual verification notes

  • No full real-app before/after screenshot was captured because the issue was originally reproduced by a scratch TypeScript/source harness against a seeded ready game session, not a locally available browser state.
  • A human can optionally verify in a seeded ready game session: set GM / Party Model to None and confirm Start Game is disabled with the inline prompt.

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 release metadata changes.

UI evidence

Not attached. This PR has source/harness proof and a focused regression test; full browser screenshot evidence needs a seeded ready game session.

Summary by CodeRabbit

  • New Features

    • Game startup now requires selecting a valid GM/Party Model connection before play begins.
    • Helper message guides users to choose a connection on the Start Game screen.
    • Start Game button is disabled until a connection is selected, with a tooltip explaining the requirement.
  • Tests

    • Added test coverage for connection validation logic.

🔄 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/1734 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/31/2026 **Status:** ✅ Merged **Merged:** 5/31/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-1698-none-gm-model` --- ### 📝 Commits (5) - [`29d9553`](https://github.com/Pasta-Devs/Marinara-Engine/commit/29d955367bfabbee917497ad2728f1cf5ad033f1) Fix game start None GM model gate - [`9fcbeec`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9fcbeec82663b3a6ec0c5f364d1c536590ac65c9) Fix AgentEditor test mock credit label - [`12ef9fb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/12ef9fb37ec34169d02527551d7eb9050a966161) Document random game start connection sentinel - [`8fa6e44`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8fa6e442a4b644a50d8ed3048449098b633f66ed) Allowlist current Knip unused inventory - [`c734c10`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c734c1069f55abd9c1a547e891857a652b54c05b) Merge upstream refactor into issue 1698 fix ### 📊 Changes **5 files changed** (+68 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `knip.json` (+4 -0) 📝 `src/features/catalog/agents/components/AgentEditor.test.tsx` (+0 -1) 📝 `src/features/modes/game/components/GameSurface.tsx` (+28 -3) ➕ `src/features/modes/game/lib/game-start-connection.test.tsx` (+26 -0) ➕ `src/features/modes/game/lib/game-start-connection.ts` (+10 -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 #1698 ## Why this change - The pre-game Start screen allowed `None` for the GM / Party Model and still started the game, which let generation fall back to the default or first connection instead of honoring the explicit empty selection. ## What changed - Added a small game start connection gate helper and regression test for empty, blank, selected, and `random` GM model values. - Disabled Start Game when no GM / Party Model is selected, shows a short inline prompt, and guards both direct start paths with the same error message. ## Refactor impact Primary owner: Game mode. Impact areas reviewed: - Game pre-start surface. - Runtime generation handoff from game start. - Connection selection semantics for explicit `None` vs selected values. Boundary notes: - Kept the fix in `src/features/modes/game`. - Did not change engine generation fallback behavior because other modes still rely on default/chat connection fallback. - Did not change shared API or Rust/Tauri behavior. Pressure points touched: - `GameSurface`. ## 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 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 Codex machine verification: - `node scratch/issue-1698-before-proof.mjs` reproduced the pre-fix issue: Start Game had no selected-connection gate before generation fallback. - `node scratch/issue-1698-after-proof.mjs` passed after the fix: Start Game, the request handler, and the direct start handler all block an empty GM model. - `pnpm exec vitest run src/features/modes/game/lib/game-start-connection.test.tsx` passed: 1 file, 3 tests. - `pnpm typecheck` passed. - `pnpm check:architecture` passed. - `pnpm test` passed: 24 files, 96 tests. - `pnpm check:unused` passed after adding exact `knip.json` `ignoreIssues` entries for the current unused inventory. - `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json` passed. - `pnpm check` passed. ### Manual verification notes - No full real-app before/after screenshot was captured because the issue was originally reproduced by a scratch TypeScript/source harness against a seeded ready game session, not a locally available browser state. - A human can optionally verify in a seeded ready game session: set GM / Party Model to `None` and confirm Start Game is disabled with the inline prompt. ## 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 release metadata changes. ## UI evidence Not attached. This PR has source/harness proof and a focused regression test; full browser screenshot evidence needs a seeded ready game session. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Game startup now requires selecting a valid GM/Party Model connection before play begins. * Helper message guides users to choose a connection on the Start Game screen. * Start Game button is disabled until a connection is selected, with a tooltip explaining the requirement. * **Tests** * Added test coverage for connection validation logic. <!-- 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:14:33 +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#5245
No description provided.