[GH-ISSUE #2159] [Issue]: Chub card import merge drops most field overrides and flips extensions precedence #1068

Closed
opened 2026-10-21 05:26:18 +07:00 by bsakaguchi · 0 comments
Owner

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

Originally assigned to: @cha1latte on GitHub.

Summary

On the chub/chartavern download-PNG import path, the legacy app overlaid the freshly fetched chub API definition over the embedded PNG card, so newer/fuller chub-side values (including alternate_greetings, description, name, tags) won. The refactor's replacement merge only overlays system_prompt, post_history_instructions, character_version, character_book, and extensions, and it also flips extensions precedence so the embedded PNG wins over the chub definition.

Expected behavior

When importing a chub card via the PNG-download path, fields that differ between the freshly fetched chub definition and the embedded PNG should be taken from the chub detail (description, personality, scenario, first_mes, mes_example, creator_notes, name, creator, tags, alternate_greetings), and definition.extensions should override matching embedded-PNG extension keys, as in legacy.

Actual behavior

Only system_prompt, post_history_instructions, character_version, character_book, and extensions are taken from the chub detail; all other text fields, name, creator, tags, and alternate_greetings now always come from the embedded PNG even when the chub API has fuller/newer values. Extensions precedence is reversed: { ...detail.providerExtensions, ...existingExtensions } lets the embedded PNG win.

Steps to reproduce

  1. Find a chub card whose on-site definition is newer than its embedded PNG (e.g. alternate_greetings added after the PNG was last embedded, or an updated description).
  2. Import it via the bot browser download path.
  3. The imported character keeps the stale embedded-PNG values; chub-side updates and any alternate greetings missing from the PNG are lost.

Impact area

  • Catalog resources
  • App shell, navigation, startup, or providers

Environment

  • Branch or commit: refactor @ 93555d4b
  • Run mode: Tauri desktop
  • OS + version: Windows 11
  • Node + pnpm versions: n/a (static parity audit, main vs refactor)
  • Rust version, if relevant: n/a
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: chub / chartavern import

Regression notes

Worked in legacy (main @ c49f1d95). main: packages/client/src/lib/chub-character-card.ts:55-74 (mergeChubDetailIntoCharacterJson) overlays all text fields + name/creator/tags/alternate_greetings and merges extensions chub-wins; called at packages/client/src/components/bot-browser/BotBrowserView.tsx:1548-1555. refactor @ 93555d4b: src/features/shell/bot-browser/lib/character-detail-merge.ts:19-55 (mergeCharacterDetailIntoCharacterJson); its CharacterDetailImportData interface lacks those fields, and :45-47 spreads existing extensions last (PNG wins).

Originally created by @Romuromylus on GitHub (Jun 4, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2159 Originally assigned to: @cha1latte on GitHub. ## Summary On the chub/chartavern download-PNG import path, the legacy app overlaid the freshly fetched chub API `definition` over the embedded PNG card, so newer/fuller chub-side values (including `alternate_greetings`, description, name, tags) won. The refactor's replacement merge only overlays `system_prompt`, `post_history_instructions`, `character_version`, `character_book`, and `extensions`, and it also flips extensions precedence so the embedded PNG wins over the chub definition. ## Expected behavior When importing a chub card via the PNG-download path, fields that differ between the freshly fetched chub `definition` and the embedded PNG should be taken from the chub detail (description, personality, scenario, first_mes, mes_example, creator_notes, name, creator, tags, alternate_greetings), and `definition.extensions` should override matching embedded-PNG extension keys, as in legacy. ## Actual behavior Only `system_prompt`, `post_history_instructions`, `character_version`, `character_book`, and `extensions` are taken from the chub detail; all other text fields, name, creator, tags, and `alternate_greetings` now always come from the embedded PNG even when the chub API has fuller/newer values. Extensions precedence is reversed: `{ ...detail.providerExtensions, ...existingExtensions }` lets the embedded PNG win. ## Steps to reproduce 1. Find a chub card whose on-site definition is newer than its embedded PNG (e.g. `alternate_greetings` added after the PNG was last embedded, or an updated description). 2. Import it via the bot browser download path. 3. The imported character keeps the stale embedded-PNG values; chub-side updates and any alternate greetings missing from the PNG are lost. ## Impact area - [x] Catalog resources - [x] App shell, navigation, startup, or providers ## Environment - Branch or commit: refactor @ 93555d4b - Run mode: Tauri desktop - OS + version: Windows 11 - Node + pnpm versions: n/a (static parity audit, main vs refactor) - Rust version, if relevant: n/a - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: chub / chartavern import ## Regression notes Worked in legacy (main @ c49f1d95). main: `packages/client/src/lib/chub-character-card.ts:55-74` (mergeChubDetailIntoCharacterJson) overlays all text fields + name/creator/tags/alternate_greetings and merges extensions chub-wins; called at `packages/client/src/components/bot-browser/BotBrowserView.tsx:1548-1555`. refactor @ 93555d4b: `src/features/shell/bot-browser/lib/character-detail-merge.ts:19-55` (mergeCharacterDetailIntoCharacterJson); its `CharacterDetailImportData` interface lacks those fields, and `:45-47` spreads existing extensions last (PNG wins).
bsakaguchi 2026-10-21 05:26:18 +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#1068
No description provided.