[GH-ISSUE #7761] [Issue]: mari characters update --json drops other card extensions (shallow merge) #4284

Closed
opened 2026-10-21 06:14:11 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @ylli-selmani on GitHub (Oct 17, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7761

Originally assigned to: @ylli-selmani on GitHub.

Summary

mari characters update <id> --json '...' merges the JSON patch shallowly into the card, so a patch that touches anything under extensions replaces the whole extensions object. Every other extension on the card (appearance, backstory, depth prompt, onboarding, ...) is dropped.

Expected behavior

Only the keys in the patch change, like app_data character.update, which deep-merges (deepMerge). For example, --json '{"extensions":{"depth_prompt":{...}}}' updates the depth prompt and keeps extensions.appearance and extensions.backstory.

Actual behavior

extensions ends up containing only what the patch sent. The other extensions are gone after the write is applied (they come back only by restoring an older character version).

Steps to reproduce

  1. Have a character with an appearance and a backstory set.
  2. Ask Professor Mari to run mari characters update <id> --json '{"extensions":{"depth_prompt":{"prompt":"x","depth":4,"role":"system"}}}' --apply (or any JSON patch containing extensions).
  3. Open the character: Appearance and Backstory are empty.

Found by reading the code, not yet reproduced in the app: packages/server/src/services/mari-db/mari-db.service.ts, the update case of mari characters, uses { ...existingData, ...patchData }. The fix PR adds a regression that fails on the current code.

Environment

  • Marinara Engine version: 2.5.0 (staging at eed2c7c22)
  • Install type: source
  • OS + version: Windows 11
  • Browser or app shell: not relevant (server-side)

Logs, screenshots, or video

None; code trace above.

Additional context

Blocks #7760 (Mari writing interactive onboarding), which needs safe writes into extensions.

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 @ylli-selmani on GitHub (Oct 17, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7761 Originally assigned to: @ylli-selmani on GitHub. ## Summary `mari characters update <id> --json '...'` merges the JSON patch shallowly into the card, so a patch that touches anything under `extensions` replaces the whole `extensions` object. Every other extension on the card (appearance, backstory, depth prompt, onboarding, ...) is dropped. ## Expected behavior Only the keys in the patch change, like `app_data` `character.update`, which deep-merges (`deepMerge`). For example, `--json '{"extensions":{"depth_prompt":{...}}}'` updates the depth prompt and keeps `extensions.appearance` and `extensions.backstory`. ## Actual behavior `extensions` ends up containing only what the patch sent. The other extensions are gone after the write is applied (they come back only by restoring an older character version). ## Steps to reproduce 1. Have a character with an appearance and a backstory set. 2. Ask Professor Mari to run `mari characters update <id> --json '{"extensions":{"depth_prompt":{"prompt":"x","depth":4,"role":"system"}}}' --apply` (or any JSON patch containing `extensions`). 3. Open the character: Appearance and Backstory are empty. Found by reading the code, not yet reproduced in the app: `packages/server/src/services/mari-db/mari-db.service.ts`, the `update` case of `mari characters`, uses `{ ...existingData, ...patchData }`. The fix PR adds a regression that fails on the current code. ## Environment - Marinara Engine version: 2.5.0 (`staging` at eed2c7c22) - Install type: source - OS + version: Windows 11 - Browser or app shell: not relevant (server-side) ## Logs, screenshots, or video None; code trace above. ## Additional context Blocks #7760 (Mari writing interactive onboarding), which needs safe writes into `extensions`. ## 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.
bsakaguchi 2026-10-21 06:14:11 +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#4284
No description provided.