mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#7875
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7677
Author: @Gunterlie
Created: 10/15/2026
Status: ✅ Merged
Merged: 10/15/2026
Merged by: @Gunterlie
Base:
staging← Head:chore/7573-roleplay-roll-helpers📝 Commits (2)
4ad4539refactor(generate): move the roleplay roll handling into roleplay-rolls helperse47ef60Merge remote-tracking branch 'origin/staging' into chore/7573-roleplay-roll-helpers📊 Changes
4 files changed (+313 additions, -95 deletions)
View changed files
📝
packages/server/src/routes/generate.routes.ts(+16 -38)📝
packages/server/src/routes/generate/tool-rounds.ts(+25 -56)📝
packages/server/src/services/generation/roleplay-rolls.ts(+136 -1)➕
scripts/regressions/roleplay-roll-helpers.regression.ts(+136 -0)📄 Description
Linked issue
Part of #7573 (sixth slice). Stacked on #7676: merge it first; GitHub retargets this PR to
stagingwhen its base branch is deleted.Why this change
The roleplay roll handling was spread over the route and the tool-call loop: when rolls are on, how the roll tool gets the participant list, how a
[roll: …]written as text becomes a roll tool call, what the roll activity entry holds, the text the model gets after a roll, and how a roll in the last round is cut. These rules were inline code between stream and message handling. As pure helpers next toprepareRoleplayRoll, each rule has a direct test, and the loop reads as a sequence of named steps.No behaviour change.
What changed
packages/server/src/services/generation/roleplay-rolls.tsgets six pure helpers:isRoleplayRollEnabled,withRoleplayRollSchema,textualRollToolCall,rollActivityFromToolResult,rollResultFollowUpandcutPendingRoll.generate.routes.tsandgenerate/tool-rounds.tscall them. The stream abort on a roll request, the SSE events, the message shapes (a textual roll has notool_callsand its result goes back as a user message) and their order stay in the loop.scripts/regressions/roleplay-roll-helpers.regression.ts: the enable conditions (game mode, impersonate, narrator-only audience, the tool fallback), the schema (enum,attribute,required, other tools untouched, no mutation of shared tool definitions), the textual roll (cuts, call arguments, no id drawn without a roll), the activity entry, the follow-up text on the last round only, and the pending-roll cut (including a cut to an empty string).Validation
pnpm checkpasses locallyCONTRIBUTING.mdAgent-run results (not a substitute for the boxes above):
pnpm check: passed.generate.routes.tsortool-rounds.ts, and every one that covers rolls. No source pin needed a change.Manual verification notes
[roll: …]stops the stream, the roll card shows, and the reply continues with the result.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.