[GH-ISSUE #1246] [Issue]: Refactor invalid Remote Runtime URL falls back to local Tauri #608

Closed
opened 2026-10-20 17:30:40 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Xelvanis on GitHub (May 26, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1246

Originally assigned to: @cha1latte on GitHub.

Summary

When Remote Runtime URL is configured but invalid, the shared runtime routing can swallow the URL parse failure and fall back to embedded Tauri. In a browser shell this can become a raw Tauri invoke failure; in desktop it can read or write local data when the user intended to use remote data.

Expected behavior

If Remote Runtime URL is configured but invalid, the app should surface an explicit remote-runtime configuration error and fail closed. It should not fall back to embedded/local Tauri behavior.

Actual behavior

remoteRuntimeTarget() catches URL parsing errors and returns null. invokeTauri() treats that the same as "no remote target" and proceeds to the embedded Tauri invoke path.

Steps to reproduce

  1. On the refactor branch, configure Remote Runtime URL to an invalid value such as http://[bad or another malformed URL.
  2. Trigger a storage-backed action that normally routes through the shared Tauri client.
  3. Observe that the app does not present a clear invalid Remote Runtime URL configuration error.
  4. In browser mode, the failure can surface as a raw invoke/runtime error. In desktop mode, the action can fall through to local embedded storage instead of remote storage.

Impact area

  • App shell, navigation, startup, or providers
  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: refactor, identified during 2026-05-26 failpath audit
  • Run mode: Tauri desktop and web shell/remote-runtime routing
  • OS + version: not OS-specific
  • Node + pnpm versions: not captured
  • Rust version, if relevant: not relevant
  • Remote Runtime URL configured? yes, malformed/invalid
  • Provider, model, or integration, if relevant: not relevant

Logs, screenshots, or video

Relevant code paths:

src/shared/api/remote-runtime.ts
src/shared/api/tauri-client.ts

Audit finding:

remoteRuntimeTarget() catches URL parsing errors and returns null.
invokeTauri() then falls through to the embedded Tauri invoke path.

Regression notes

Found by source inspection during the 2026-05-26 failpath audit. A targeted runtime repro should be added before or during the fix.

Additional context

Related to #1233, but distinct: #1233 covers no remote runtime configured in the Vite shell. This issue covers an invalid remote runtime value that was explicitly configured.

Template check

Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Xelvanis on GitHub (May 26, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1246 Originally assigned to: @cha1latte on GitHub. ## Summary When Remote Runtime URL is configured but invalid, the shared runtime routing can swallow the URL parse failure and fall back to embedded Tauri. In a browser shell this can become a raw Tauri invoke failure; in desktop it can read or write local data when the user intended to use remote data. ## Expected behavior If Remote Runtime URL is configured but invalid, the app should surface an explicit remote-runtime configuration error and fail closed. It should not fall back to embedded/local Tauri behavior. ## Actual behavior `remoteRuntimeTarget()` catches URL parsing errors and returns null. `invokeTauri()` treats that the same as "no remote target" and proceeds to the embedded Tauri invoke path. ## Steps to reproduce 1. On the `refactor` branch, configure Remote Runtime URL to an invalid value such as `http://[bad` or another malformed URL. 2. Trigger a storage-backed action that normally routes through the shared Tauri client. 3. Observe that the app does not present a clear invalid Remote Runtime URL configuration error. 4. In browser mode, the failure can surface as a raw invoke/runtime error. In desktop mode, the action can fall through to local embedded storage instead of remote storage. ## Impact area - [ ] App shell, navigation, startup, or providers - [ ] Catalog resources - [ ] Chat mode - [ ] Roleplay mode - [ ] Game mode - [ ] Shared mode UI - [ ] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [ ] React-free engine behavior, contracts, agents, or capability ports - [x] Shared API wrapper or remote runtime routing - [ ] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: `refactor`, identified during 2026-05-26 failpath audit - Run mode: Tauri desktop and web shell/remote-runtime routing - OS + version: not OS-specific - Node + pnpm versions: not captured - Rust version, if relevant: not relevant - Remote Runtime URL configured? yes, malformed/invalid - Provider, model, or integration, if relevant: not relevant ## Logs, screenshots, or video Relevant code paths: ```text src/shared/api/remote-runtime.ts src/shared/api/tauri-client.ts ``` Audit finding: ```text remoteRuntimeTarget() catches URL parsing errors and returns null. invokeTauri() then falls through to the embedded Tauri invoke path. ``` ## Regression notes Found by source inspection during the 2026-05-26 failpath audit. A targeted runtime repro should be added before or during the fix. ## Additional context Related to #1233, but distinct: #1233 covers no remote runtime configured in the Vite shell. This issue covers an invalid remote runtime value that was explicitly configured. ## Template check Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-20 17:30:40 +07:00
  • closed this issue
  • added the
    shared
    bug
    labels
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#608
No description provided.