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#7871
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/7671
Author: @Gunterlie
Created: 10/15/2026
Status: ✅ Merged
Merged: 10/15/2026
Merged by: @Gunterlie
Base:
staging← Head:chore/7573-generate-routes-split📝 Commits (2)
ba7d59frefactor(generate): move the token output chain into GenerationStreamOutput635429ftest(generate): pin the held stream's roll detection📊 Changes
5 files changed (+243 additions, -105 deletions)
View changed files
📝
packages/server/src/routes/generate.routes.ts(+28 -89)➕
packages/server/src/routes/generate/generation-stream-output.ts(+103 -0)➕
scripts/regressions/generation-stream-output.regression.ts(+94 -0)📝
scripts/regressions/one-request-dice-rendering.regression.ts(+8 -8)📝
scripts/regressions/roleplay-streaming.regression.ts(+10 -8)📄 Description
Linked issue
Part of #7573 (first slice; the issue stays open for the next slices).
Why this change
generate.routes.tsis about 15,600 lines and the generation handler is one closure. The stream output chain (the roleplay command, chance and spatial filters, the token chunking and the reasoning clock) was spread over about 60 lines in the handler, with the flush about 1,800 lines below it. #7570 showed what that costs: a rollback sent raw text to the client because the filter that hides commands was out of sight. This PR moves that chain into one named module with its own regression, so the next slices (the tool-call round loop, the post-generation step) can call it instead of closure variables.No behaviour change.
What changed
packages/server/src/routes/generate/generation-stream-output.ts:GenerationStreamOutputholds the three stream filters, the 6-character SSE token chunks with the periodic event-loop yield, the reasoning-duration clock and the end-of-reply flush.write()keeps the text-rewrite hold (no tokens, only the clock).generate.routes.tscreates onestreamOutputper character turn.writeContentChunked, the tool-roundonTokencallback and the narrator generator loop now callstreamOutput.write(). The heldonTokenpath still feeds the roleplay command filter, so a roll request is still detected.scripts/regressions/generation-stream-output.regression.tspins the chunk size, the filter order in roleplay and game chats, the flush of chance-filter leftovers through the spatial filter, and the text-rewrite hold with the reasoning clock.roleplay-streamingandone-request-dice-renderingsource pins now point at the new call shapes.Validation
pnpm checkpasses locallyCONTRIBUTING.mdAgent-run results (not a substitute for the boxes above):
pnpm check: passed.generation-stream-output,roleplay-streaming,one-request-dice-rendering(drives the real route end to end),roleplay-commands,provider-stream-completion,command-only-regenerate,generate-agent-abort,spatial-context.Manual verification notes
[illustrate: …]command does not show while it streams.[[roll: …]]span never shows while it streams.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.