[PR #4553] [MERGED] Fix assigned generation and Roleplay regressions #6420

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

📋 Pull Request Information

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

Base: staging ← Head: agent/fix-assigned-runtime-issues


📝 Commits (3)

  • eb965b5 Start assigned runtime fixes
  • 40206d1 Fix assigned conversation and roleplay issues
  • c4fa4f2 Strengthen page activity regression

📊 Changes

18 files changed (+390 additions, -73 deletions)

View changed files

📝 package.json (+2 -1)
📝 packages/client/src/components/chat/ChatMessage.tsx (+15 -2)
📝 packages/client/src/components/chat/ChatRoleplaySurface.tsx (+43 -5)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+66 -0)
📝 packages/client/src/hooks/use-page-activity.ts (+5 -5)
📝 packages/server/src/routes/chats.routes.ts (+25 -38)
📝 packages/server/src/routes/generate.routes.ts (+39 -10)
📝 packages/server/src/routes/generate/retry-agents-route.ts (+11 -1)
📝 packages/server/src/services/agents/custom-agent-import-policy.service.ts (+9 -1)
📝 packages/server/src/services/conversation/auto-summary.service.ts (+8 -2)
📝 packages/server/src/services/prompt/marker-expander.ts (+4 -0)
📝 packages/shared/src/types/agent.ts (+5 -1)
📝 packages/shared/src/types/chat.ts (+2 -0)
📝 packages/shared/src/utils/macro-engine.ts (+33 -7)
📝 scripts/regressions/agent-import-security.regression.ts (+16 -0)
➕ scripts/regressions/conversation-summary.regression.ts (+51 -0)
📝 scripts/regressions/prompt.regression.ts (+40 -0)
📝 scripts/regressions/roleplay-streaming.regression.ts (+16 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #4527
Closes #4536
Closes #4538
Closes #4540
Closes #4552

Why this change

  • Upgraded installs could silently disable imported custom Agents, individual group prompts resolved Conversation macros too early, native file dialogs were treated as page inactivity, Roleplay streaming rebuilt formatted message DOM for every growing chunk, and Conversation summaries did not consistently honor their selected connection/output budget.
  • The Calls-specific half of #4527 is delivered separately in Pasta-Devs/Marinara-Agents#229 because downloadable Agent package runtime belongs there.

What changed

  • Default the custom Agent import policy to enabled unless explicitly disabled, and rely on persisted provenance instead of a local Agent slug.
  • Defer Conversation character macros until the individual group responder is known.
  • Treat page visibility—not temporary native-dialog focus loss—as the app activity lifecycle.
  • Update one lightweight Roleplay streaming text node at animation-frame cadence, formatting only after commit.
  • Route Conversation automatic/backfill summaries through the summary resolver and configured output limit.
  • Expose summary connection/output controls and pass connection options to package capability settings.
  • Add focused regression coverage for the affected policies, macros, summaries, and Roleplay source contracts.

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

  • Focused validation performed: shared/server lint, focused client ESLint, localization check, Agent-import regression, prompt regression, Conversation-summary regression, and git diff --check.
  • pnpm regression:roleplay reached and passed the new assertions, then stopped on an unrelated pre-existing Echo Chamber assertion that expects an obsolete HUD_EDGE_GAP declaration.
  • Manually verify upgraded/explicitly-disabled import policy states, individual group macro values, the native Windows style-plate dialog, smooth Roleplay streaming/final formatting, and the selected summary connection/output limit.
  • Manually verify Calls summary selection with Pasta-Devs/Marinara-Agents#229 installed.

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 (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

  • Source-level interaction regressions are included. Browser automation was unavailable because the in-app browser connection failed during bootstrap; Windows native-dialog behavior remains a platform-specific manual check.

Summary by CodeRabbit

  • New Features
    • Improved live Roleplay and conversation streaming with smoother updates and a visible typing cursor.
    • Added chat summary settings for selecting a connection and configuring maximum summary length.
    • Added support for conversation-specific character details in generated prompts.
  • Bug Fixes
    • Page activity now responds consistently to tab visibility changes.
    • Improved summary generation and backfills using the selected connection and configured output limits.
    • Improved handling of disabled custom agent imports.

🔄 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/4553 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 8/4/2026 **Status:** ✅ Merged **Merged:** 8/4/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `agent/fix-assigned-runtime-issues` --- ### 📝 Commits (3) - [`eb965b5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/eb965b5d5b3b3adc5bcaa2639d7dffc6a60ce923) Start assigned runtime fixes - [`40206d1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/40206d1da580a31a16aa6866338d278bc51f5760) Fix assigned conversation and roleplay issues - [`c4fa4f2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c4fa4f2ecd87952e59e8bee66702882b25ef63a7) Strengthen page activity regression ### 📊 Changes **18 files changed** (+390 additions, -73 deletions) <details> <summary>View changed files</summary> 📝 `package.json` (+2 -1) 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+15 -2) 📝 `packages/client/src/components/chat/ChatRoleplaySurface.tsx` (+43 -5) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+66 -0) 📝 `packages/client/src/hooks/use-page-activity.ts` (+5 -5) 📝 `packages/server/src/routes/chats.routes.ts` (+25 -38) 📝 `packages/server/src/routes/generate.routes.ts` (+39 -10) 📝 `packages/server/src/routes/generate/retry-agents-route.ts` (+11 -1) 📝 `packages/server/src/services/agents/custom-agent-import-policy.service.ts` (+9 -1) 📝 `packages/server/src/services/conversation/auto-summary.service.ts` (+8 -2) 📝 `packages/server/src/services/prompt/marker-expander.ts` (+4 -0) 📝 `packages/shared/src/types/agent.ts` (+5 -1) 📝 `packages/shared/src/types/chat.ts` (+2 -0) 📝 `packages/shared/src/utils/macro-engine.ts` (+33 -7) 📝 `scripts/regressions/agent-import-security.regression.ts` (+16 -0) ➕ `scripts/regressions/conversation-summary.regression.ts` (+51 -0) 📝 `scripts/regressions/prompt.regression.ts` (+40 -0) 📝 `scripts/regressions/roleplay-streaming.regression.ts` (+16 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #4527 Closes #4536 Closes #4538 Closes #4540 Closes #4552 ## Why this change - Upgraded installs could silently disable imported custom Agents, individual group prompts resolved Conversation macros too early, native file dialogs were treated as page inactivity, Roleplay streaming rebuilt formatted message DOM for every growing chunk, and Conversation summaries did not consistently honor their selected connection/output budget. - The Calls-specific half of #4527 is delivered separately in Pasta-Devs/Marinara-Agents#229 because downloadable Agent package runtime belongs there. ## What changed - Default the custom Agent import policy to enabled unless explicitly disabled, and rely on persisted provenance instead of a local Agent slug. - Defer Conversation character macros until the individual group responder is known. - Treat page visibility—not temporary native-dialog focus loss—as the app activity lifecycle. - Update one lightweight Roleplay streaming text node at animation-frame cadence, formatting only after commit. - Route Conversation automatic/backfill summaries through the summary resolver and configured output limit. - Expose summary connection/output controls and pass connection options to package capability settings. - Add focused regression coverage for the affected policies, macros, summaries, and Roleplay source contracts. ## 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 - Focused validation performed: shared/server lint, focused client ESLint, localization check, Agent-import regression, prompt regression, Conversation-summary regression, and `git diff --check`. - `pnpm regression:roleplay` reached and passed the new assertions, then stopped on an unrelated pre-existing Echo Chamber assertion that expects an obsolete `HUD_EDGE_GAP` declaration. - Manually verify upgraded/explicitly-disabled import policy states, individual group macro values, the native Windows style-plate dialog, smooth Roleplay streaming/final formatting, and the selected summary connection/output limit. - Manually verify Calls summary selection with Pasta-Devs/Marinara-Agents#229 installed. ## 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 (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) - Source-level interaction regressions are included. Browser automation was unavailable because the in-app browser connection failed during bootstrap; Windows native-dialog behavior remains a platform-specific manual check. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Improved live Roleplay and conversation streaming with smoother updates and a visible typing cursor. * Added chat summary settings for selecting a connection and configuring maximum summary length. * Added support for conversation-specific character details in generated prompts. * **Bug Fixes** * Page activity now responds consistently to tab visibility changes. * Improved summary generation and backfills using the selected connection and configured output limits. * Improved handling of disabled custom agent imports. <!-- 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:10:14 +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#6420
No description provided.