[PR #4163] [MERGED] Fix incomplete Janitor/JannyAI character imports #6261

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4163
Author: @SpicyMarinara
Created: 7/27/2026
Status: ✅ Merged
Merged: 7/27/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/4162-janny-character-import


📝 Commits (3)

  • 626661c Start work on Janitor character import regression
  • 3972cc7 Fix complete Janny character card imports
  • ba80984 fix: allow complete Janny character cards

📊 Changes

8 files changed (+334 additions, -4 deletions)

View changed files

📝 package.json (+1 -1)
📝 packages/client/src/components/bot-browser/BotBrowserView.tsx (+29 -2)
📝 packages/client/src/lib/character-import.ts (+58 -0)
📝 packages/client/src/localization/locales/en.json (+1 -0)
📝 packages/server/src/routes/bot-browser-janny.routes.ts (+23 -0)
➕ packages/server/src/services/bot-browser/janny-character-card.ts (+94 -0)
📝 packages/shared/src/constants/defaults.ts (+2 -1)
➕ scripts/regressions/janny-character-import.regression.ts (+126 -0)

📄 Description

Linked issue

Closes #4162

Why this change

JannyAI search results contain only catalog metadata. When the legacy character-page extraction was blocked or stopped matching JannyAI output, Marinara silently rebuilt imports from that metadata, preserving only the name, avatar, and creator notes. The imported character then lacked its greeting and other definition fields, so Start Chat was not usable normally.

What changed

  • Download the original V2/V3 PNG card through JannyAI's supported character download endpoint for detail previews and imports.
  • Preserve description, personality, scenario, first message, example dialogue, alternate greetings, prompts, version, extensions, and embedded lorebooks from the original card.
  • Bound and validate both outbound responses, require HTTPS for the returned CDN URL, block private-network resolution through the shared safe fetcher, cap the card size, and verify PNG magic bytes.
  • Stop silently creating a metadata-only Janny character when the complete card is unavailable, and show a localized recovery message instead.
  • Add a focused regression that exercises the two-step download, security policy, PNG parsing, and every affected card field.

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

Automated evidence:

  • pnpm check passed.
  • pnpm localization:check passed.
  • The focused Janny character-import regression passed.
  • All issue regressions after the unrelated baseline failure passed.
  • The aggregate pnpm regression:issues command currently stops in the pre-existing Kaomoji picker assertion at open-issues.regression.ts:1703; neither that component nor assertion is changed by this PR.

Manual verification notes

  • Import a representative public JannyAI character and confirm all supported definition fields are populated.
  • Confirm Start Chat is available and begins with the imported first message.
  • Import a card with alternate greetings and an embedded lorebook.
  • Confirm an upstream/Cloudflare failure shows the localized complete-card error and does not create a partial character.

Live upstream verification remains for a human residential/self-host environment because JannyAI blocks the hosted test runner with Cloudflare bot mitigation.

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 visual layout changes. The existing loading, success, and error affordances are reused; only the localized Janny failure copy is new.

Summary by CodeRabbit

  • New Features

    • Added complete JannyAI character card downloads in PNG format and improved character import detail extraction (including lorebooks and extensions).
    • Added clearer localized messaging when a complete card is unavailable.
  • Bug Fixes

    • Improved JannyAI import/download error handling with provider-specific feedback.
    • Added validation to block insecure (non-HTTPS) card download links.
  • Tests

    • Added regression coverage for end-to-end Janny character import (success + failure cases).

🔄 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/4163 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 7/27/2026 **Status:** ✅ Merged **Merged:** 7/27/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/4162-janny-character-import` --- ### 📝 Commits (3) - [`626661c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/626661c553ed50482c6206c230ad885448fa4287) Start work on Janitor character import regression - [`3972cc7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3972cc7acd640d5d4bcc58d2448b0451b59f07a1) Fix complete Janny character card imports - [`ba80984`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ba80984a3ad03c1207da675138422751ae0cfc03) fix: allow complete Janny character cards ### 📊 Changes **8 files changed** (+334 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `package.json` (+1 -1) 📝 `packages/client/src/components/bot-browser/BotBrowserView.tsx` (+29 -2) 📝 `packages/client/src/lib/character-import.ts` (+58 -0) 📝 `packages/client/src/localization/locales/en.json` (+1 -0) 📝 `packages/server/src/routes/bot-browser-janny.routes.ts` (+23 -0) ➕ `packages/server/src/services/bot-browser/janny-character-card.ts` (+94 -0) 📝 `packages/shared/src/constants/defaults.ts` (+2 -1) ➕ `scripts/regressions/janny-character-import.regression.ts` (+126 -0) </details> ### 📄 Description ## Linked issue Closes #4162 ## Why this change JannyAI search results contain only catalog metadata. When the legacy character-page extraction was blocked or stopped matching JannyAI output, Marinara silently rebuilt imports from that metadata, preserving only the name, avatar, and creator notes. The imported character then lacked its greeting and other definition fields, so Start Chat was not usable normally. ## What changed - Download the original V2/V3 PNG card through JannyAI's supported character download endpoint for detail previews and imports. - Preserve description, personality, scenario, first message, example dialogue, alternate greetings, prompts, version, extensions, and embedded lorebooks from the original card. - Bound and validate both outbound responses, require HTTPS for the returned CDN URL, block private-network resolution through the shared safe fetcher, cap the card size, and verify PNG magic bytes. - Stop silently creating a metadata-only Janny character when the complete card is unavailable, and show a localized recovery message instead. - Add a focused regression that exercises the two-step download, security policy, PNG parsing, and every affected card field. ## 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` Automated evidence: - `pnpm check` passed. - `pnpm localization:check` passed. - The focused Janny character-import regression passed. - All issue regressions after the unrelated baseline failure passed. - The aggregate `pnpm regression:issues` command currently stops in the pre-existing Kaomoji picker assertion at `open-issues.regression.ts:1703`; neither that component nor assertion is changed by this PR. ### Manual verification notes - [ ] Import a representative public JannyAI character and confirm all supported definition fields are populated. - [ ] Confirm Start Chat is available and begins with the imported first message. - [ ] Import a card with alternate greetings and an embedded lorebook. - [ ] Confirm an upstream/Cloudflare failure shows the localized complete-card error and does not create a partial character. Live upstream verification remains for a human residential/self-host environment because JannyAI blocks the hosted test runner with Cloudflare bot mitigation. ## 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 visual layout changes. The existing loading, success, and error affordances are reused; only the localized Janny failure copy is new. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added complete JannyAI character card downloads in PNG format and improved character import detail extraction (including lorebooks and extensions). - Added clearer localized messaging when a complete card is unavailable. - **Bug Fixes** - Improved JannyAI import/download error handling with provider-specific feedback. - Added validation to block insecure (non-HTTPS) card download links. - **Tests** - Added regression coverage for end-to-end Janny character import (success + failure cases). <!-- 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:08:43 +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#6261
No description provided.