mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2762] [Issue]: Dry-run (prompt preview/test) path never forwards minP — preview diverges from real generation #1401
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#1401
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 21, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2762
Originally assigned to: @kolacheee on GitHub.
Summary
The dry-run path (prompt preview / test generation) never resolves or forwards
minPto the provider, so a preview can diverge from the real send.minPwas wired through the main generation path in #2668 / PR #2670, but the parallel dry-run route was missed — it has nominPlocal, never reads it in itsapplyParameterOverridesor preset block, and omits it from bothprovider.chatComplete(...)calls.Expected behavior
A
minPset in a preset, or in Chat/Connection Advanced Parameters, should be applied in the dry-run preview exactly as it is on a real generation, so the preview faithfully mirrors what would be sent. This is the entire purpose of the dry-run/test tool.Actual behavior
In
packages/server/src/routes/generate/dry-run-route.ts,minPis dropped: there is nominPlocal alongside the other sampler defaults,applyParameterOverridesdoes not readparams.minP, the preset block does not readassembled.parameters.minP, and neitherchatCompletecall passes aminPkey. Because the OpenAI-compatible provider only emitsbody.min_pwhenoptions.minP > 0, the preview'soptions.minPis alwaysundefined, somin_pis silently absent from the preview request even when the user configured a non-zero value. Every other sampler (temperature/topP/topK/penalties) is forwarded — onlyminPis missing.How it breaks the pipeline
Code trace (staging @
e626a3ac):packages/server/src/routes/generate.routes.tscorrectly: declareslet minP = 0;(:1684), reads it in the preset blockminP = assembled.parameters.minP ?? 0;(:2076) and inapplyParameterOverridesif (typeof params.minP === "number") minP = params.minP;(:3470), and passesminP: minP || undefinedinto everyprovider.chatComplete(...)(:6087,:6244,:6301).packages/server/src/routes/generate/dry-run-route.ts: nominPlocal among the sampler defaults (:517–522);applyParameterOverrides(:533–553) never readsparams.minP; the preset block (:1215–1226) setstopP/topK/penalties but notminP; and bothprovider.chatComplete(...)calls (:1570,:1632) omitminP.packages/server/src/services/llm/base-provider.ts:93(minP?: numberon the options type) andpackages/server/src/services/llm/providers/openai.provider.ts:885–892/:1130–1137(setbody.min_p = options.minPonly whenoptions.minP > 0);local-sidecar.provider.ts:60usesoptions.minP.Same orphaned-parameter class as #2668, but scoped to the dry-run/preview route that the #2668 fix (#2670) did not touch.
Steps to reproduce
minP=0.1in a preset (or Chat Settings → Advanced Parameters) on a connection whose backend acceptsmin_p(the bundled local sidecar model, or an OpenAI-compatible / KoboldCpp backend whereshouldSendTopK()is true).min_pkey is present in the preview, while a real generation of the same chat does includemin_p: 0.1. The preview diverges from the real send.Suggested fix
Mirror the real route in
dry-run-route.ts: (1) addlet minP = 0;with the other sampler defaults; (2) read it inapplyParameterOverrides(if (typeof params.minP === "number") minP = params.minP;); (3) read it in the preset block (minP = assembled.parameters.minP ?? 0;); (4) passminP: minP || undefinedinto bothprovider.chatComplete(...)calls. The existing Claude no-sampling / temperature-only stripping blocks already match the real route (neither stripsminP), so no change is needed there to preserve parity. Validate withpnpm check.Environment
e626a3ac)Additional context
Follow-up gap from #2668 / PR #2670, which wired
minPthrough the main generation path and providers but did not update the separate dry-run preview route. Confirmed at the code level: provider forwardsmin_ponly whenoptions.minP > 0, and the dry-run route never setoptions.minP.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@kolacheee commented on GitHub (Jun 21, 2026):
Owning this — starting implementation now (@kolacheee). Opening a draft PR against
stagingto track the fix.@kolacheee commented on GitHub (Jun 21, 2026):
Draft PR opened against
staging: #2763. (Note: because the PR targetsstagingrather than the default branch, GitHub won't auto-close this issue on merge — please close it manually when #2763 lands.)