[GH-ISSUE #6255] [Issue]: Character token estimates are undercounted in Character Library and Characters panel #3491

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

Originally created by @minikkeuen on GitHub (Sep 16, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6255

Originally assigned to: @SpicyMarinara on GitHub.

Summary

Character token estimates can be significantly undercounted in the Character Library and Characters panel because some UI paths calculate the estimate from the compact character catalog fields instead of the full character card data.

Expected behavior

Character token estimates should represent the full character card text used by the existing character card token estimator, including fields that are not included in the compact catalog representation.

The Character Library and Characters panel should display the same full-card estimate consistently.

Actual behavior

The character catalog introduced a compact representation of character data, but some token estimate paths operate on those compact fields.

As a result, fields omitted from the compact representation are also omitted from the estimate, causing the displayed token count to be lower than the full-card estimate.

For one reproduced character:

  • Full character card estimate: 1,769 tokens
  • Characters panel estimate: 1,088 tokens

The catalog API itself can provide the full-card estimate, but the Characters panel recalculates the value from compact parsed data instead of using the catalog estimate.

Steps to reproduce

  1. Use a character card containing text in fields beyond the compact catalog representation, such as example messages, alternate greetings, system/post-history instructions, extensions, or an embedded character book.
  2. Open the Character Library or Characters panel.
  3. Compare the displayed token estimate with an estimate calculated from the complete character card data.
  4. Observe that affected UI paths can display a lower estimate based only on the compact catalog fields.

Environment

  • Marinara Engine version: 2.4.6
  • Install type: source
  • OS + version: macOS 26.6.2
  • Browser or app shell: Safari

Logs, screenshots, or video

Example reproduced value:

Full catalog token estimate: 1769
Characters panel displayed estimate: 1088

The lower value matches the estimate produced when only the compact catalog fields are passed through the character card estimator.

Additional context

The discrepancy comes from token estimates being recalculated from compact catalog fields rather than the full character card data.

A fix can calculate the token estimate from the full stored character card while building the catalog, then use that catalog-provided estimate consistently in the Character Library and Characters panel without restoring the full card JSON to catalog responses.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @minikkeuen on GitHub (Sep 16, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6255 Originally assigned to: @SpicyMarinara on GitHub. ## Summary Character token estimates can be significantly undercounted in the Character Library and Characters panel because some UI paths calculate the estimate from the compact character catalog fields instead of the full character card data. ## Expected behavior Character token estimates should represent the full character card text used by the existing character card token estimator, including fields that are not included in the compact catalog representation. The Character Library and Characters panel should display the same full-card estimate consistently. ## Actual behavior The character catalog introduced a compact representation of character data, but some token estimate paths operate on those compact fields. As a result, fields omitted from the compact representation are also omitted from the estimate, causing the displayed token count to be lower than the full-card estimate. For one reproduced character: - Full character card estimate: 1,769 tokens - Characters panel estimate: 1,088 tokens The catalog API itself can provide the full-card estimate, but the Characters panel recalculates the value from compact parsed data instead of using the catalog estimate. ## Steps to reproduce 1. Use a character card containing text in fields beyond the compact catalog representation, such as example messages, alternate greetings, system/post-history instructions, extensions, or an embedded character book. 2. Open the Character Library or Characters panel. 3. Compare the displayed token estimate with an estimate calculated from the complete character card data. 4. Observe that affected UI paths can display a lower estimate based only on the compact catalog fields. ## Environment - Marinara Engine version: 2.4.6 - Install type: source - OS + version: macOS 26.6.2 - Browser or app shell: Safari ## Logs, screenshots, or video Example reproduced value: ```text Full catalog token estimate: 1769 Characters panel displayed estimate: 1088 ``` The lower value matches the estimate produced when only the compact catalog fields are passed through the character card estimator. ## Additional context The discrepancy comes from token estimates being recalculated from compact catalog fields rather than the full character card data. A fix can calculate the token estimate from the full stored character card while building the catalog, then use that catalog-provided estimate consistently in the Character Library and Characters panel without restoring the full card JSON to catalog responses. ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 06:03:36 +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#3491
No description provided.