[PR #5784] [MERGED] fix: harden imports and provider compatibility #6932

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5784
Author: @Gunterlie
Created: 9/2/2026
Status: ✅ Merged
Merged: 9/3/2026
Merged by: @Gunterlie

Base: staging ← Head: sweep-it-real-good


📝 Commits (10+)

  • 5555a63 fix: harden imports and provider compatibility
  • ae79288 Merge remote-tracking branch 'origin/staging' into sweep-it-real-good
  • 97be5dc fix: address image and import review findings
  • 2307d5f fix: address OpenRouter and import review findings
  • ec1b367 Merge remote-tracking branch 'origin/staging' into sweep-it-real-good
  • f51dfd1 Merge remote-tracking branch 'origin/staging' into sweep-it-real-good
  • f2fef27 fix: close image and import review findings
  • 8dca359 fix: enforce streamed import limits
  • e93d531 Merge remote-tracking branch 'origin/staging' into sweep-it-real-good
  • ada300c fix: type streamed import length guard

📊 Changes

11 files changed (+294 additions, -46 deletions)

View changed files

📝 CHANGELOG.md (+4 -0)
📝 packages/client/src/components/layout/AppShell.tsx (+1 -1)
📝 packages/client/src/components/panels/SettingsPanel.tsx (+4 -0)
📝 packages/client/src/lib/png-parser.ts (+5 -0)
📝 packages/client/src/localization/locales/en.json (+1 -0)
📝 packages/server/src/routes/backup.routes.ts (+60 -6)
📝 packages/server/src/routes/import.routes.ts (+59 -14)
📝 packages/server/src/services/capability-packages/capability-persistence.service.ts (+4 -0)
📝 packages/server/src/services/image/image-generation.ts (+62 -13)
📝 packages/server/src/services/import/st-bulk.importer.ts (+3 -1)
📝 scripts/regressions/open-issues.regression.ts (+91 -11)

📄 Description

Linked issue

Closes #5647
Closes #5699
Closes #5593
Closes #5749

Why this change

This change closes verified security and correctness gaps from the issue sweep. It bounds import resource use, protects PNG decompression paths, protects profile preview tokens on non-local HTTP, keeps capability-created chats visible to recency-based features, handles Nano Banana image sizes, fixes GPT Image 2 OpenRouter routing, and separates the desktop resize hit area from the chat scrollbar.

What changed

  • Add finite limits for general imports, native packages, and profile archives.
  • Bound server and client zTXt decompression output.
  • Refuse profile preview transport over non-local HTTP.
  • Update lastMessageAt and updatedAt for capability-created messages.
  • Normalize portrait Nano Banana image requests for NanoGPT and OpenRouter.
  • Route bare and canonical GPT Image models to the OpenRouter Images API and omit unsupported resolution.
  • Preserve supported GPT Image references and request options.
  • Move the right-panel resize handle inside the panel boundary.
  • Add aggregate multipart limits and update regression coverage.

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

  • Manually verify oversized import rejection.
  • Manually verify profile JSON and ZIP imports at their respective limits.
  • Manually verify profile import over HTTPS and local HTTP.
  • Manually verify Nano Banana and GPT Image 2 generation through OpenRouter and NanoGPT.
  • Manually verify the center scrollbar and right-panel resize handle in Firefox.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

No screenshots included. Manual browser verification remains required.

Proof

  • pnpm check passed locally on commit f2fef2793.
  • The open-issues regression passed on commit f2fef2793.
  • The provider compatibility regression passed on commit f2fef2793.
  • pnpm check:e2e-types passed on commit f2fef2793.
  • git diff --check passed.
  • Fresh GitHub validation is required after the latest commit.

Remaining work

  • #5717 remains covered by PR #5768.
  • #5688 was fixed by merged PR #5709.
  • #5713 is assigned to Promansis and is not part of this PR.
  • #5770 remains covered by PR #5771.
  • #5750 needs separate model-capability and endpoint-routing work.

Summary by CodeRabbit

  • Bug Fixes

    • Improved portrait image generation for Nano Banana and GPT Image 2 models with more reliable sizing, routing, and aspect-ratio handling.
    • Corrected chat timestamps when message swipes are created.
    • Adjusted the desktop right-panel resize handle placement for easier targeting.
    • Remote profile imports now require HTTPS, except on local development hosts.
  • Security & Reliability

    • Added upload and archive size limits for profile, character, and package imports.
    • Limited PNG metadata decompression and strengthened multipart upload validation.

🔄 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/5784 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 9/2/2026 **Status:** ✅ Merged **Merged:** 9/3/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `staging` ← **Head:** `sweep-it-real-good` --- ### 📝 Commits (10+) - [`5555a63`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5555a63938b519b55694aab70eada576483841d6) fix: harden imports and provider compatibility - [`ae79288`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ae79288d6cd74652240f556c54b6b74d58998cf4) Merge remote-tracking branch 'origin/staging' into sweep-it-real-good - [`97be5dc`](https://github.com/Pasta-Devs/Marinara-Engine/commit/97be5dc95495f4725bc1a0848131720b00bafddb) fix: address image and import review findings - [`2307d5f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2307d5f6f1c2ff3496608a628cd78b244899fb89) fix: address OpenRouter and import review findings - [`ec1b367`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ec1b367c5f2331ee970ce46a645f616008720790) Merge remote-tracking branch 'origin/staging' into sweep-it-real-good - [`f51dfd1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f51dfd1cf1438144bf4891e32d0a039ce9b5cdd2) Merge remote-tracking branch 'origin/staging' into sweep-it-real-good - [`f2fef27`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f2fef279392e66038b09aa7984d68659cf698465) fix: close image and import review findings - [`8dca359`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8dca3596c750be6c1d411fefda6880b69a33fc25) fix: enforce streamed import limits - [`e93d531`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e93d5315d4bd9f7f28c1a931810f4562b122d358) Merge remote-tracking branch 'origin/staging' into sweep-it-real-good - [`ada300c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ada300c686140922a3e35b61cc3a0691bd26fdf6) fix: type streamed import length guard ### 📊 Changes **11 files changed** (+294 additions, -46 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+4 -0) 📝 `packages/client/src/components/layout/AppShell.tsx` (+1 -1) 📝 `packages/client/src/components/panels/SettingsPanel.tsx` (+4 -0) 📝 `packages/client/src/lib/png-parser.ts` (+5 -0) 📝 `packages/client/src/localization/locales/en.json` (+1 -0) 📝 `packages/server/src/routes/backup.routes.ts` (+60 -6) 📝 `packages/server/src/routes/import.routes.ts` (+59 -14) 📝 `packages/server/src/services/capability-packages/capability-persistence.service.ts` (+4 -0) 📝 `packages/server/src/services/image/image-generation.ts` (+62 -13) 📝 `packages/server/src/services/import/st-bulk.importer.ts` (+3 -1) 📝 `scripts/regressions/open-issues.regression.ts` (+91 -11) </details> ### 📄 Description ## Linked issue Closes #5647 Closes #5699 Closes #5593 Closes #5749 ## Why this change This change closes verified security and correctness gaps from the issue sweep. It bounds import resource use, protects PNG decompression paths, protects profile preview tokens on non-local HTTP, keeps capability-created chats visible to recency-based features, handles Nano Banana image sizes, fixes GPT Image 2 OpenRouter routing, and separates the desktop resize hit area from the chat scrollbar. ## What changed - Add finite limits for general imports, native packages, and profile archives. - Bound server and client zTXt decompression output. - Refuse profile preview transport over non-local HTTP. - Update `lastMessageAt` and `updatedAt` for capability-created messages. - Normalize portrait Nano Banana image requests for NanoGPT and OpenRouter. - Route bare and canonical GPT Image models to the OpenRouter Images API and omit unsupported `resolution`. - Preserve supported GPT Image references and request options. - Move the right-panel resize handle inside the panel boundary. - Add aggregate multipart limits and update regression coverage. ## 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 - Manually verify oversized import rejection. - Manually verify profile JSON and ZIP imports at their respective limits. - Manually verify profile import over HTTPS and local HTTP. - Manually verify Nano Banana and GPT Image 2 generation through OpenRouter and NanoGPT. - Manually verify the center scrollbar and right-panel resize handle in Firefox. ## Docs and release impact - [ ] No docs changes needed - [x] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) No screenshots included. Manual browser verification remains required. ## Proof - `pnpm check` passed locally on commit `f2fef2793`. - The open-issues regression passed on commit `f2fef2793`. - The provider compatibility regression passed on commit `f2fef2793`. - `pnpm check:e2e-types` passed on commit `f2fef2793`. - `git diff --check` passed. - Fresh GitHub validation is required after the latest commit. ## Remaining work - #5717 remains covered by PR #5768. - #5688 was fixed by merged PR #5709. - #5713 is assigned to Promansis and is not part of this PR. - #5770 remains covered by PR #5771. - #5750 needs separate model-capability and endpoint-routing work. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved portrait image generation for Nano Banana and GPT Image 2 models with more reliable sizing, routing, and aspect-ratio handling. - Corrected chat timestamps when message swipes are created. - Adjusted the desktop right-panel resize handle placement for easier targeting. - Remote profile imports now require HTTPS, except on local development hosts. - **Security & Reliability** - Added upload and archive size limits for profile, character, and package imports. - Limited PNG metadata decompression and strengthened multipart upload validation. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:15:00 +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#6932
No description provided.