[PR #946] [MERGED] Fix game start provider error retry state #4851

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

📋 Pull Request Information

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

Base: staging ← Head: fix/game-linkapi-error-state


📝 Commits (2)

  • 1a0044b Fix game start provider error retry state
  • c647915 Normalize LinkAPI Gemini API host

📊 Changes

4 files changed (+38 additions, -14 deletions)

View changed files

➕ docs/pr-evidence/game-linkapi-error-state/after.png (+0 -0)
➕ docs/pr-evidence/game-linkapi-error-state/before.png (+0 -0)
📝 packages/client/src/components/game/GameSurface.tsx (+23 -13)
📝 packages/server/src/services/llm/providers/google.provider.ts (+15 -1)

📄 Description

Linked issue

No GitHub issue yet. Reported by Celia via Codex screenshot/chat; an issue can be opened before final maintainer submission if the team wants one.

Why this change

  • Game Mode initial generation could fail with a provider/DNS error like getaddrinfo EAI_AGAIN linkapi.ai, but the start screen kept showing the "The adventure begins..." spinner next to Retry. That made a stopped generation look like it was still running.
  • The failing hostname also pointed at LinkAPI's main/console host (linkapi.ai). LinkAPI's current docs list the Gemini API endpoint as https://api.linkapi.ai, so Marinara should normalize that common pasted host before making Gemini provider requests.

What changed

  • Clear the start-game request/guard state when the generation pipeline emits an error for the active game chat.
  • Show an explicit first-turn failure message on the Start Game screen when no playable GM content was produced.
  • Keep Retry and the GM / Party Model selector available so users can retry or switch providers.
  • Normalize LinkAPI console hosts (linkapi.ai, www.linkapi.ai, home.linkapi.ai) to api.linkapi.ai in the Google Gemini provider before appending /v1beta.

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 browser repro before fix: seeded a ready Game Mode chat, intercepted /api/generate with getaddrinfo EAI_AGAIN linkapi.ai, and confirmed the UI showed both "The adventure begins..." and Retry.
  • Codex browser verification after fix: reran the same flow and confirmed the spinner was gone, a recoverable failure message was shown, and Retry stayed visible.
  • Codex browser edge case: after the failure state, changed the GM / Party Model selector to a backup provider and confirmed the chat connectionId persisted.
  • Codex provider proof: packages\server\node_modules\.bin\tsx.cmd scratch\linkapi-google-url-proof.mjs confirmed https://linkapi.ai becomes https://api.linkapi.ai/v1beta/models/gemini-3-flash-preview-r:generateContent.
  • Codex baseline: pnpm check passed.
  • Bunny review: passed for the current diff after the LinkAPI host follow-up.

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, schema, dependency, release, or version files changed.

UI evidence (if applicable)

Before:

Before: provider error left intro spinner visible with Retry

After:

After: provider error shows retry guidance without spinner


🔄 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/946 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/17/2026 **Status:** ✅ Merged **Merged:** 5/17/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `staging` ← **Head:** `fix/game-linkapi-error-state` --- ### 📝 Commits (2) - [`1a0044b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1a0044b7d33e55d21f3290f39a956a469ae3c28a) Fix game start provider error retry state - [`c647915`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c647915bed8098e50218fc61f12b5364edadb27b) Normalize LinkAPI Gemini API host ### 📊 Changes **4 files changed** (+38 additions, -14 deletions) <details> <summary>View changed files</summary> ➕ `docs/pr-evidence/game-linkapi-error-state/after.png` (+0 -0) ➕ `docs/pr-evidence/game-linkapi-error-state/before.png` (+0 -0) 📝 `packages/client/src/components/game/GameSurface.tsx` (+23 -13) 📝 `packages/server/src/services/llm/providers/google.provider.ts` (+15 -1) </details> ### 📄 Description <!-- Target branch: `staging`. The default base in this UI is `main` (release branch). --> <!-- Change the base to `staging` before submitting unless this is a maintainer-approved mainline change. --> <!-- See CONTRIBUTING.md § Branches. --> ## 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 --> No GitHub issue yet. Reported by Celia via Codex screenshot/chat; an issue can be opened before final maintainer submission if the team wants one. ## Why this change <!-- What user problem, bug, or goal does this solve? --> - Game Mode initial generation could fail with a provider/DNS error like `getaddrinfo EAI_AGAIN linkapi.ai`, but the start screen kept showing the "The adventure begins..." spinner next to Retry. That made a stopped generation look like it was still running. - The failing hostname also pointed at LinkAPI's main/console host (`linkapi.ai`). LinkAPI's current docs list the Gemini API endpoint as `https://api.linkapi.ai`, so Marinara should normalize that common pasted host before making Gemini provider requests. ## What changed <!-- List the key changes in this PR --> - Clear the start-game request/guard state when the generation pipeline emits an error for the active game chat. - Show an explicit first-turn failure message on the Start Game screen when no playable GM content was produced. - Keep Retry and the GM / Party Model selector available so users can retry or switch providers. - Normalize LinkAPI console hosts (`linkapi.ai`, `www.linkapi.ai`, `home.linkapi.ai`) to `api.linkapi.ai` in the Google Gemini provider before appending `/v1beta`. ## 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 browser repro before fix: seeded a ready Game Mode chat, intercepted `/api/generate` with `getaddrinfo EAI_AGAIN linkapi.ai`, and confirmed the UI showed both "The adventure begins..." and Retry. - Codex browser verification after fix: reran the same flow and confirmed the spinner was gone, a recoverable failure message was shown, and Retry stayed visible. - Codex browser edge case: after the failure state, changed the GM / Party Model selector to a backup provider and confirmed the chat `connectionId` persisted. - Codex provider proof: `packages\server\node_modules\.bin\tsx.cmd scratch\linkapi-google-url-proof.mjs` confirmed `https://linkapi.ai` becomes `https://api.linkapi.ai/v1beta/models/gemini-3-flash-preview-r:generateContent`. - Codex baseline: `pnpm check` passed. - Bunny review: passed for the current diff after the LinkAPI host follow-up. ## 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, schema, dependency, release, or version files changed. ## UI evidence (if applicable) <!-- Add before/after screenshots or recordings for UI changes --> Before: ![Before: provider error left intro spinner visible with Retry](https://raw.githubusercontent.com/cha1latte/Marinara-Engine/c647915bed8098e50218fc61f12b5364edadb27b/docs/pr-evidence/game-linkapi-error-state/before.png) After: ![After: provider error shows retry guidance without spinner](https://raw.githubusercontent.com/cha1latte/Marinara-Engine/c647915bed8098e50218fc61f12b5364edadb27b/docs/pr-evidence/game-linkapi-error-state/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:11: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#4851
No description provided.