[PR #2732] [MERGED] [codex] Fix game custom agents and Claude prefill steering #5719

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

📋 Pull Request Information

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

Base: staging ← Head: codex/game-custom-agents-claude-prefill


📝 Commits (6)

  • 19cee67 Fix game custom agents and Claude prefill steering
  • 7ae7d56 Show game custom agent picker
  • a2e97d4 Align game setup wizard shell
  • 69d0f49 Merge branch 'staging' into codex/game-custom-agents-claude-prefill
  • b938a00 Polish agent imports and appearance controls
  • 0067369 Escape Claude prefill delimiter

📊 Changes

23 files changed (+1074 additions, -359 deletions)

View changed files

📝 packages/client/src/components/agents/AgentEditor.tsx (+22 -30)
📝 packages/client/src/components/characters/CharacterLibraryView.tsx (+2 -2)
📝 packages/client/src/components/chat/ChatArea.tsx (+0 -1)
📝 packages/client/src/components/chat/ChatBranchSelector.tsx (+2 -2)
📝 packages/client/src/components/chat/ChatCommonOverlays.tsx (+0 -4)
📝 packages/client/src/components/chat/ChatConversationSurface.tsx (+0 -1)
📝 packages/client/src/components/chat/ChatFilesDrawer.tsx (+3 -3)
📝 packages/client/src/components/chat/ChatRoleplaySurface.tsx (+2 -1)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+89 -68)
📝 packages/client/src/components/chat/ConversationView.tsx (+3 -1)
📝 packages/client/src/components/chat/PinnedImageOverlay.tsx (+1 -1)
📝 packages/client/src/components/game/GameSetupWizard.tsx (+155 -77)
📝 packages/client/src/components/layout/ChatSidebar.tsx (+1 -1)
📝 packages/client/src/components/panels/AgentsPanel.tsx (+105 -60)
📝 packages/client/src/components/panels/SettingsPanel.tsx (+226 -71)
📝 packages/client/src/lib/agent-transfer.ts (+69 -0)
📝 packages/client/src/lib/download-zip.ts (+1 -1)
➕ packages/client/src/lib/extension-transfer.ts (+65 -0)
➕ packages/client/src/lib/folder-package-transfer.ts (+147 -0)
📝 packages/client/src/lib/read-zip-text.ts (+86 -21)

...and 3 more files

📄 Description

Linked issue

Fixes #2678

Custom agent game-mode support is a maintainer-requested follow-up from this thread.

Why this change

  • Game chats should let users attach and manage custom agents like conversation chats do.
  • Claude Subscription was losing assistant-prefill steering by storing the prefill as a completed assistant JSONL turn, then sending a raw synthetic (continue) user prompt.

