mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #7573] Split packages/server/src/routes/generate.routes.ts into bounded modules #4208
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#4208
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?
Originally created by @Gunterlie on GitHub (Oct 13, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7573
Originally assigned to: @Gunterlie on GitHub.
Problem
packages/server/src/routes/generate.routes.tshas about 15,200 lines. The main generation handler is one closure that holds the streaming, the tool-call rounds, the roleplay command filter, the game filters, the usage counters and the save step. Parts of it are already inpackages/server/src/routes/generate/, but the core handler is not.The size causes real defects. Example from #7570: a rollback for textual tool calls sent the raw reply to the client. The roleplay command filter that hides commands is defined about 1,400 lines above that line, so the author and two reviews did not see the link. CodeRabbit found it.
Proposal
Split the file in small steps. Each step moves one bounded part and changes no behaviour.
Candidates, in order of value:
sendTokenTextChunked,writeContentChunked, the roleplay, chance and spatial filters,content_replace).Constraints
docs/development/code-cleanup-audit.mdsays that a standalone "split everything" PR adds churn without reliable proof. Thus: one part for each PR, and each PR adds or names the regression that pins the moved behaviour.fullResponse, the filters, the abort controllers) needs an explicit context object first. That is the first step.Done when
@Gunterlie commented on GitHub (Oct 15, 2026):
Eight slices are merged (#7671, #7672, #7673, #7674, #7676, #7677, #7678, #7679). The remaining parts are tracked in #7686.
@SpicyMarinara commented on GitHub (Oct 19, 2026):
Closing for now to clear the board for the next release. Eight slices landed (#7671 to #7679), and the remaining parts were tracked in #7686, which is also closed for now; reopen either one after the release.
@Gunterlie commented on GitHub (Oct 30, 2026):
Closing for now to clear the board before the next stable release. This is not a rejection; I will reopen it after the release.