[PR #5189] [MERGED] Add native Beholder Roleplay integration #6666

Closed
opened 2026-10-23 04:12:34 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5189
Author: @SpicyMarinara
Created: 8/17/2026
Status: ✅ Merged
Merged: 8/17/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feature/5188-beholder


📝 Commits (4)

  • 2e20360 chore: start Beholder host integration
  • 79b8766 feat: integrate Beholder roleplay agent
  • 764cafa fix: address Beholder integration review
  • b9c34ee test: cover empty Beholder history

📊 Changes

15 files changed (+731 additions, -32 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 docs/agents/built-in-agents.md (+12 -2)
➕ packages/client/src/components/chat/BeholderChatSettingsPanel.tsx (+166 -0)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+18 -0)
📝 packages/client/src/localization/locales/en.json (+20 -0)
📝 packages/server/src/routes/agents.routes.ts (+11 -0)
📝 packages/server/src/routes/chats.routes.ts (+20 -8)
📝 packages/server/src/routes/generate.routes.ts (+12 -0)
📝 packages/server/src/routes/generate/dry-run-route.ts (+21 -10)
📝 packages/server/src/routes/generate/retry-agents-route.ts (+17 -1)
📝 packages/server/src/services/agents/agent-executor.ts (+13 -0)
➕ packages/server/src/services/agents/beholder-state.ts (+264 -0)
📝 packages/server/src/services/generation/committed-tracker-context.ts (+22 -3)
📝 packages/server/src/services/storage/agents.storage.ts (+14 -3)
📝 scripts/regressions/prompt.regression.ts (+120 -5)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.

Linked issue

Closes #5188

Paired package: Pasta-Devs/Marinara-Agents#402
Docs translation follow-up: #5190

Why this change

  • Beholder previously depended on a legacy extension shim with its own DOM injection, polling, local storage, and compatibility surface.
  • The official Agent needs to use Engine-owned execution, storage, prompt context, retry, and Roleplay settings without weakening extension or import support.

What changed

  • Added bounded validation and prompt formatting for Beholder's full physical-state snapshots.
  • Loads the previous valid snapshot for normal Roleplay generation and manual Agent retries, while excluding the response being regenerated.
  • Injects the latest state into the next main response and mirrors it in prompt preview and dry-run assembly.
  • Added a read-only state endpoint and a lazy native Chat Settings drawer with the SOTA-model warning, latest per-character state, and a link to the standard Agent editor.
  • Isolates Beholder from unrelated batched Agent calls and parses its response as structured JSON.
  • Added user documentation, attribution, changelog coverage, and focused prompt regressions.

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

  • Automated evidence: pnpm check passed, including localization, Prettier, ESLint, TypeScript, server build, and production client build.
  • Automated evidence: pnpm regression:prompt passed, including prior-state handoff, structured JSON parsing, invalid-slot rejection, prompt-context injection without a game-state row, and the existing prompt suites.
  • The in-app preview browser was unavailable in this session. Manually verify install → add Beholder to a Roleplay → generate → inspect latest physical state → disable/re-enable → open Configure Beholder, in both narrow and desktop drawers.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

  • The drawer is code-split as BeholderChatSettingsPanel and the production bundle completed successfully.
  • Manual visual evidence remains requested above because the in-app preview browser was unavailable.

Summary by CodeRabbit

  • New Features
    • Added Beholder as an official downloadable, roleplay-only agent for tracking character physical state.
    • Tracks clothing, held items, wounds, damage, missing or bare body parts, and species.
    • Preserves validated physical-state snapshots across conversations, retries, and regenerated responses.
    • Added Chat Settings access to view character condition, equipment, wounds, and status.
  • Documentation
    • Updated the built-in agent guide with Beholder details and expanded tracker coverage.
  • Bug Fixes
    • Improved handling of incomplete or invalid physical-state data.

🔄 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/5189 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 8/17/2026 **Status:** ✅ Merged **Merged:** 8/17/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feature/5188-beholder` --- ### 📝 Commits (4) - [`2e20360`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2e2036022c7666bd9a65f54ab4683cbc43407bf9) chore: start Beholder host integration - [`79b8766`](https://github.com/Pasta-Devs/Marinara-Engine/commit/79b87663b3e5d8d10185543520a139518ee2d448) feat: integrate Beholder roleplay agent - [`764cafa`](https://github.com/Pasta-Devs/Marinara-Engine/commit/764cafabba903f893d349a0045da5af5f017b62d) fix: address Beholder integration review - [`b9c34ee`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b9c34eeabb52fe296dab4e54d0eac6e2d1c2b905) test: cover empty Beholder history ### 📊 Changes **15 files changed** (+731 additions, -32 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `docs/agents/built-in-agents.md` (+12 -2) ➕ `packages/client/src/components/chat/BeholderChatSettingsPanel.tsx` (+166 -0) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+18 -0) 📝 `packages/client/src/localization/locales/en.json` (+20 -0) 📝 `packages/server/src/routes/agents.routes.ts` (+11 -0) 📝 `packages/server/src/routes/chats.routes.ts` (+20 -8) 📝 `packages/server/src/routes/generate.routes.ts` (+12 -0) 📝 `packages/server/src/routes/generate/dry-run-route.ts` (+21 -10) 📝 `packages/server/src/routes/generate/retry-agents-route.ts` (+17 -1) 📝 `packages/server/src/services/agents/agent-executor.ts` (+13 -0) ➕ `packages/server/src/services/agents/beholder-state.ts` (+264 -0) 📝 `packages/server/src/services/generation/committed-tracker-context.ts` (+22 -3) 📝 `packages/server/src/services/storage/agents.storage.ts` (+14 -3) 📝 `scripts/regressions/prompt.regression.ts` (+120 -5) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. ## Linked issue Closes #5188 Paired package: Pasta-Devs/Marinara-Agents#402 Docs translation follow-up: #5190 ## Why this change - Beholder previously depended on a legacy extension shim with its own DOM injection, polling, local storage, and compatibility surface. - The official Agent needs to use Engine-owned execution, storage, prompt context, retry, and Roleplay settings without weakening extension or import support. ## What changed - Added bounded validation and prompt formatting for Beholder's full physical-state snapshots. - Loads the previous valid snapshot for normal Roleplay generation and manual Agent retries, while excluding the response being regenerated. - Injects the latest state into the next main response and mirrors it in prompt preview and dry-run assembly. - Added a read-only state endpoint and a lazy native Chat Settings drawer with the SOTA-model warning, latest per-character state, and a link to the standard Agent editor. - Isolates Beholder from unrelated batched Agent calls and parses its response as structured JSON. - Added user documentation, attribution, changelog coverage, and focused prompt regressions. ## 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 - Automated evidence: `pnpm check` passed, including localization, Prettier, ESLint, TypeScript, server build, and production client build. - Automated evidence: `pnpm regression:prompt` passed, including prior-state handoff, structured JSON parsing, invalid-slot rejection, prompt-context injection without a game-state row, and the existing prompt suites. - The in-app preview browser was unavailable in this session. Manually verify install → add Beholder to a Roleplay → generate → inspect latest physical state → disable/re-enable → open Configure Beholder, in both narrow and desktop drawers. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) - The drawer is code-split as `BeholderChatSettingsPanel` and the production bundle completed successfully. - Manual visual evidence remains requested above because the in-app preview browser was unavailable. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added Beholder as an official downloadable, roleplay-only agent for tracking character physical state. - Tracks clothing, held items, wounds, damage, missing or bare body parts, and species. - Preserves validated physical-state snapshots across conversations, retries, and regenerated responses. - Added Chat Settings access to view character condition, equipment, wounds, and status. - **Documentation** - Updated the built-in agent guide with Beholder details and expanded tracker coverage. - **Bug Fixes** - Improved handling of incomplete or invalid physical-state data. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:12:34 +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#6666
No description provided.