[GH-ISSUE #2030] [Issue]: Memory Recall rebuild ignores legacy hiddenFromAI flag #993

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

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

Originally assigned to: @cha1latte on GitHub.

Summary

Memory Recall refresh filters hidden messages through is_hidden_from_ai, but the Rust helper only checks extra.hiddenFromAi. Legacy/imported messages and some persisted swipe extras use the canonical hiddenFromAI key, so refresh can include hidden content in generated memory chunks.

Expected behavior

Memory Recall refresh should skip messages where either extra.hiddenFromAI === true or extra.hiddenFromAi === true, matching current prompt assembly and UI reads.

Actual behavior

src-tauri/src/commands/storage/chats.rs:260-272 only reads hiddenFromAi. refresh_chat_memories uses that helper at src-tauri/src/commands/storage/chats.rs:711-713, so a message carrying only hiddenFromAI is treated as visible.

Steps to reproduce

  1. Store or import a chat message with extra: {"hiddenFromAI": true} and no hiddenFromAi alias.
  2. Run Memory Recall refresh through chat_memories_refresh / refresh_chat_memories.
  3. The hidden message remains eligible for memory chunks.

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: current Target 2 parityscan branch at f56efb20
  • Run mode: Tauri/Rust storage static trace and focused test filters
  • OS + version: not run as app repro
  • Node + pnpm versions: not relevant
  • Rust version, if relevant: local cargo test runner
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: Memory Recall embeddings/content path

Logs, screenshots, or video

Code evidence:

  • Legacy UI toggle writes only hiddenFromAI: origin/main:packages/client/src/components/chat/ChatArea.tsx:1064.
  • Legacy prompt helper checks only hiddenFromAI: origin/main:packages/server/src/routes/generate/generate-route-utils.ts:127-128.
  • Legacy chat routes/storage sync hiddenFromAI to message and swipe extras: origin/main:packages/server/src/routes/chats.routes.ts:1121-1126, origin/main:packages/server/src/services/storage/chats.storage.ts:667-693.
  • Current TS generation helper already accepts both aliases: src/engine/generation/runtime-records.ts:74-76.
  • Current Rust Memory Recall helper checks only hiddenFromAi: src-tauri/src/commands/storage/chats.rs:260-272; refresh uses it at src-tauri/src/commands/storage/chats.rs:711-713.

Focused proof run:

  • cargo test --manifest-path src-tauri/Cargo.toml chat_memor -> 0 matched, so no focused test currently catches this path.

Regression notes

Legacy v1.6.1 used hiddenFromAI as the prompt-context exclusion flag. The refactor UI and generation helpers already treat both alias spellings as hidden, but the Rust Memory Recall refresh path does not.

Additional context

Found during Target 2 storage parityscan batch 3, chat/message storage. This is separate from #1923 sidecar storage shape; #1923 is covered on the current branch but not merged yet.

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 3, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2030 Originally assigned to: @cha1latte on GitHub. ## Summary Memory Recall refresh filters hidden messages through `is_hidden_from_ai`, but the Rust helper only checks `extra.hiddenFromAi`. Legacy/imported messages and some persisted swipe extras use the canonical `hiddenFromAI` key, so refresh can include hidden content in generated memory chunks. ## Expected behavior Memory Recall refresh should skip messages where either `extra.hiddenFromAI === true` or `extra.hiddenFromAi === true`, matching current prompt assembly and UI reads. ## Actual behavior `src-tauri/src/commands/storage/chats.rs:260-272` only reads `hiddenFromAi`. `refresh_chat_memories` uses that helper at `src-tauri/src/commands/storage/chats.rs:711-713`, so a message carrying only `hiddenFromAI` is treated as visible. ## Steps to reproduce 1. Store or import a chat message with `extra: {"hiddenFromAI": true}` and no `hiddenFromAi` alias. 2. Run Memory Recall refresh through `chat_memories_refresh` / `refresh_chat_memories`. 3. The hidden message remains eligible for memory chunks. ## Impact area - [ ] App shell, navigation, startup, or providers - [ ] Catalog resources - [x] Chat mode - [ ] Roleplay mode - [ ] Game mode - [ ] Shared mode UI - [x] 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 - [x] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: current Target 2 parityscan branch at `f56efb20` - Run mode: Tauri/Rust storage static trace and focused test filters - OS + version: not run as app repro - Node + pnpm versions: not relevant - Rust version, if relevant: local cargo test runner - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: Memory Recall embeddings/content path ## Logs, screenshots, or video Code evidence: - Legacy UI toggle writes only `hiddenFromAI`: `origin/main:packages/client/src/components/chat/ChatArea.tsx:1064`. - Legacy prompt helper checks only `hiddenFromAI`: `origin/main:packages/server/src/routes/generate/generate-route-utils.ts:127-128`. - Legacy chat routes/storage sync `hiddenFromAI` to message and swipe extras: `origin/main:packages/server/src/routes/chats.routes.ts:1121-1126`, `origin/main:packages/server/src/services/storage/chats.storage.ts:667-693`. - Current TS generation helper already accepts both aliases: `src/engine/generation/runtime-records.ts:74-76`. - Current Rust Memory Recall helper checks only `hiddenFromAi`: `src-tauri/src/commands/storage/chats.rs:260-272`; refresh uses it at `src-tauri/src/commands/storage/chats.rs:711-713`. Focused proof run: - `cargo test --manifest-path src-tauri/Cargo.toml chat_memor` -> 0 matched, so no focused test currently catches this path. ## Regression notes Legacy v1.6.1 used `hiddenFromAI` as the prompt-context exclusion flag. The refactor UI and generation helpers already treat both alias spellings as hidden, but the Rust Memory Recall refresh path does not. ## Additional context Found during Target 2 storage parityscan batch 3, chat/message storage. This is separate from #1923 sidecar storage shape; #1923 is covered on the current branch but not merged yet. ## 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:55 +07:00
  • closed this issue
  • added the
    bug
    label
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#993
No description provided.