[PR #3109] [MERGED] Fix assigned chat and Immersive HTML issues #5799

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

📋 Pull Request Information

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

Base: staging ← Head: codex/assigned-issues-3087-3094


📝 Commits (5)

  • f5a8834 Resolve assigned chat and agent issues
  • 3655d89 Preserve blockquote delimiters in XML prompts
  • 2a2b234 Keep configured model in provider requests
  • 6983e91 Migrate legacy Immersive HTML defaults
  • b3c4e66 Bundle built-in rewrite agents

📊 Changes

27 files changed (+566 additions, -201 deletions)

View changed files

📝 CHANGELOG.md (+7 -0)
📝 packages/client/src/components/agents/AgentEditor.tsx (+27 -2)
📝 packages/client/src/components/chat/AgentAddSetupFields.tsx (+4 -3)
📝 packages/client/src/components/chat/ChatArea.tsx (+4 -2)
📝 packages/client/src/components/chat/ChatInput.tsx (+47 -2)
📝 packages/client/src/components/chat/ChatRoleplaySurface.tsx (+31 -0)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+42 -1)
📝 packages/client/src/components/chat/ConversationInput.tsx (+51 -2)
📝 packages/client/src/components/chat/ConversationView.tsx (+21 -1)
📝 packages/client/src/hooks/use-generate.ts (+5 -4)
📝 packages/client/src/lib/generation-parameter-errors.ts (+3 -0)
📝 packages/server/src/routes/chats.routes.ts (+0 -14)
📝 packages/server/src/routes/generate.routes.ts (+2 -16)
📝 packages/server/src/routes/generate/retry-agents-route.ts (+9 -8)
📝 packages/server/src/services/agents/agent-executor.ts (+4 -0)
📝 packages/server/src/services/agents/default-prompt-migration.ts (+78 -10)
📝 packages/server/src/services/generation/agent-resolution.ts (+1 -1)
➖ packages/server/src/services/generation/immersive-html-injection.ts (+0 -77)
📝 packages/server/src/services/generation/prose-guardian-settings.ts (+60 -35)
📝 packages/server/src/services/generation/runtime-agent-sections.ts (+2 -2)

...and 7 more files

📄 Description

Linked issue

Closes #3110
Closes #3108
Closes #3094
Closes #3091
Closes #3087

Why this change

  • MiMo/OpenAI-compatible endpoints should always receive the configured model field, even when custom request parameters are present.
  • XML prompt wrapping should not turn user-authored Markdown blockquotes into visible > text before the model sees them.
  • Immersive HTML should be a post-processing visual enhancer, not prompt text injected into the main roleplay model context.
  • Existing stock Immersive HTML configs should migrate to the new behavior instead of continuing to display the old static-prompt version.
  • Android Firefox users need the mobile composer to stop obscuring older chat content while reading history.
  • Branch switching should not bounce back just because the flat chat list is briefly stale while detail/group caches resolve.

What changed

  • Prevented blank/null/non-string custom model request parameters from erasing the configured connection model, while still allowing explicit non-empty model overrides.
  • Corrected the missing-model error copy so users are not told to enable a nonexistent Advanced Parameters toggle.
  • Stopped XML prompt escaping from converting plain > to &gt;, while keeping < and & escaped for prompt-boundary safety, and added prompt regression coverage for blockquotes plus injection boundaries.
  • Converted the built-in Immersive HTML agent to post_processing + text_rewrite, removed the static prompt injection service/call sites, and added a prompt regression that keeps it out of pre-generation runtime sections.
  • Extended the legacy default-agent migration so stock Immersive HTML prompt text, old description, phase, and missing result settings update to the new post-processing defaults without overwriting custom prompts.
  • Added mobile-only empty-composer minimization in Conversation and Roleplay while scrolling older messages, with restore on downward scroll, near-bottom return, or tapping the minimized input.
  • Relaxed the active chat list guard so valid branch selections can resolve through useChat before the UI clears the active chat.
  • Updated the v2.0.9 changelog.

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 only from this checkout: pnpm check, pnpm regression:prompt, git diff --check.
  • Manual MiMo/OpenAI-compatible endpoint verification still needs a real provider pass.
  • Manual Android Firefox verification still needs a device/browser pass.
  • Manual Immersive HTML runtime behavior still needs a roleplay generation pass with the agent enabled.
  • Manual branch switching still needs an in-app branch selector pass on a multi-branch chat.

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 in this automated checkout.

Summary by CodeRabbit

  • New Features

    • Mobile chat and conversation composers now automatically collapse while scrolling and can be restored with a tap.
    • HTML-enhanced responses now run as a post-processing step, improving how visual edits are applied.
  • Bug Fixes

    • Preserved > characters in wrapped prompts while still escaping other special characters.
    • Fixed branch switching so the current branch is kept when chat data is still loading.
    • Prevented custom request settings from clearing the configured model.
    • Improved guidance when a model setting is missing.

