[GH-ISSUE #2069] [Issue]: hostable remote runtime lacks explicit legacy API body limits #1015

Closed
opened 2026-10-21 05:25:10 +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/2069

Originally assigned to: @cha1latte on GitHub.

Summary

The hostable Rust Remote Runtime does not visibly preserve the legacy server's explicit API request body/upload size policy.

Expected behavior

Hostable Remote Runtime API paths should have an intentional body/upload size policy comparable to legacy server behavior:

  • A documented default request body/upload limit for JSON and upload-like API paths.
  • Route-specific exceptions where large profile/import flows require them.
  • Focused proof around the intended boundary.

Actual behavior

Target 3 parityscan found no explicit hostable Rust body/upload limit policy matching the legacy 256 MiB app-owned server limit. Axum's JSON extractor has a dependency default body limit of 2,097,152 bytes, but this is not the legacy app policy and was not found documented as an intentional replacement.

Legacy evidence:

  • packages/server/src/app.ts set MAX_UPLOAD_BYTES = 256 * 1024 * 1024.
  • The Fastify app used bodyLimit: MAX_UPLOAD_BYTES.
  • The multipart plugin used fileSize: MAX_UPLOAD_BYTES.
  • Legacy profile/import routes also had route-specific body-size handling where needed.

Refactor evidence:

  • src-tauri/src/http_server.rs maps /api/invoke and dedicated JSON routes but this scan found no explicit body-size limit layer or per-route body limit there.
  • src-tauri/Cargo.toml enables tower-http with cors only; no tower_http::limit::RequestBodyLimitLayer usage was found.
  • Local dependency check found Axum's default extractor body limit is 2 MiB.

Steps to reproduce

  1. Run the hostable Remote Runtime from the refactor branch.
  2. Send JSON/upload-style Remote Runtime requests around the intended body-size boundary.
  3. Compare behavior to legacy main, which had an explicit 256 MiB server-level body/upload limit plus route-specific handling.

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 oversized-body 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 body/upload limit behavior.

Regression notes

Legacy main had an explicit app-owned API body/upload limit. Refactor may be implicitly limited by Axum defaults or deployment layers, but no intentional legacy-equivalent runtime policy was found.

Additional context

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

Acceptance criteria:

  • Add an explicit hostable API request body/upload limit policy, or document an intentional divergence.
  • Cover large profile/import needs and any route-specific exceptions.
  • Add focused proof for accepted and rejected body sizes around the intended limit.

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/2069 Originally assigned to: @cha1latte on GitHub. ## Summary The hostable Rust Remote Runtime does not visibly preserve the legacy server's explicit API request body/upload size policy. ## Expected behavior Hostable Remote Runtime API paths should have an intentional body/upload size policy comparable to legacy server behavior: - A documented default request body/upload limit for JSON and upload-like API paths. - Route-specific exceptions where large profile/import flows require them. - Focused proof around the intended boundary. ## Actual behavior Target 3 parityscan found no explicit hostable Rust body/upload limit policy matching the legacy 256 MiB app-owned server limit. Axum's JSON extractor has a dependency default body limit of 2,097,152 bytes, but this is not the legacy app policy and was not found documented as an intentional replacement. Legacy evidence: - `packages/server/src/app.ts` set `MAX_UPLOAD_BYTES = 256 * 1024 * 1024`. - The Fastify app used `bodyLimit: MAX_UPLOAD_BYTES`. - The multipart plugin used `fileSize: MAX_UPLOAD_BYTES`. - Legacy profile/import routes also had route-specific body-size handling where needed. Refactor evidence: - `src-tauri/src/http_server.rs` maps `/api/invoke` and dedicated JSON routes but this scan found no explicit body-size limit layer or per-route body limit there. - `src-tauri/Cargo.toml` enables `tower-http` with `cors` only; no `tower_http::limit::RequestBodyLimitLayer` usage was found. - Local dependency check found Axum's default extractor body limit is 2 MiB. ## Steps to reproduce 1. Run the hostable Remote Runtime from the refactor branch. 2. Send JSON/upload-style Remote Runtime requests around the intended body-size boundary. 3. Compare behavior to legacy `main`, which had an explicit 256 MiB server-level body/upload limit plus route-specific handling. ## 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 oversized-body 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 body/upload limit behavior. ## Regression notes Legacy `main` had an explicit app-owned API body/upload limit. Refactor may be implicitly limited by Axum defaults or deployment layers, but no intentional legacy-equivalent runtime policy was found. ## Additional context Split from Target 3 PERF/body/cache parity row: - Target detail: #2050 - Umbrella issue: #2059 - Parity index: #1904 Acceptance criteria: - Add an explicit hostable API request body/upload limit policy, or document an intentional divergence. - Cover large profile/import needs and any route-specific exceptions. - Add focused proof for accepted and rejected body sizes around the intended limit. ## 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:10 +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#1015
No description provided.