[GH-ISSUE #2698] [Issue]: Bot Browser (Chub/Janny) drops/clobbers card fields — alternate greetings, system prompt, post-history, character_version, tags #1343

Closed
opened 2026-10-21 05:31:50 +07:00 by bsakaguchi · 1 comment
Owner

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

Originally assigned to: @SpicyMarinara on GitHub.

Summary

The Bot Browser (Chub.AI / Janny.AI / others) drops or clobbers character-card fields on import, so a bot imported from a repository is missing data it had at the source: alternate greetings, system prompt, post-history (jailbreak) instructions, character_version, tags, and even creator/name in some cases.

Expected behavior

Importing a bot via the Bot Browser should preserve every field present on the source card (embedded PNG card and/or the provider API), matching what a direct card import would yield.

Actual behavior

  • Chub clobbers alternate_greetings with []. The import parses the full V2 PNG card, then merges the Chub API detail over it; fetchDetail maps greetings via optionalStringArray(def.alternate_greetings) which always returns an array ([] when absent), and the merge guard if (detail.alternateGreetings) ... treats [] as truthy → overwrites the PNG's authored greetings with empty.
  • Chub clobbers tags with [] when the search node has no topics (same empty-array-truthy pattern), and overwrites authored PNG creator/name with search-derived values, including empty strings.
  • Janny drops ALL alternate greetings — detailFromCharacter() builds the CardDetail from the decoded Astro character object reading only personality/scenario/firstMessage/exampleDialogs/description; it never reads any alternate-greetings field, so alternateGreetings stays undefined and import sets alternate_greetings: [...] || [].
  • No provider forwards system_prompt / post_history_instructions / character_version. The non-Chub import builder constructs the v2 object without reading cardDetail.systemPrompt/postHistoryInstructions/characterVersion, and the PNG export hardcodes all three to "". So any card carrying a system prompt, jailbreak, or version loses them on import and zeroes them on export.

How it breaks the pipeline

Code trace (staging @ b826f8f4) — packages/client/src/components/bot-browser/BotBrowserView.tsx + packages/client/src/lib/chub-character-card.ts:

  • Chub alt-greetings: optionalStringArray (BotBrowserView.tsx:191-193), fetchDetail (:441), merge guard (chub-character-card.ts:68); legacy path BotBrowserModal.tsx:227. Server reads raw.alternate_greetings directly (st-character.importer.ts:628).
  • Chub tags/creator-name: same empty-array/empty-string overwrite in the merge.
  • Janny: detailFromCharacter() (:692-705); import builder (:1584-1594, alternate_greetings: cardDetail?.alternateGreetings || []); PNG export (~:2735). Sibling providers Chub (:441), Pygmalion (:937), Wyvern (:1043), DataCat (:1251) all surface alternateGreetings.
  • system/post-history/version: CardDetail models systemPrompt (:130), postHistoryInstructions (:131); import builder (:1584) omits them; buildCharacterCardPng hardcodes them empty (:2989-2993); charData (:2725-2737) omits them.

Steps to reproduce

  • Import a Chub card whose embedded PNG has authored alternate_greetings/tags while the Chub detail API returns them empty/absent → the imported character loses them.
  • Import any JannyAI character with >1 greeting → imported with only its primary first_mes.
  • Import any bot carrying a system prompt or post-history/jailbreak → those fields are dropped (and zeroed on re-export).

Suggested fix

  • Only overwrite when the API supplies non-empty data: if (detail.alternateGreetings && detail.alternateGreetings.length > 0) (and have fetchDetail return undefined, not [], when absent) — apply the same for tags/creator/name.
  • In Janny's detailFromCharacter, read the greetings field (char.alternateGreetings/alternate_greetings).
  • Forward systemPrompt/postHistoryInstructions/characterVersion in the non-Chub import builder, and emit them (not "") in buildCharacterCardPng/charData.

Environment

  • Marinara Engine version: 2.0.0 (staging @ b826f8f4)
  • Install type: source
  • OS + version: All (code-level defect, platform-independent)
  • Browser or app shell: All

Additional context

Found via a systematic multi-agent audit of import/export round-trips. Directly affects the common "import a bot from Chub/Janny" flow. Part of a set of import/export fidelity issues filed together.

Template check

Please uncheck (untick) 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 @kolacheee on GitHub (Jun 21, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2698 Originally assigned to: @SpicyMarinara on GitHub. ## Summary The Bot Browser (Chub.AI / Janny.AI / others) drops or clobbers character-card fields on import, so a bot imported from a repository is missing data it had at the source: alternate greetings, system prompt, post-history (jailbreak) instructions, character_version, tags, and even creator/name in some cases. ## Expected behavior Importing a bot via the Bot Browser should preserve every field present on the source card (embedded PNG card and/or the provider API), matching what a direct card import would yield. ## Actual behavior - **Chub clobbers `alternate_greetings` with `[]`.** The import parses the full V2 PNG card, then merges the Chub API detail over it; `fetchDetail` maps greetings via `optionalStringArray(def.alternate_greetings)` which **always returns an array** (`[]` when absent), and the merge guard `if (detail.alternateGreetings) ...` treats `[]` as truthy → overwrites the PNG's authored greetings with empty. - **Chub clobbers `tags` with `[]`** when the search node has no topics (same empty-array-truthy pattern), and **overwrites authored PNG `creator`/`name` with search-derived values, including empty strings.** - **Janny drops ALL alternate greetings** — `detailFromCharacter()` builds the CardDetail from the decoded Astro `character` object reading only personality/scenario/firstMessage/exampleDialogs/description; it never reads any alternate-greetings field, so `alternateGreetings` stays undefined and import sets `alternate_greetings: [...] || []`. - **No provider forwards `system_prompt` / `post_history_instructions` / `character_version`.** The non-Chub import builder constructs the v2 object without reading `cardDetail.systemPrompt`/`postHistoryInstructions`/`characterVersion`, and the PNG export hardcodes all three to `""`. So any card carrying a system prompt, jailbreak, or version loses them on import and zeroes them on export. ## How it breaks the pipeline Code trace (staging @ `b826f8f4`) — `packages/client/src/components/bot-browser/BotBrowserView.tsx` + `packages/client/src/lib/chub-character-card.ts`: - Chub alt-greetings: `optionalStringArray` (`BotBrowserView.tsx:191-193`), `fetchDetail` (`:441`), merge guard (`chub-character-card.ts:68`); legacy path `BotBrowserModal.tsx:227`. Server reads `raw.alternate_greetings` directly (`st-character.importer.ts:628`). - Chub tags/creator-name: same empty-array/empty-string overwrite in the merge. - Janny: `detailFromCharacter()` (~`:692-705`); import builder (~`:1584-1594`, `alternate_greetings: cardDetail?.alternateGreetings || []`); PNG export (~`:2735`). Sibling providers Chub (`:441`), Pygmalion (`:937`), Wyvern (`:1043`), DataCat (`:1251`) all surface `alternateGreetings`. - system/post-history/version: `CardDetail` models `systemPrompt` (`:130`), `postHistoryInstructions` (`:131`); import builder (`:1584`) omits them; `buildCharacterCardPng` hardcodes them empty (`:2989-2993`); `charData` (`:2725-2737`) omits them. ## Steps to reproduce - Import a Chub card whose embedded PNG has authored `alternate_greetings`/`tags` while the Chub detail API returns them empty/absent → the imported character loses them. - Import any JannyAI character with >1 greeting → imported with only its primary `first_mes`. - Import any bot carrying a system prompt or post-history/jailbreak → those fields are dropped (and zeroed on re-export). ## Suggested fix - Only overwrite when the API supplies non-empty data: `if (detail.alternateGreetings && detail.alternateGreetings.length > 0)` (and have `fetchDetail` return `undefined`, not `[]`, when absent) — apply the same for tags/creator/name. - In Janny's `detailFromCharacter`, read the greetings field (`char.alternateGreetings`/`alternate_greetings`). - Forward `systemPrompt`/`postHistoryInstructions`/`characterVersion` in the non-Chub import builder, and emit them (not `""`) in `buildCharacterCardPng`/`charData`. ## Environment - Marinara Engine version: 2.0.0 (staging @ `b826f8f4`) - Install type: source - OS + version: All (code-level defect, platform-independent) - Browser or app shell: All ## Additional context Found via a systematic multi-agent audit of import/export round-trips. Directly affects the common "import a bot from Chub/Janny" flow. Part of a set of import/export fidelity issues filed together. ## Template check Please **uncheck (untick)** 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.
Author
Owner

@SpicyMarinara commented on GitHub (Jun 21, 2026):

Fixed in branch codex/spicy-issue-sweep-2026-06-21.

What changed:

  • Chub detail merge no longer treats empty strings/arrays as overwrite signals.
  • Chub search-derived name/creator/tags only fill blanks instead of clobbering decoded PNG card data.
  • Janny detail extraction now preserves alternate greetings, system prompt, post-history instructions, and character version when present.
  • Generic Bot Browser import payloads and downloaded PNG cards now forward system prompt, post-history instructions, and character version.
  • Added the same V2-field forwarding for provider detail responses that expose those fields.

Final repo checks will run after the full issue sweep.

<!-- gh-comment-id:4761551603 --> @SpicyMarinara commented on GitHub (Jun 21, 2026): Fixed in branch `codex/spicy-issue-sweep-2026-06-21`. What changed: - Chub detail merge no longer treats empty strings/arrays as overwrite signals. - Chub search-derived name/creator/tags only fill blanks instead of clobbering decoded PNG card data. - Janny detail extraction now preserves alternate greetings, system prompt, post-history instructions, and character version when present. - Generic Bot Browser import payloads and downloaded PNG cards now forward system prompt, post-history instructions, and character version. - Added the same V2-field forwarding for provider detail responses that expose those fields. Final repo checks will run after the full issue sweep.
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#1343
No description provided.