[PR #3230] [MERGED] [codex] Fix Game session start branch selection #5851

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/3230
Author: @SpicyMarinara
Created: 7/5/2026
Status: ✅ Merged
Merged: 7/5/2026
Merged by: @SpicyMarinara

Base: staging ← Head: codex/issue-3229-game-session-branch


📝 Commits (1)

  • 672d5d7 Fix game session branch selection

📊 Changes

4 files changed (+48 additions, -13 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 packages/client/src/components/game/GameSurface.tsx (+2 -2)
📝 packages/client/src/hooks/use-game.ts (+1 -1)
📝 packages/server/src/routes/game.routes.ts (+44 -10)

📄 Description

Summary

  • Use the active Game session as the explicit source when starting the next session.
  • Ignore backup/branch-labeled game chats when selecting the latest canonical session, with a fallback for older data.
  • Prevent new Game sessions from inheriting branchName metadata from the source session.
  • Update the v2.1.0 changelog entry for #3229.

Fixes #3229.

Root Cause

/game/session/start selected the latest game chat by session number only. Backup branches copy gameSessionNumber, gameSessionStatus, and branchName, so a backup branch with the same session number could be treated as the latest active session and returned instead of creating the next session.

Validation

  • pnpm --filter @marinara-engine/server lint
  • pnpm --filter @marinara-engine/client lint (passes with existing ConversationView.tsx missing dependency warning)
  • pnpm check (passes with the same existing warning and Vite chunk-size warning)

Manual Verification Needed

  • Manually verify a Game chat with backup branches creates or switches to the actual next session after completing the canonical session.
  • Manually verify starting from an already-created later session still returns that existing later session instead of duplicating it.

Summary by CodeRabbit

  • Bug Fixes

    • Starting a new game session now correctly uses the intended previous session when backup/branch sessions exist.
    • Branch labels and related session state no longer carry over incorrectly into newly created sessions.
  • New Features

    • Session creation now supports choosing a specific prior session as the starting point, improving continuity when resuming gameplay.

🔄 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/3230 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 7/5/2026 **Status:** ✅ Merged **Merged:** 7/5/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `codex/issue-3229-game-session-branch` --- ### 📝 Commits (1) - [`672d5d7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/672d5d71768fb2265d5918e3575fa980b16db86b) Fix game session branch selection ### 📊 Changes **4 files changed** (+48 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `packages/client/src/components/game/GameSurface.tsx` (+2 -2) 📝 `packages/client/src/hooks/use-game.ts` (+1 -1) 📝 `packages/server/src/routes/game.routes.ts` (+44 -10) </details> ### 📄 Description ## Summary - Use the active Game session as the explicit source when starting the next session. - Ignore backup/branch-labeled game chats when selecting the latest canonical session, with a fallback for older data. - Prevent new Game sessions from inheriting `branchName` metadata from the source session. - Update the v2.1.0 changelog entry for #3229. Fixes #3229. ## Root Cause `/game/session/start` selected the latest game chat by session number only. Backup branches copy `gameSessionNumber`, `gameSessionStatus`, and `branchName`, so a backup branch with the same session number could be treated as the latest active session and returned instead of creating the next session. ## Validation - `pnpm --filter @marinara-engine/server lint` - `pnpm --filter @marinara-engine/client lint` (passes with existing `ConversationView.tsx` missing dependency warning) - `pnpm check` (passes with the same existing warning and Vite chunk-size warning) ## Manual Verification Needed - Manually verify a Game chat with backup branches creates or switches to the actual next session after completing the canonical session. - Manually verify starting from an already-created later session still returns that existing later session instead of duplicating it. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Starting a new game session now correctly uses the intended previous session when backup/branch sessions exist. * Branch labels and related session state no longer carry over incorrectly into newly created sessions. * **New Features** * Session creation now supports choosing a specific prior session as the starting point, improving continuity when resuming gameplay. <!-- 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:20:11 +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#5851
No description provided.