mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6456] [CLOSED] fix: decouple text release from tracker/lorebook-keeper post-processing #7184
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#7184
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/6456
Author: @Bainshie
Created: 9/20/2026
Status: ❌ Closed
Base:
staging← Head:fix/decouple-text-release-from-post-processing📝 Commits (1)
d9848b9fix: decouple text release from tracker/lorebook-keeper post-processing📊 Changes
5 files changed (+375 additions, -162 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
packages/server/src/routes/generate.routes.ts(+181 -157)📝
scripts/regressions/agent-activation.regression.ts(+28 -3)📝
scripts/regressions/spatial-context.regression.ts(+2 -2)➕
scripts/regressions/text-rewrite-lane-concurrency.regression.ts(+163 -0)📄 Description
Summary
text_rewriteagent) active kept the "Rewrite agents are working!" placeholder up until the entirepost_processingphase resolved — trackers included — even though only the rewrite lane touches the visible message. A captured run held the placeholder for ~86s when only ~20s of that was the rewrite lane itself.text_rewriteSSE event (which replaces the placeholder with the real text) now fires as soon as the rewrite lane itself finishes.Why
Traced in
packages/server/src/routes/generate.routes.ts: the rewrite-lane loop ran strictly afterpipeline.postGenerate()(trackers), the Lorebook Keeper call, the auto-retry-failed-agents block, and a large results/game-state persistence block — none of which mutate the message text, but all of which the placeholder waited on. Non-text agents (trackers, Lorebook Keeper, custom tracker-type agents) already report progress independently via existingagent_resultSSE events, so there was no reason for text display to share their critical path.Known trade-off, called out explicitly: the rewrite lane's prompt used to include tracker/Lorebook Keeper output (via an unconditional
<agent_results>block built from every other post-processing agent's results) once those had resolved. Since the rewrite lane now starts before that output exists, it no longer sees it — only earlier-phase (parallel) agent results are included, matching exactly what it already saw in chats with no tracker-type agents configured. This is inherent to decoupling the two critical paths per the request; flagging it explicitly since it isn't spelled out anywhere in code comments.Preserved as before:
Test plan
pnpm --filter @marinara-engine/server run lint(tsc -b ../shared && tsc --noEmit && tsc -p ../../scripts/regressions/tsconfig.character-activity.json) — clean, 0 errors.scripts/regressions/text-rewrite-lane-concurrency.regression.ts— spins up the real/generateroute with a fixture provider (a deliberately slow non-text post-processing agent + a fast custom rewrite agent) and assertstext_rewritefires before the slow agent'sagent_result, whiledonestill waits for both. Verified it fails against the pre-fix code (reverted the route file locally, reran — assertion failure as expected) and passes with the fix.agent-activation.regression.ts,spatial-context.regression.ts) that pinned the old single-block code shape; both pass against the new structure.agent-context-generation,agent-runtime,agent-progress,agent-scene-check,manual-agent-retry-resolution,roleplay-streaming,one-request-dice-rendering,issue-sweep-5391-5394,open-issues) — all pass.pnpm regression(complete Node lane) was not run to completion locally — it's a large, long-running suite; relying on CI for the full run. Everything targeted at the changed area passed.No linked issue exists for this yet — one should be opened before/alongside this PR per
CONTRIBUTING.md § Before You Open a Pull Request.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.