[PR #56] [MERGED] fix: JannyAI imports now include full character definitions #4425

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/56
Author: @LukaTheHero
Created: 4/4/2026
Status: ✅ Merged
Merged: 4/4/2026
Merged by: @LukaTheHero

Base: main ← Head: fix/janny-import-details


📝 Commits (1)

  • ee74166 fix: JannyAI character imports now include full definitions

📊 Changes

2 files changed (+213 additions, -1 deletions)

View changed files

📝 packages/client/src/components/bot-browser/BotBrowserView.tsx (+95 -1)
📝 packages/server/src/routes/bot-browser-janny.routes.ts (+118 -0)

📄 Description

Bug Fix

JannyAI character imports were only importing the name, avatar, and tags — the actual character definition (personality, first message, scenario, example dialogs) was missing because fetchDetail returned null.

Problem

JannyAI's MeiliSearch API only returns basic metadata (name, description tagline, avatar, tags, tokens). The full character definition fields (personality, firstMessage, scenario, exampleDialogs) are only available on the character's HTML page, embedded in Astro island props.

Solution

Added a multi-strategy approach to fetch full character details:

  1. Server-side proxy (/api/bot-browser/janny/character/:id) — attempts to fetch the JannyAI character page directly and via corsproxy.io, then parses the Astro island props to extract the full definition
  2. Client-side corsproxy.io fallback — if the server-side fetch fails (Cloudflare blocks it), the browser fetches via corsproxy.io directly and parses the HTML client-side
  3. Search data fallback — if both strategies fail, shows the creator's notes from the search result so the detail view isn't completely empty

This matches the same approach used by the SillyTavern Character Library plugin, which also uses multiple proxy strategies with graceful fallback.

Files Changed

  • packages/server/src/routes/bot-browser-janny.routes.ts — Added /janny/character/:id route with Astro prop parsing and dual fetch strategy
  • packages/client/src/components/bot-browser/BotBrowserView.tsx — Updated JannyAI fetchDetail with 3-tier fallback (server proxy → client corsproxy → search data)

Testing

  • ✅ Character detail view now shows Description, First Message, Scenario, Example Dialogs
  • ✅ Imported characters have full definitions populated
  • ✅ Graceful fallback when Cloudflare blocks — still shows creator notes

🔄 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/56 **Author:** [@LukaTheHero](https://github.com/LukaTheHero) **Created:** 4/4/2026 **Status:** ✅ Merged **Merged:** 4/4/2026 **Merged by:** [@LukaTheHero](https://github.com/LukaTheHero) **Base:** `main` ← **Head:** `fix/janny-import-details` --- ### 📝 Commits (1) - [`ee74166`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ee741665363126bdc54a1b4d466d04430234c086) fix: JannyAI character imports now include full definitions ### 📊 Changes **2 files changed** (+213 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/bot-browser/BotBrowserView.tsx` (+95 -1) 📝 `packages/server/src/routes/bot-browser-janny.routes.ts` (+118 -0) </details> ### 📄 Description ## Bug Fix JannyAI character imports were only importing the name, avatar, and tags — the actual character definition (personality, first message, scenario, example dialogs) was missing because `fetchDetail` returned `null`. ### Problem JannyAI's MeiliSearch API only returns basic metadata (name, description tagline, avatar, tags, tokens). The full character definition fields (personality, firstMessage, scenario, exampleDialogs) are only available on the character's HTML page, embedded in Astro island props. ### Solution Added a multi-strategy approach to fetch full character details: 1. **Server-side proxy** (`/api/bot-browser/janny/character/:id`) — attempts to fetch the JannyAI character page directly and via corsproxy.io, then parses the Astro island props to extract the full definition 2. **Client-side corsproxy.io fallback** — if the server-side fetch fails (Cloudflare blocks it), the browser fetches via corsproxy.io directly and parses the HTML client-side 3. **Search data fallback** — if both strategies fail, shows the creator's notes from the search result so the detail view isn't completely empty This matches the same approach used by the SillyTavern Character Library plugin, which also uses multiple proxy strategies with graceful fallback. ### Files Changed - `packages/server/src/routes/bot-browser-janny.routes.ts` — Added `/janny/character/:id` route with Astro prop parsing and dual fetch strategy - `packages/client/src/components/bot-browser/BotBrowserView.tsx` — Updated JannyAI `fetchDetail` with 3-tier fallback (server proxy → client corsproxy → search data) ### Testing - ✅ Character detail view now shows Description, First Message, Scenario, Example Dialogs - ✅ Imported characters have full definitions populated - ✅ Graceful fallback when Cloudflare blocks — still shows creator notes --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:07:29 +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#4425
No description provided.