[GH-ISSUE #2668] [Issue]: Preset minP is parsed, stored, and salvaged but never sent to any provider (orphaned parameter) #1319

Closed
opened 2026-10-21 05:31:28 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @kolacheee on GitHub (Jun 20, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2668

Originally assigned to: @kolacheee on GitHub.

Summary

minP (Min-P sampling) is a first-class generation parameter — defined in the schema, shipped in the default preset, and parsed/salvaged from stored params — but it is never placed on the ChatOptions passed to providers (and isn't even a field on the ChatOptions type). As a result, Min-P silently does nothing on every provider.

Expected behavior

A minP set in a preset or in Chat/Connection advanced parameters should be sent to providers that support min_p, so it actually influences sampling.

Actual behavior

minP is parsed and stored but orphaned: there is no minP local in the param assembly, applyParameterOverrides doesn't handle it, none of the ChatOptions construction sites set it, and ChatOptions has no minP field — so no provider can map min_p. The only way to send min_p today is the raw customParameters escape hatch.

How it breaks the pipeline

Code trace (staging @ b826f8f4):

  • Schema: packages/shared/src/schemas/prompt.schema.ts — minP: z.number().min(0).max(1).default(0).
  • Shipped in the default preset: packages/server/src/db/default-preset.json ("minP":0).
  • Parsed/salvaged: packages/server/src/routes/generate/generate-route-utils.ts:825 ("minP").
  • But in generate.routes.ts: the preset block (:1965–1977) reads temperature/maxTokens/topP/topK/penalties/etc. and omits minP; applyParameterOverrides (:3263–3286) never handles minP; there is no minP local; and none of the three ChatOptions sites (provider.chatComplete ~:5822/:5977, provider.chat ~:6032) set a minP key.
  • ChatOptions in packages/server/src/services/llm/base-provider.ts has no minP field, and no provider maps min_p.

This is the same orphaned-parameter class as the filed stop-sequences bug (#2658): parsed and persisted, but never wired to ChatOptions.

Steps to reproduce

  1. Set minP = 0.1 in a preset (or Chat Settings → Advanced Parameters) for an OpenAI-compatible / OpenRouter / KoboldCpp connection that supports min_p.
  2. Generate a reply and inspect the outgoing request body.
  3. Observe: no min_p / minP key is present; the stored 0.1 is dropped.

Suggested fix

Wire minP through the same path used for the stop-sequences fix: (1) add minP?: number to ChatOptions; (2) add a minP local, read it in the preset block (minP = assembled.parameters.minP ?? 0) and in applyParameterOverrides; (3) pass minP: minP || undefined in all three ChatOptions objects; (4) map it in providers that support min_p (OpenAI-compatible body as min_p; providers without a min_p concept may ignore it). Use !== undefined guards so a legitimate 0 isn't dropped.

Environment

  • Marinara Engine version: 2.0.0 (staging @ b826f8f4)
  • Install type: source
  • OS + version: All (code-level defect, platform-independent)
  • Browser or app shell: All

Additional context

Identified via systematic source review on staging (refs @ b826f8f4). Same root cause as the stop-sequences issue (#2658); ideally both orphaned fields are wired in the same pass. 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:

  • I DID NOT read this template and provide the requested details.
Originally created by @kolacheee on GitHub (Jun 20, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2668 Originally assigned to: @kolacheee on GitHub. ## Summary `minP` (Min-P sampling) is a first-class generation parameter — defined in the schema, shipped in the default preset, and parsed/salvaged from stored params — but it is never placed on the `ChatOptions` passed to providers (and isn't even a field on the `ChatOptions` type). As a result, Min-P silently does nothing on every provider. ## Expected behavior A `minP` set in a preset or in Chat/Connection advanced parameters should be sent to providers that support `min_p`, so it actually influences sampling. ## Actual behavior `minP` is parsed and stored but orphaned: there is no `minP` local in the param assembly, `applyParameterOverrides` doesn't handle it, none of the `ChatOptions` construction sites set it, and `ChatOptions` has no `minP` field — so no provider can map `min_p`. The only way to send `min_p` today is the raw `customParameters` escape hatch. ## How it breaks the pipeline Code trace (staging @ `b826f8f4`): - Schema: `packages/shared/src/schemas/prompt.schema.ts` — `minP: z.number().min(0).max(1).default(0)`. - Shipped in the default preset: `packages/server/src/db/default-preset.json` (`"minP":0`). - Parsed/salvaged: `packages/server/src/routes/generate/generate-route-utils.ts:825` (`"minP"`). - But in `generate.routes.ts`: the preset block (~`:1965–1977`) reads temperature/maxTokens/topP/topK/penalties/etc. and **omits** `minP`; `applyParameterOverrides` (~`:3263–3286`) never handles `minP`; there is no `minP` local; and none of the three `ChatOptions` sites (`provider.chatComplete` ~`:5822`/`:5977`, `provider.chat` ~`:6032`) set a `minP` key. - `ChatOptions` in `packages/server/src/services/llm/base-provider.ts` has no `minP` field, and no provider maps `min_p`. This is the same orphaned-parameter class as the filed stop-sequences bug (#2658): parsed and persisted, but never wired to `ChatOptions`. ## Steps to reproduce 1. Set `minP` = `0.1` in a preset (or Chat Settings → Advanced Parameters) for an OpenAI-compatible / OpenRouter / KoboldCpp connection that supports `min_p`. 2. Generate a reply and inspect the outgoing request body. 3. Observe: no `min_p` / `minP` key is present; the stored `0.1` is dropped. ## Suggested fix Wire `minP` through the same path used for the stop-sequences fix: (1) add `minP?: number` to `ChatOptions`; (2) add a `minP` local, read it in the preset block (`minP = assembled.parameters.minP ?? 0`) and in `applyParameterOverrides`; (3) pass `minP: minP || undefined` in all three `ChatOptions` objects; (4) map it in providers that support `min_p` (OpenAI-compatible body as `min_p`; providers without a `min_p` concept may ignore it). Use `!== undefined` guards so a legitimate `0` isn't dropped. ## Environment - Marinara Engine version: 2.0.0 (staging @ `b826f8f4`) - Install type: source - OS + version: All (code-level defect, platform-independent) - Browser or app shell: All ## Additional context Identified via systematic source review on staging (refs @ `b826f8f4`). Same root cause as the stop-sequences issue (#2658); ideally both orphaned fields are wired in the same pass. 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: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:31:28 +07:00
  • closed this issue
  • added the
    in-pr
    label
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#1319
No description provided.