🔄 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/3109 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 6/30/2026 **Status:** ✅ Merged **Merged:** 6/30/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `codex/assigned-issues-3087-3094` --- ### 📝 Commits (5) - [`f5a8834`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f5a8834090242c7dd832a2af6faef6ef6b60f2af) Resolve assigned chat and agent issues - [`3655d89`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3655d8911d8bc78ea79cf81e7a508603ab59ca76) Preserve blockquote delimiters in XML prompts - [`2a2b234`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2a2b2346cdd6449d498520fce87e139fa7e89a7c) Keep configured model in provider requests - [`6983e91`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6983e91fa91d8bdeab5e36bc1e94bbd1c4f00933) Migrate legacy Immersive HTML defaults - [`b3c4e66`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b3c4e66996416386fac8dc6b6416d65fd1de9b36) Bundle built-in rewrite agents ### 📊 Changes **27 files changed** (+566 additions, -201 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+7 -0) 📝 `packages/client/src/components/agents/AgentEditor.tsx` (+27 -2) 📝 `packages/client/src/components/chat/AgentAddSetupFields.tsx` (+4 -3) 📝 `packages/client/src/components/chat/ChatArea.tsx` (+4 -2) 📝 `packages/client/src/components/chat/ChatInput.tsx` (+47 -2) 📝 `packages/client/src/components/chat/ChatRoleplaySurface.tsx` (+31 -0) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+42 -1) 📝 `packages/client/src/components/chat/ConversationInput.tsx` (+51 -2) 📝 `packages/client/src/components/chat/ConversationView.tsx` (+21 -1) 📝 `packages/client/src/hooks/use-generate.ts` (+5 -4) 📝 `packages/client/src/lib/generation-parameter-errors.ts` (+3 -0) 📝 `packages/server/src/routes/chats.routes.ts` (+0 -14) 📝 `packages/server/src/routes/generate.routes.ts` (+2 -16) 📝 `packages/server/src/routes/generate/retry-agents-route.ts` (+9 -8) 📝 `packages/server/src/services/agents/agent-executor.ts` (+4 -0) 📝 `packages/server/src/services/agents/default-prompt-migration.ts` (+78 -10) 📝 `packages/server/src/services/generation/agent-resolution.ts` (+1 -1) ➖ `packages/server/src/services/generation/immersive-html-injection.ts` (+0 -77) 📝 `packages/server/src/services/generation/prose-guardian-settings.ts` (+60 -35) 📝 `packages/server/src/services/generation/runtime-agent-sections.ts` (+2 -2) _...and 7 more files_ </details> ### 📄 Description ## Linked issue Closes #3110 Closes #3108 Closes #3094 Closes #3091 Closes #3087 ## Why this change - MiMo/OpenAI-compatible endpoints should always receive the configured model field, even when custom request parameters are present. - XML prompt wrapping should not turn user-authored Markdown blockquotes into visible `&gt;` text before the model sees them. - Immersive HTML should be a post-processing visual enhancer, not prompt text injected into the main roleplay model context. - Existing stock Immersive HTML configs should migrate to the new behavior instead of continuing to display the old static-prompt version. - Android Firefox users need the mobile composer to stop obscuring older chat content while reading history. - Branch switching should not bounce back just because the flat chat list is briefly stale while detail/group caches resolve. ## What changed - Prevented blank/null/non-string custom `model` request parameters from erasing the configured connection model, while still allowing explicit non-empty model overrides. - Corrected the missing-model error copy so users are not told to enable a nonexistent Advanced Parameters toggle. - Stopped XML prompt escaping from converting plain `>` to `&gt;`, while keeping `<` and `&` escaped for prompt-boundary safety, and added prompt regression coverage for blockquotes plus injection boundaries. - Converted the built-in Immersive HTML agent to `post_processing` + `text_rewrite`, removed the static prompt injection service/call sites, and added a prompt regression that keeps it out of pre-generation runtime sections. - Extended the legacy default-agent migration so stock Immersive HTML prompt text, old description, phase, and missing result settings update to the new post-processing defaults without overwriting custom prompts. - Added mobile-only empty-composer minimization in Conversation and Roleplay while scrolling older messages, with restore on downward scroll, near-bottom return, or tapping the minimized input. - Relaxed the active chat list guard so valid branch selections can resolve through `useChat` before the UI clears the active chat. - Updated the v2.0.9 changelog. ## 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 only from this checkout: `pnpm check`, `pnpm regression:prompt`, `git diff --check`. - Manual MiMo/OpenAI-compatible endpoint verification still needs a real provider pass. - Manual Android Firefox verification still needs a device/browser pass. - Manual Immersive HTML runtime behavior still needs a roleplay generation pass with the agent enabled. - Manual branch switching still needs an in-app branch selector pass on a multi-branch chat. ## 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 in this automated checkout. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Mobile chat and conversation composers now automatically collapse while scrolling and can be restored with a tap. * HTML-enhanced responses now run as a post-processing step, improving how visual edits are applied. * **Bug Fixes** * Preserved `>` characters in wrapped prompts while still escaping other special characters. * Fixed branch switching so the current branch is kept when chat data is still loading. * Prevented custom request settings from clearing the configured model. * Improved guidance when a model setting is missing. <!-- 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:19:37 +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#5799
No description provided.