mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2658] [Issue]: Preset stop sequences are parsed and saved but never sent to any provider #1310
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#1310
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 @kolacheee on GitHub (Jun 20, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2658
Originally assigned to: @kolacheee on GitHub.
Summary
Preset "stop sequences" are parsed and persisted but are never attached to the
ChatOptions.stopfield that provider adapters read, so they are silently inert on every backend (OpenAI, Anthropic, Google, sidecar). A user's configured stop strings have no effect on generation.Expected behavior
Stop sequences configured in a preset/connection should be sent to the model so generation halts at those strings (e.g. preventing the model from writing the user's lines or running past a turn boundary).
Actual behavior
Stop sequences are parsed from stored parameters and saved, but the generate route never copies them into the
ChatOptions.stoppassed toprovider.chat()/chatComplete(). As a result:body.stop = options.stop) that never receives a populated value (dead in practice).options.stopand never setstop_sequences/generationConfig.stopSequencesat all.How it breaks the pipeline
Code trace (staging @
b826f8f4):stopSequences:packages/server/src/routes/generate/generate-route-utils.ts:863–864→out.stopSequences = source.stopSequences;ChatOptions.stopis the field providers consume (defined inbase-provider.ts). A repo-wide search shows no assignment of the parsedstopSequencesonto theChatOptionsobject built ingenerate.routes.ts— i.e.options.stopis never populated in the normal generate flow.packages/server/src/services/llm/providers/openai.provider.ts:854and:1089→if (this.shouldSendStopSequences(options.model) && options.stop?.length) body.stop = options.stop;— butoptions.stopis alwaysundefined, so this never fires.anthropic.provider.tsbody construction (chat()~:362–389,chatComplete()~:238–247) never readsoptions.stopand never setsstop_sequences.google.provider.tsgenerationConfig(:383,:542) emits temperature/maxOutputTokens/topP/topK/penalties but neverstopSequences.Net effect: the stop-sequence feature is wired into the UI and storage but disconnected from the request builder for all providers.
Steps to reproduce
\nUser:or a character-name delimiter).stop/stop_sequences/stopSequences; the model continues past the configured stop string.Suggested fix
ChatOptions.stopfrom the parsedstopSequenceswhere theChatOptionsobject is assembled ingenerate.routes.ts(this immediately activates the existing OpenAI mapping).if (options.stop?.length) body.stop_sequences = options.stop;in bothchat()andchatComplete().if (options.stop?.length) generationConfig.stopSequences = options.stop;in both request builders.?.lengthto preserve valid sequences.Environment
b826f8f4)Additional context
Identified via systematic source review on staging (refs @
b826f8f4). This is a uniform missing-wiring gap, not provider-specific — stop sequences are dropped equally for OpenAI, Anthropic, and Google. Filed alongside related pipeline issues.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: