[GH-ISSUE #2070] [Issue]: remote runtime JSON API calls lack legacy no-store cache policy #1017

Closed
opened 2026-10-21 05:25:13 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Jun 3, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2070

Originally assigned to: @cha1latte on GitHub.

Summary

Remote Runtime JSON API calls do not visibly preserve the legacy server/client no-store cache policy.

Expected behavior

Remote Runtime API traffic should avoid stale browser/proxy cache reuse for command, health, and stream-related JSON API paths:

  • JSON API responses should get Cache-Control: no-store or an intentional equivalent unless a route deliberately sets a different cache policy.
  • Remote client fetches for command/health/SSE API calls should set cache: "no-store" or an intentional equivalent.
  • Managed asset cache headers should remain intentional and separate from JSON API no-store behavior.

Actual behavior

Target 3 parityscan found explicit cache headers for managed assets, but no default no-store policy for /api/invoke JSON responses or other JSON API responses. Refactor remote client fetches also do not set cache: "no-store".

Legacy evidence:

  • packages/server/src/app.ts had an onSend hook that applied Cache-Control: no-store to /api/* responses unless a route already set cache headers.
  • packages/client/src/lib/api-client.ts set cache: "no-store" on shared API fetches, downloads, and SSE helpers.
  • Legacy comments note the server no-store hook avoided stale JSON after mutations/refetches.

Refactor evidence:

  • src-tauri/src/http_server.rs applies managed asset cache headers, but this scan found no default API no-store hook for JSON API responses.
  • src/shared/api/remote-runtime.ts fetches /health, /api/invoke, /api/import/st-bulk/run, /api/llm/stream, and cancel routes without cache: "no-store".
  • src/shared/api/local-file-api.ts correctly handles authenticated remote asset blobs separately; this issue is about JSON API/cache policy, not managed asset caching.

Steps to reproduce

  1. Run the hostable Remote Runtime from the refactor branch.
  2. Inspect response headers from /api/invoke JSON responses before and after storage mutations/refetches.
  3. Inspect remote client fetch options for command, health, and SSE calls.
  4. Compare to legacy main server/client no-store API behavior.

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 / Target 3 rescan on 2026-06-04; refactor trace at 9bcfb164; legacy main trace at 77a30fa4
  • Run mode: remote runtime
  • OS + version: not captured
  • Node + pnpm versions: not relevant
  • Rust version, if relevant: not captured
  • Remote Runtime URL configured? yes
  • Provider, model, or integration, if relevant: hostable HTTP runtime

Logs, screenshots, or video

No live browser/cache repro attached. This is static parity evidence from Target 3.

Focused adjacent proof run:

cargo test --manifest-path src-tauri/Cargo.toml hostable_security_

Result: passed, 11 tests. This does not prove no-store cache behavior.

Regression notes

Legacy main explicitly used no-store on both server responses and client fetch calls for API traffic. Refactor Remote Runtime has intentional asset cache headers, but the legacy JSON API no-store path was not found.

Additional context

Split from Target 3 PERF/body/cache parity row:

Acceptance criteria:

  • Add default no-store/no-cache behavior for hostable JSON API responses, or document an intentional divergence.
  • Add cache: "no-store" or an intentional equivalent to remote client fetches for command/health/SSE API calls.
  • Preserve intentional managed asset cache headers.

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 @Promansis on GitHub (Jun 3, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2070 Originally assigned to: @cha1latte on GitHub. ## Summary Remote Runtime JSON API calls do not visibly preserve the legacy server/client no-store cache policy. ## Expected behavior Remote Runtime API traffic should avoid stale browser/proxy cache reuse for command, health, and stream-related JSON API paths: - JSON API responses should get `Cache-Control: no-store` or an intentional equivalent unless a route deliberately sets a different cache policy. - Remote client fetches for command/health/SSE API calls should set `cache: "no-store"` or an intentional equivalent. - Managed asset cache headers should remain intentional and separate from JSON API no-store behavior. ## Actual behavior Target 3 parityscan found explicit cache headers for managed assets, but no default no-store policy for `/api/invoke` JSON responses or other JSON API responses. Refactor remote client fetches also do not set `cache: "no-store"`. Legacy evidence: - `packages/server/src/app.ts` had an `onSend` hook that applied `Cache-Control: no-store` to `/api/*` responses unless a route already set cache headers. - `packages/client/src/lib/api-client.ts` set `cache: "no-store"` on shared API fetches, downloads, and SSE helpers. - Legacy comments note the server no-store hook avoided stale JSON after mutations/refetches. Refactor evidence: - `src-tauri/src/http_server.rs` applies managed asset cache headers, but this scan found no default API no-store hook for JSON API responses. - `src/shared/api/remote-runtime.ts` fetches `/health`, `/api/invoke`, `/api/import/st-bulk/run`, `/api/llm/stream`, and cancel routes without `cache: "no-store"`. - `src/shared/api/local-file-api.ts` correctly handles authenticated remote asset blobs separately; this issue is about JSON API/cache policy, not managed asset caching. ## Steps to reproduce 1. Run the hostable Remote Runtime from the refactor branch. 2. Inspect response headers from `/api/invoke` JSON responses before and after storage mutations/refetches. 3. Inspect remote client fetch options for command, health, and SSE calls. 4. Compare to legacy `main` server/client no-store API behavior. ## 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 - [x] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: `refactor` / Target 3 rescan on 2026-06-04; refactor trace at `9bcfb164`; legacy `main` trace at `77a30fa4` - Run mode: remote runtime - OS + version: not captured - Node + pnpm versions: not relevant - Rust version, if relevant: not captured - Remote Runtime URL configured? yes - Provider, model, or integration, if relevant: hostable HTTP runtime ## Logs, screenshots, or video No live browser/cache repro attached. This is static parity evidence from Target 3. Focused adjacent proof run: ```bash cargo test --manifest-path src-tauri/Cargo.toml hostable_security_ ``` Result: passed, 11 tests. This does not prove no-store cache behavior. ## Regression notes Legacy `main` explicitly used no-store on both server responses and client fetch calls for API traffic. Refactor Remote Runtime has intentional asset cache headers, but the legacy JSON API no-store path was not found. ## Additional context Split from Target 3 PERF/body/cache parity row: - Target detail: #2050 - Umbrella issue: #2059 - Parity index: #1904 Acceptance criteria: - Add default no-store/no-cache behavior for hostable JSON API responses, or document an intentional divergence. - Add `cache: "no-store"` or an intentional equivalent to remote client fetches for command/health/SSE API calls. - Preserve intentional managed asset cache headers. ## 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-21 05:25: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#1017
No description provided.