[PR #2549] [MERGED] Fix thinking tags and Game lorebook scan context #5649

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2549
Author: @SpicyMarinara
Created: 6/13/2026
Status: ✅ Merged
Merged: 6/13/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/issues-2544-2548-thinking-game-lorebooks


📝 Commits (1)

  • 092e73c Fix thinking tags and game lorebook scans

📊 Changes

12 files changed (+509 additions, -151 deletions)

View changed files

📝 packages/client/src/components/ui/GenerationParametersEditor.tsx (+111 -1)
📝 packages/client/src/hooks/use-generate.ts (+66 -62)
📝 packages/server/src/routes/game.routes.ts (+30 -9)
📝 packages/server/src/routes/generate.routes.ts (+35 -22)
📝 packages/server/src/routes/generate/generate-route-utils.ts (+4 -0)
📝 packages/server/src/routes/lorebooks.routes.ts (+20 -1)
📝 packages/server/src/services/llm/inline-thinking.ts (+2 -56)
📝 packages/shared/src/constants/defaults.ts (+1 -0)
📝 packages/shared/src/index.ts (+1 -0)
📝 packages/shared/src/schemas/prompt.schema.ts (+9 -0)
📝 packages/shared/src/types/prompt.ts (+4 -0)
➕ packages/shared/src/utils/thinking-tags.ts (+226 -0)

📄 Description

Summary

  • Add shared inline-thinking tag handling with built-in bracket tags like [THINK]...[/THINK] plus custom Thinking Tags in Advanced Parameters.
  • Use the shared filter for streamed output and final server cleanup so raw thinking tags do not flash into chat before being moved to thoughts.
  • Align Game-mode Active World Info scans with the same latest visible Game state used by generation, while preserving Game lorebook character/persona scoping.

Fixes #2544
Fixes #2548

Local Validation

Run locally:

  • pnpm check
  • Node smoke check for [THINK] extraction and chunked custom thinking-tag streaming

Manual Verification

  • Manually verify custom Thinking Tags in Conversation Chat Settings.
  • Manually verify custom Thinking Tags in Roleplay Chat Settings.
  • Manually verify custom Thinking Tags in Game setup/settings.
  • Manually verify Active World Info in Game mode matches generation behavior for Game-state-gated lorebook entries.

🔄 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/2549 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 6/13/2026 **Status:** ✅ Merged **Merged:** 6/13/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/issues-2544-2548-thinking-game-lorebooks` --- ### 📝 Commits (1) - [`092e73c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/092e73cf7b3f13d8d1dd1b8adebb06ef05a45e0c) Fix thinking tags and game lorebook scans ### 📊 Changes **12 files changed** (+509 additions, -151 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/ui/GenerationParametersEditor.tsx` (+111 -1) 📝 `packages/client/src/hooks/use-generate.ts` (+66 -62) 📝 `packages/server/src/routes/game.routes.ts` (+30 -9) 📝 `packages/server/src/routes/generate.routes.ts` (+35 -22) 📝 `packages/server/src/routes/generate/generate-route-utils.ts` (+4 -0) 📝 `packages/server/src/routes/lorebooks.routes.ts` (+20 -1) 📝 `packages/server/src/services/llm/inline-thinking.ts` (+2 -56) 📝 `packages/shared/src/constants/defaults.ts` (+1 -0) 📝 `packages/shared/src/index.ts` (+1 -0) 📝 `packages/shared/src/schemas/prompt.schema.ts` (+9 -0) 📝 `packages/shared/src/types/prompt.ts` (+4 -0) ➕ `packages/shared/src/utils/thinking-tags.ts` (+226 -0) </details> ### 📄 Description ## Summary - Add shared inline-thinking tag handling with built-in bracket tags like `[THINK]...[/THINK]` plus custom Thinking Tags in Advanced Parameters. - Use the shared filter for streamed output and final server cleanup so raw thinking tags do not flash into chat before being moved to thoughts. - Align Game-mode Active World Info scans with the same latest visible Game state used by generation, while preserving Game lorebook character/persona scoping. Fixes #2544 Fixes #2548 ## Local Validation Run locally: - `pnpm check` - Node smoke check for `[THINK]` extraction and chunked custom thinking-tag streaming ## Manual Verification - [ ] Manually verify custom Thinking Tags in Conversation Chat Settings. - [ ] Manually verify custom Thinking Tags in Roleplay Chat Settings. - [ ] Manually verify custom Thinking Tags in Game setup/settings. - [ ] Manually verify Active World Info in Game mode matches generation behavior for Game-state-gated lorebook entries. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:18:07 +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#5649
No description provided.