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#7876
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/7674
Author: @Gunterlie
Created: 10/15/2026
Status: ✅ Merged
Merged: 10/15/2026
Merged by: @Gunterlie
Base:
staging← Head:chore/7573-reply-text-cleanup📝 Commits (3)
382517arefactor(generate): move the reply text cleanup into reply-text-cleanup.ts1902a2btest(generate): pin the prefix strip without the envelope strip hiding it60dc0e5Merge remote-tracking branch 'origin/staging' into chore/7573-reply-text-cleanup📊 Changes
4 files changed (+318 additions, -144 deletions)
View changed files
📝
packages/server/src/routes/generate.routes.ts(+19 -143)➕
packages/server/src/routes/generate/reply-text-cleanup.ts(+175 -0)➕
scripts/regressions/generate-reply-text-cleanup.regression.ts(+123 -0)📝
scripts/regressions/open-issues.regression.ts(+1 -1)📄 Description
Linked issue
Part of #7573 (fourth slice). Stacked on #7673 (which is stacked on #7672): merge those first; GitHub retargets this PR to
stagingwhen its base branch is deleted.Why this change
After the reply command parse (#7673), the post-generation step cleans the reply text: it moves
<ooc>notes to the connected conversation, strips a group member's name or speaker wrapper, drops a reply written as the wrong speaker, strips the conversation envelope, trims an incomplete ending, and tidies roleplay whitespace. These were about 145 lines of string rules insidegenerateForCharacter, mixed with route state. As one pure function with a table of cases, each rule is testable without a model and readable in one pass.No behaviour change.
What changed
packages/server/src/routes/generate/reply-text-cleanup.ts:cleanGeneratedReply(text, options)returns{ text, changed, oocMessages }or{ dropped: "wrong_speaker" }. The steps keep their order and their log lines.generate.routes.ts(now about 15,000 lines) keeps its own state writes. On a wrong-speaker drop it still sends the emptycontent_replaceand returnsnull, as before.scripts/regressions/generate-reply-text-cleanup.regression.ts: 14 table rows for the OOC extraction (and when it is skipped), the individual-group prefix and wrapper strip, the prune passes, the trailing-turn cut, the wrong-speaker drop, the merged group that keeps its prefixes, the envelope strip, the incomplete-ending trim on and off, and roleplay whitespace. Each row also checkschanged.open-issuesextra-turn pin now reads the new module.Validation
pnpm checkpasses locallyCONTRIBUTING.mdAgent-run results (not a substitute for the boxes above):
pnpm check: passed.generate-reply-text-cleanuppassed. In a sweep of 70 regressions (every one that readsgenerate.routes.tsor covers OOC, envelope, trim or speaker prefixes), 69 passed.multiplayer-peer-server-securityfails withERR_TLS_CERT_ALTNAME_INVALIDfor::1; it fails the same way on currentstagingwithout this change, so it is a local host issue, not this PR.Manual verification notes
<ooc>…</ooc>note in the reply moves to the conversation and leaves the roleplay text clean.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.