[GH-ISSUE #1965] [Issue]: Personas token sort undercounts text fields #966

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

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

Originally assigned to: @cha1latte on GitHub.

Summary

The Personas panel token sort estimates persona size from description, personality, scenario, backstory, and appearance, but the refactor panel is fed by persona summaries that only include description from that set. Sorting by Tokens can be wrong when most text lives outside the description field.

Expected behavior

Tokens sort should estimate against the same full persona fields as legacy, or the summary projection should include the fields used by the estimator.

Actual behavior

src/features/catalog/personas/components/panel/PersonasPanel.tsx uses usePersonaSummaries(). src/features/catalog/personas/lib/personas-panel-model.ts reads personality, scenario, backstory, and appearance, but those fields are not included by the summary projection.

Legacy packages/client/src/components/panels/PersonasPanel.tsx used full usePersonas() data for the same token estimator.

Steps to reproduce

  1. Create persona A with a short Description but long Personality, Scenario, Backstory, or Appearance fields.
  2. Create persona B with a longer Description but little or no other persona text.
  3. Open the Personas panel and sort by Tokens.
  4. Observe that ordering is based mostly on Description instead of the full persona text fields.

Impact area

  • App shell, navigation, startup, or providers
  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: refactor branch; observed on 7801a73a during #1904 target 6 Personas parityscan
  • Run mode: static parity inspection
  • OS + version: not relevant
  • Node + pnpm versions: not relevant
  • Rust version, if relevant: not relevant
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: not relevant

Logs, screenshots, or video

No runtime logs. Static evidence:

  • Refactor PersonasPanel uses usePersonaSummaries().
  • Refactor estimatePersonaTokens reads long persona fields that summaries do not include.
  • Legacy PersonasPanel used full persona rows for this estimate.

Regression notes

This worked before in legacy Marinara because the panel used full persona records from usePersonas().

Additional context

Found while auditing #1904 target 6, Personas parity coverage.

Template check

Please uncheck 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 @Xelvanis on GitHub (Jun 2, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1965 Originally assigned to: @cha1latte on GitHub. ## Summary The Personas panel token sort estimates persona size from description, personality, scenario, backstory, and appearance, but the refactor panel is fed by persona summaries that only include description from that set. Sorting by Tokens can be wrong when most text lives outside the description field. ## Expected behavior Tokens sort should estimate against the same full persona fields as legacy, or the summary projection should include the fields used by the estimator. ## Actual behavior `src/features/catalog/personas/components/panel/PersonasPanel.tsx` uses `usePersonaSummaries()`. `src/features/catalog/personas/lib/personas-panel-model.ts` reads `personality`, `scenario`, `backstory`, and `appearance`, but those fields are not included by the summary projection. Legacy `packages/client/src/components/panels/PersonasPanel.tsx` used full `usePersonas()` data for the same token estimator. ## Steps to reproduce 1. Create persona A with a short Description but long Personality, Scenario, Backstory, or Appearance fields. 2. Create persona B with a longer Description but little or no other persona text. 3. Open the Personas panel and sort by Tokens. 4. Observe that ordering is based mostly on Description instead of the full persona text fields. ## Impact area - [ ] App shell, navigation, startup, or providers - [x] Catalog resources - [ ] Chat mode - [ ] Roleplay mode - [ ] Game mode - [ ] Shared mode UI - [ ] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [ ] React-free engine behavior, contracts, agents, or capability ports - [ ] Shared API wrapper or remote runtime routing - [ ] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: refactor branch; observed on `7801a73a` during #1904 target 6 Personas parityscan - Run mode: static parity inspection - OS + version: not relevant - Node + pnpm versions: not relevant - Rust version, if relevant: not relevant - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: not relevant ## Logs, screenshots, or video No runtime logs. Static evidence: - Refactor `PersonasPanel` uses `usePersonaSummaries()`. - Refactor `estimatePersonaTokens` reads long persona fields that summaries do not include. - Legacy `PersonasPanel` used full persona rows for this estimate. ## Regression notes This worked before in legacy Marinara because the panel used full persona records from `usePersonas()`. ## Additional context Found while auditing #1904 target 6, Personas parity coverage. ## Template check Please uncheck 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 05:24:12 +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#966
No description provided.