mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8703] [MERGED] fix(generate): every request ends on the Assistant Prefill #8755
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#8755
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/8703
Author: @SpicyMarinara
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/assistant-prefill-ends-the-prompt📝 Commits (3)
db86c2cfix(generate): end every request on the Assistant Prefill5c3a2a5fix(generate): keep the prefill one request on Apply and Claude Subscriptionb63a215fix(generate): with no reply to open, send the prefill as a user message📊 Changes
8 files changed (+639 additions, -76 deletions)
View changed files
📝
docs/prompts/generation-parameters.md(+2 -0)📝
packages/server/src/routes/generate.routes.ts(+36 -20)📝
packages/server/src/routes/generate/dry-run-route.ts(+25 -12)📝
packages/server/src/routes/generate/generate-route-utils.ts(+104 -39)📝
packages/server/src/services/generation/generation-parameters.ts(+12 -0)📝
packages/server/src/services/llm/providers/claude-subscription/jsonl-entries.ts(+5 -4)➕
scripts/regressions/assistant-prefill-ends-prompt.regression.ts(+452 -0)📝
scripts/regressions/provider-compat.regression.ts(+3 -1)📄 Description
Linked issue
Closes #8692
Why this change
The maintainer wants the Assistant Prefill setting to work like this:
Before this change the prefill was pushed into the shared prompt early, by
appendGenerationTailMessages. Everything added per responder after that landed after it:So many requests did not end on the prefill.
What changed
appendGenerationTailMessagesnow only builds the prefill turn (the visible text, plus the reasoning prefill where supported). The exception is Gemini user-message regeneration, which still puts the prefill before the rewrite instruction (#7558).endPromptOnAssistantPrefillruns ingenerateForCharacterafter every per-responder addition. It resolves macros in the prefill and pushes it as the final message, trimmed at the end for Anthropic.rejectsFinalAssistantMessage(model), which reuses the existing capability helpers:<chat_history>/<last_message>wrapper. It's joined the way a streamed reply is.docs/prompts/generation-parameters.md. Translations follow in #8700.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
What the agent ran locally, rebased on staging:
node ./scripts/pnpm-runner.mjs check: exits 0.New regression
assistant-prefill-ends-prompt. It builds the final provider payload through the real route for:It asserts the last message, or the prefixed last reply, and the user-message case with no reply. It fails with the source change reverted.
Existing regressions: provider-compat, gemini-user-regeneration and roleplay-regeneration-context pass.
Review: an independent review found three defects, all fixed:
For a human to verify:
[assistant]block, after the post-history section and any guide, and the streamed reply starts with it.<output_format>block.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)The English Assistant Prefill section of
docs/prompts/generation-parameters.mdis updated. The translations follow in #8700.UI evidence (if applicable)
No UI change. Peek Prompt shows the new order.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.