[PR #976] [MERGED] Fix lorebook semantic search opt-in #4868

Closed
opened 2026-10-22 04:11:18 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/976
Author: @cha1latte
Created: 5/18/2026
Status: ✅ Merged
Merged: 5/18/2026
Merged by: @cha1latte

Base: staging ← Head: fix/issue-966-lorebook-embedding-none


📝 Commits (1)

  • 7af8d4f Fix lorebook semantic search opt-in

📊 Changes

3 files changed (+14 additions, -16 deletions)

View changed files

➕ docs/pr-evidence/issue-966-after.png (+0 -0)
📝 packages/client/src/components/lorebooks/LorebookEditor.tsx (+10 -9)
📝 packages/server/src/routes/generate.routes.ts (+4 -7)

📄 Description

Linked issue

Closes #966

Why this change

  • Users could not opt out of lorebook semantic-search vectorization because generation automatically warmed missing lorebook entry embeddings whenever an embedding source was available, and the editor preselected the first embedding connection.

What changed

  • Removed the generation-time warm-up call that created missing lorebook entry embeddings automatically.
  • Only compute chat-context embeddings for semantic lorebook matching when at least one active lorebook entry already has an embedding.
  • Added a No semantic search option to the lorebook editor and disabled manual vectorization until the user chooses an embedding connection.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Codex proof: node scratch/issue-966-lorebook-auto-vectorization-proof.mjs now reports no warmLorebookEntryEmbeddings call in the generation route, no any-active-entry embedding computation, and an existing-embedding gate for chat embeddings.
  • Browser proof: C:\Users\celia\AppData\Local\Programs\Python\Python310\python.exe scratch\issue-966-ui-proof.py created a temporary fake embedding connection and lorebook, opened the real app, verified No semantic search is selected by default, verified the vectorize button is disabled until opt-in, then selected the fake embedding connection and verified the manual Vectorize 1 missing action becomes enabled.
  • Baseline: pnpm check passed locally after rerunning with a longer timeout.
  • Bunny review: passed for the current diff before opening this draft PR.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Before, from the issue report:

Before: issue screenshot showing the semantic search dropdown stuck on the sidecar

After, from Codex browser proof:

After: lorebook semantic search defaults to No semantic search


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/976 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/18/2026 **Status:** ✅ Merged **Merged:** 5/18/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `staging` ← **Head:** `fix/issue-966-lorebook-embedding-none` --- ### 📝 Commits (1) - [`7af8d4f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7af8d4f5ea2754d743811d812c75c8053d43475c) Fix lorebook semantic search opt-in ### 📊 Changes **3 files changed** (+14 additions, -16 deletions) <details> <summary>View changed files</summary> ➕ `docs/pr-evidence/issue-966-after.png` (+0 -0) 📝 `packages/client/src/components/lorebooks/LorebookEditor.tsx` (+10 -9) 📝 `packages/server/src/routes/generate.routes.ts` (+4 -7) </details> ### 📄 Description <!-- Target branch: `staging`. The default base in this UI is `main` (release branch). --> <!-- Change the base to `staging` before submitting unless this is a maintainer-approved mainline change. --> <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue <!-- Every PR should reference a feature request or issue report. If there isn't one yet, open one first to gather opinions: --> <!-- https://github.com/Pasta-Devs/Marinara-Engine/issues/new/choose --> Closes #966 ## Why this change <!-- What user problem, bug, or goal does this solve? --> - Users could not opt out of lorebook semantic-search vectorization because generation automatically warmed missing lorebook entry embeddings whenever an embedding source was available, and the editor preselected the first embedding connection. ## What changed <!-- List the key changes in this PR --> - Removed the generation-time warm-up call that created missing lorebook entry embeddings automatically. - Only compute chat-context embeddings for semantic lorebook matching when at least one active lorebook entry already has an embedding. - Added a `No semantic search` option to the lorebook editor and disabled manual vectorization until the user chooses an embedding connection. ## Validation <!-- Required: include commands run and/or manual checks performed --> - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes <!-- Describe exactly what you tested in a real browser/app, step by step. --> <!-- ⚠️ If an AI agent filled out or ticked these boxes for you, treat them --> <!-- as a TO-DO LIST, not as proof the work is done. Verify each item yourself --> <!-- before submitting. If you haven't verified it, untick the box. --> - Codex proof: `node scratch/issue-966-lorebook-auto-vectorization-proof.mjs` now reports no `warmLorebookEntryEmbeddings` call in the generation route, no any-active-entry embedding computation, and an existing-embedding gate for chat embeddings. - Browser proof: `C:\Users\celia\AppData\Local\Programs\Python\Python310\python.exe scratch\issue-966-ui-proof.py` created a temporary fake embedding connection and lorebook, opened the real app, verified `No semantic search` is selected by default, verified the vectorize button is disabled until opt-in, then selected the fake embedding connection and verified the manual `Vectorize 1 missing` action becomes enabled. - Baseline: `pnpm check` passed locally after rerunning with a longer timeout. - Bunny review: passed for the current diff before opening this draft PR. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) <!-- Add before/after screenshots or recordings for UI changes --> Before, from the issue report: ![Before: issue screenshot showing the semantic search dropdown stuck on the sidecar](https://github.com/user-attachments/assets/51950446-e778-4b47-98f7-f81ee4f19c00) After, from Codex browser proof: ![After: lorebook semantic search defaults to No semantic search](https://raw.githubusercontent.com/cha1latte/Marinara-Engine/7af8d4f5ea2754d743811d812c75c8053d43475c/docs/pr-evidence/issue-966-after.png) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:11:18 +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#4868
No description provided.