[PR #2085] [MERGED] Fix remote runtime new-chat readiness #5427

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

📋 Pull Request Information

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

Base: refactor ← Head: fix/issue-2061-remote-new-chat-health


📝 Commits (2)

  • aec840e Fix remote runtime new-chat readiness
  • c4b621a Handle remote health probe rejection

📊 Changes

3 files changed (+127 additions, -17 deletions)

View changed files

📝 src/app/shell/useStartNewChat.ts (+32 -7)
📝 src/features/catalog/chat-presets/hooks/use-chat-presets.ts (+2 -1)
📝 src/features/modes/shared/chat-ui/components/NewChatConnectionGate.tsx (+93 -9)

📄 Description

Linked issue

Closes #2061

Why this change

  • Web-shell new chat entrypoints treated a configured Remote Runtime URL as ready, then fell through to connection setup when the runtime was invalid or unreachable.
  • Users starting conversation, roleplay, or game chats now see the same Remote Runtime readiness failure class used by startup and Settings before connection setup is entered.

What changed

  • useStartNewChat now checks checkRemoteRuntimeHealth before fetching connections in web-shell mode, and opens the setup gate instead of letting remote storage failures reject silently.
  • NewChatConnectionGate now blocks connection and preset queries until remote readiness succeeds, shows checking/unavailable states, and routes failures to Advanced Settings.
  • useChatPresets accepts an optional enabled flag so this setup gate can delay preset storage reads without changing existing callers.

Refactor impact

Primary owner:

  • App shell / shared mode UI / remote runtime

Impact areas reviewed:

  • Sidebar new-chat flow for conversation, roleplay, and game
  • Home quick-start setup gate
  • Remote Runtime health contract and storage-backed connection/preset reads

Boundary notes:

  • React UI remains in src/app and src/features.
  • The fix reuses the focused src/shared/api/remote-runtime wrapper; it does not change engine code, raw remote fetch routing, Rust commands, storage schema, or remote command semantics.

Pressure points touched:

  • src/app/shell/useStartNewChat.ts
  • src/features/modes/shared/chat-ui/components/NewChatConnectionGate.tsx

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

  • Scratch repro before fix: pnpm exec vitest run --dir scratch --config vite.config.ts --environment jsdom failed because the gate showed No connections found instead of Remote runtime is unreachable.
  • Scratch repro after fix: pnpm exec vitest run --dir scratch --config vite.config.ts --environment jsdom passed and asserted the gate checks /health before storage-backed setup queries.
  • Browser proof before fix: Playwright against detached origin/refactor showed No connections found for the same bad Remote Runtime URL.
  • Browser proof after fix: Playwright against this branch showed Remote Runtime unavailable, Remote runtime is unreachable., and Open Advanced Settings.
  • Full baseline: pnpm check passed locally.
  • Workflow tooling note: .agents/automation/scripts/workflow-health.mjs and C:/Users/celia/.codex/tools/marinara-proof-gate.mjs were not present in this checkout/environment.

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 changes the new-chat failure state for an existing Remote Runtime setup path.

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

Local proof captured:

  • scratch/issue-2061-before.png
  • scratch/issue-2061-after.png

These local screenshots should be uploaded/attached as GitHub-hosted image URLs before marking the draft ready for review.


🔄 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/2085 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/3/2026 **Status:** ✅ Merged **Merged:** 6/3/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-2061-remote-new-chat-health` --- ### 📝 Commits (2) - [`aec840e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/aec840eee84b071ef8464ca812e42245052f8129) Fix remote runtime new-chat readiness - [`c4b621a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c4b621a5bd94ebd6eae41c9214c2bd741a1e7330) Handle remote health probe rejection ### 📊 Changes **3 files changed** (+127 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `src/app/shell/useStartNewChat.ts` (+32 -7) 📝 `src/features/catalog/chat-presets/hooks/use-chat-presets.ts` (+2 -1) 📝 `src/features/modes/shared/chat-ui/components/NewChatConnectionGate.tsx` (+93 -9) </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 #2061 ## Why this change - Web-shell new chat entrypoints treated a configured Remote Runtime URL as ready, then fell through to connection setup when the runtime was invalid or unreachable. - Users starting conversation, roleplay, or game chats now see the same Remote Runtime readiness failure class used by startup and Settings before connection setup is entered. ## What changed - `useStartNewChat` now checks `checkRemoteRuntimeHealth` before fetching connections in web-shell mode, and opens the setup gate instead of letting remote storage failures reject silently. - `NewChatConnectionGate` now blocks connection and preset queries until remote readiness succeeds, shows checking/unavailable states, and routes failures to Advanced Settings. - `useChatPresets` accepts an optional `enabled` flag so this setup gate can delay preset storage reads without changing existing callers. ## Refactor impact Primary owner: - App shell / shared mode UI / remote runtime Impact areas reviewed: - Sidebar new-chat flow for conversation, roleplay, and game - Home quick-start setup gate - Remote Runtime health contract and storage-backed connection/preset reads Boundary notes: - React UI remains in `src/app` and `src/features`. - The fix reuses the focused `src/shared/api/remote-runtime` wrapper; it does not change engine code, raw remote fetch routing, Rust commands, storage schema, or remote command semantics. Pressure points touched: - `src/app/shell/useStartNewChat.ts` - `src/features/modes/shared/chat-ui/components/NewChatConnectionGate.tsx` ## 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 - Scratch repro before fix: `pnpm exec vitest run --dir scratch --config vite.config.ts --environment jsdom` failed because the gate showed `No connections found` instead of `Remote runtime is unreachable.` - Scratch repro after fix: `pnpm exec vitest run --dir scratch --config vite.config.ts --environment jsdom` passed and asserted the gate checks `/health` before storage-backed setup queries. - Browser proof before fix: Playwright against detached `origin/refactor` showed `No connections found` for the same bad Remote Runtime URL. - Browser proof after fix: Playwright against this branch showed `Remote Runtime unavailable`, `Remote runtime is unreachable.`, and `Open Advanced Settings`. - Full baseline: `pnpm check` passed locally. - Workflow tooling note: `.agents/automation/scripts/workflow-health.mjs` and `C:/Users/celia/.codex/tools/marinara-proof-gate.mjs` were not present in this checkout/environment. ## 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 changes the new-chat failure state for an existing Remote Runtime setup path. ## 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 Local proof captured: - `scratch/issue-2061-before.png` - `scratch/issue-2061-after.png` These local screenshots should be uploaded/attached as GitHub-hosted image URLs before marking the draft ready for review. --- <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:13 +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#5427
No description provided.