[GH-ISSUE #1926] [Issue]: Active World Info semantic scan runs while toolbar button is closed #944

Closed
opened 2026-10-21 05:23:54 +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/1926

Originally assigned to: @Xelvanis on GitHub.

Summary

Opening or switching into a chat can run the Active World Info semantic lorebook scan while the world-info panel is closed. After the semantic active-lorebook changes, that hidden scan can resolve the generation connection and call the embedding provider, which makes the app feel slower on chats with vectorized lorebook entries.

Expected behavior

The chat toolbar button should be cheap while closed. Expensive semantic lorebook scans and embedding-provider calls should only run when the user opens Active World Info, explicitly refreshes it, or another generation path needs semantic lore context.

Actual behavior

ActiveWorldInfoButton always enables useActiveLorebookEntries(chatId, true) on mount. The active lorebook query now builds an embedding source and passes it into scanActiveLorebookEntries, so scanActiveLorebooks may embed the last 10 messages whenever vectorized lorebook entries exist.

Relevant paths:

  • src/features/runtime/visuals/components/ActiveWorldInfoButton.tsx: mounted toolbar button runs useActiveLorebookEntries(chatId, true) even while closed.
  • src/features/catalog/lorebooks/hooks/use-lorebooks.ts: active scan resolves generation connection and passes llmApi.embed as embeddingSource.
  • src/engine/generation/active-lorebook-scanner.ts: semantic scan embeds the current query text when vectorized entries exist.
  • src/features/modes/conversation/components/ConversationView.tsx, src/features/modes/roleplay/components/ChatRoleplaySurface.tsx, and src/features/modes/game/components/GameSurface.tsx: toolbar surfaces mount the button during normal chat/game use.

A secondary pressure point is src/features/catalog/lorebooks/lib/lorebook-keeper-updates.ts, where Lorebook Keeper applies now auto-vectorize touched entries. That may add post-generation provider/storage work when keeper updates are applied automatically.

Steps to reproduce

  1. Use a refactor-branch build that includes 5bc459c9 (Fix semantic active lorebook scan) and 9f397c6f (Auto-vectorize Lorebook Keeper updates).
  2. Configure a chat with at least one scoped lorebook containing vectorized entries.
  3. Configure an embedding-capable connection.
  4. Open or switch into a conversation, roleplay, or game chat on desktop.
  5. Observe that the Active World Info query can run before the panel is opened, including semantic embedding work.

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
  • 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-line checkout containing 5bc459c9, 9f397c6f, current observed head 8bd1d0ba
  • Run mode: Tauri desktop suspected; static trace only so far
  • OS + version: not captured
  • Node + pnpm versions: not captured
  • Rust version, if relevant: not captured
  • Remote Runtime URL configured? not captured
  • Provider, model, or integration, if relevant: embedding-capable connection with vectorized lorebook entries

Logs, screenshots, or video

No runtime profile captured yet. Static trace points to hidden active-world-info semantic scan and keeper auto-vectorization as likely slowdown sources.

Regression notes

Likely regression from 5bc459c9, which made the existing always-enabled active lorebook query capable of semantic embedding. 9f397c6f may compound post-generation work by auto-vectorizing Lorebook Keeper changes.

Suggested fix direction: keep the closed toolbar button cheap, then run semantic active-lorebook scans only on panel open or explicit refresh. A keyword-only/count-only closed state, plus caching keyed by chat id and recent message ids, should preserve the indicator without hidden provider calls.

Additional context

This is not a confirmed runtime profile yet. The issue is filed from code-path inspection after reports that the app feels slower after the recent commits.

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/1926 Originally assigned to: @Xelvanis on GitHub. ## Summary Opening or switching into a chat can run the Active World Info semantic lorebook scan while the world-info panel is closed. After the semantic active-lorebook changes, that hidden scan can resolve the generation connection and call the embedding provider, which makes the app feel slower on chats with vectorized lorebook entries. ## Expected behavior The chat toolbar button should be cheap while closed. Expensive semantic lorebook scans and embedding-provider calls should only run when the user opens Active World Info, explicitly refreshes it, or another generation path needs semantic lore context. ## Actual behavior `ActiveWorldInfoButton` always enables `useActiveLorebookEntries(chatId, true)` on mount. The active lorebook query now builds an embedding source and passes it into `scanActiveLorebookEntries`, so `scanActiveLorebooks` may embed the last 10 messages whenever vectorized lorebook entries exist. Relevant paths: - `src/features/runtime/visuals/components/ActiveWorldInfoButton.tsx`: mounted toolbar button runs `useActiveLorebookEntries(chatId, true)` even while closed. - `src/features/catalog/lorebooks/hooks/use-lorebooks.ts`: active scan resolves generation connection and passes `llmApi.embed` as `embeddingSource`. - `src/engine/generation/active-lorebook-scanner.ts`: semantic scan embeds the current query text when vectorized entries exist. - `src/features/modes/conversation/components/ConversationView.tsx`, `src/features/modes/roleplay/components/ChatRoleplaySurface.tsx`, and `src/features/modes/game/components/GameSurface.tsx`: toolbar surfaces mount the button during normal chat/game use. A secondary pressure point is `src/features/catalog/lorebooks/lib/lorebook-keeper-updates.ts`, where Lorebook Keeper applies now auto-vectorize touched entries. That may add post-generation provider/storage work when keeper updates are applied automatically. ## Steps to reproduce 1. Use a refactor-branch build that includes `5bc459c9` (`Fix semantic active lorebook scan`) and `9f397c6f` (`Auto-vectorize Lorebook Keeper updates`). 2. Configure a chat with at least one scoped lorebook containing vectorized entries. 3. Configure an embedding-capable connection. 4. Open or switch into a conversation, roleplay, or game chat on desktop. 5. Observe that the Active World Info query can run before the panel is opened, including semantic embedding work. ## Impact area - [ ] App shell, navigation, startup, or providers - [x] Catalog resources - [x] Chat mode - [x] Roleplay mode - [x] Game mode - [x] Shared mode UI - [x] Runtime systems: generation, world-state, visuals, tracker, or haptics - [x] 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: refactor-line checkout containing `5bc459c9`, `9f397c6f`, current observed head `8bd1d0ba` - Run mode: Tauri desktop suspected; static trace only so far - OS + version: not captured - Node + pnpm versions: not captured - Rust version, if relevant: not captured - Remote Runtime URL configured? not captured - Provider, model, or integration, if relevant: embedding-capable connection with vectorized lorebook entries ## Logs, screenshots, or video No runtime profile captured yet. Static trace points to hidden active-world-info semantic scan and keeper auto-vectorization as likely slowdown sources. ## Regression notes Likely regression from `5bc459c9`, which made the existing always-enabled active lorebook query capable of semantic embedding. `9f397c6f` may compound post-generation work by auto-vectorizing Lorebook Keeper changes. Suggested fix direction: keep the closed toolbar button cheap, then run semantic active-lorebook scans only on panel open or explicit refresh. A keyword-only/count-only closed state, plus caching keyed by chat id and recent message ids, should preserve the indicator without hidden provider calls. ## Additional context This is not a confirmed runtime profile yet. The issue is filed from code-path inspection after reports that the app feels slower after the recent commits. ## 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:23:54 +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#944
No description provided.