What changed

  • Adding an agent now enables the chat agent pipeline and game mode shows active custom-agent settings/removal controls.
  • Claude Subscription resume now strips trailing assistant prefill from JSONL history and sends a synthetic continuation instruction that preserves the prefill steering without asking Claude to repeat it.
  • Claude Subscription fold fallback uses the same continuation instruction, and resume emits a warn-level breadcrumb when this approximation is used.

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

  • Ran pnpm --filter @marinara-engine/client lint.
  • Ran pnpm --filter @marinara-engine/client build successfully; this shell warns that Node 20.11.1 is below the repo engine/Vite-supported version.
  • Ran pnpm --filter @marinara-engine/server lint.
  • Ran a focused tsx assertion proving Claude Subscription prefill split removes the trailing assistant from resume history and preserves the prefill in the continuation prompt.
  • Ran git diff --check.
  • Tried pnpm --filter @marinara-engine/server test; it failed before running tests because the configured test glob could not find packages/server/src/services/image/__tests__/*.test.ts in this checkout.

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)

Not captured. The game custom-agent change is a Chat Settings UI flow and still needs browser click-through before review is marked complete.

Summary by CodeRabbit

  • New Features

    • Agents automatically enable in chat settings when adding a new agent
  • Improvements

    • Updated agent toggle descriptions to explicitly reference scene analysis and custom agents
    • Enhanced Claude assistant continuation prompt handling for improved response generation

🔄 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/2732 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 6/21/2026 **Status:** ✅ Merged **Merged:** 6/21/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `codex/game-custom-agents-claude-prefill` --- ### 📝 Commits (6) - [`19cee67`](https://github.com/Pasta-Devs/Marinara-Engine/commit/19cee67310dca75e08922a8917fcf42b979c2c4f) Fix game custom agents and Claude prefill steering - [`7ae7d56`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7ae7d5610ae830e1c7f67fafd37935396d470f08) Show game custom agent picker - [`a2e97d4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a2e97d427ce863e7dfc9e51b9e8b3d69d280cc72) Align game setup wizard shell - [`69d0f49`](https://github.com/Pasta-Devs/Marinara-Engine/commit/69d0f49bdaebb4cfe71591e4cfe695d3b3fde0e9) Merge branch 'staging' into codex/game-custom-agents-claude-prefill - [`b938a00`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b938a008a0386aef7439bc69cd58145d0a80fe4d) Polish agent imports and appearance controls - [`0067369`](https://github.com/Pasta-Devs/Marinara-Engine/commit/00673694e31f032d09e3b345c76aa61917d9fdc6) Escape Claude prefill delimiter ### 📊 Changes **23 files changed** (+1074 additions, -359 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/agents/AgentEditor.tsx` (+22 -30) 📝 `packages/client/src/components/characters/CharacterLibraryView.tsx` (+2 -2) 📝 `packages/client/src/components/chat/ChatArea.tsx` (+0 -1) 📝 `packages/client/src/components/chat/ChatBranchSelector.tsx` (+2 -2) 📝 `packages/client/src/components/chat/ChatCommonOverlays.tsx` (+0 -4) 📝 `packages/client/src/components/chat/ChatConversationSurface.tsx` (+0 -1) 📝 `packages/client/src/components/chat/ChatFilesDrawer.tsx` (+3 -3) 📝 `packages/client/src/components/chat/ChatRoleplaySurface.tsx` (+2 -1) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+89 -68) 📝 `packages/client/src/components/chat/ConversationView.tsx` (+3 -1) 📝 `packages/client/src/components/chat/PinnedImageOverlay.tsx` (+1 -1) 📝 `packages/client/src/components/game/GameSetupWizard.tsx` (+155 -77) 📝 `packages/client/src/components/layout/ChatSidebar.tsx` (+1 -1) 📝 `packages/client/src/components/panels/AgentsPanel.tsx` (+105 -60) 📝 `packages/client/src/components/panels/SettingsPanel.tsx` (+226 -71) 📝 `packages/client/src/lib/agent-transfer.ts` (+69 -0) 📝 `packages/client/src/lib/download-zip.ts` (+1 -1) ➕ `packages/client/src/lib/extension-transfer.ts` (+65 -0) ➕ `packages/client/src/lib/folder-package-transfer.ts` (+147 -0) 📝 `packages/client/src/lib/read-zip-text.ts` (+86 -21) _...and 3 more files_ </details> ### 📄 Description ## Linked issue Fixes #2678 Custom agent game-mode support is a maintainer-requested follow-up from this thread. ## Why this change - Game chats should let users attach and manage custom agents like conversation chats do. - Claude Subscription was losing assistant-prefill steering by storing the prefill as a completed assistant JSONL turn, then sending a raw synthetic `(continue)` user prompt. ## What changed - Adding an agent now enables the chat agent pipeline and game mode shows active custom-agent settings/removal controls. - Claude Subscription resume now strips trailing assistant prefill from JSONL history and sends a synthetic continuation instruction that preserves the prefill steering without asking Claude to repeat it. - Claude Subscription fold fallback uses the same continuation instruction, and resume emits a warn-level breadcrumb when this approximation is used. ## 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 - Ran `pnpm --filter @marinara-engine/client lint`. - Ran `pnpm --filter @marinara-engine/client build` successfully; this shell warns that Node `20.11.1` is below the repo engine/Vite-supported version. - Ran `pnpm --filter @marinara-engine/server lint`. - Ran a focused `tsx` assertion proving Claude Subscription prefill split removes the trailing assistant from resume history and preserves the prefill in the continuation prompt. - Ran `git diff --check`. - Tried `pnpm --filter @marinara-engine/server test`; it failed before running tests because the configured test glob could not find `packages/server/src/services/image/__tests__/*.test.ts` in this checkout. ## 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) Not captured. The game custom-agent change is a Chat Settings UI flow and still needs browser click-through before review is marked complete. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Agents automatically enable in chat settings when adding a new agent * **Improvements** * Updated agent toggle descriptions to explicitly reference scene analysis and custom agents * Enhanced Claude assistant continuation prompt handling for improved response generation <!-- 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-22 04:18:49 +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#5719
No description provided.