[PR #2763] [MERGED] fix(generate): forward minP through the dry-run preview path (#2762) #5721

Closed
opened 2026-10-22 04:18:51 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2763
Author: @kolacheee
Created: 6/21/2026
Status: ✅ Merged
Merged: 6/21/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/issue-2762-dry-run-minp


📝 Commits (1)

  • f51a7e2 fix(generate): forward minP through the dry-run preview path (#2762)

📊 Changes

1 file changed (+5 additions, -0 deletions)

View changed files

📝 packages/server/src/routes/generate/dry-run-route.ts (+5 -0)

📄 Description

Linked issue

Closes #2762

Why this change

The dry-run path (prompt preview / test generation) is meant to faithfully mirror a real send so users can tune prompts and sampling before generating. It silently dropped minP: presets and Chat/Connection Advanced Parameters can set minP, the real generate path forwards it, but the preview path resolved every other sampler and omitted this one. On backends that accept min_p (the bundled local sidecar model, or OpenAI-compatible / KoboldCpp backends where shouldSendTopK() is true), the preview's request omitted min_p while a real generation of the same chat included it — so the preview diverged from reality precisely for the parameter the user was trying to preview.

This is a follow-up gap from #2668 / PR #2670, which wired minP through the main generation path and providers but did not update the separate dry-run route.

What changed

In packages/server/src/routes/generate/dry-run-route.ts, mirror the real route (generate.routes.ts):

  • Added let minP = 0; alongside the other sampler defaults.
  • Read it in applyParameterOverrides (if (typeof params.minP === "number") minP = params.minP;) so Connection defaults and per-chat overrides apply.
  • Read it in the preset block (minP = assembled.parameters.minP ?? 0;) next to the existing topP / topK assignments.
  • Passed minP: minP || undefined into both provider.chatComplete(...) calls (streaming and non-streaming).

The existing Claude no-sampling / temperature-only stripping blocks already match the real route (neither strips minP), so they are intentionally unchanged — adding minP there would make the preview diverge from a real send rather than match it. Net change is 5 added lines; no behavior change for backends that don't accept min_p (a minP of 0 resolves to undefined and is omitted, exactly as on the real path).

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

Automated check already run by the author: pnpm check (clean-stale-client + impeccable:check + lint/tsc + build) completed successfully on this branch.

Still needs manual verification by a human before merge:

  • Manually verify in the running app: on a connection whose backend accepts min_p (bundled local sidecar model, or an OpenAI-compatible / KoboldCpp backend), set minP = 0.1 in a preset or Chat Settings → Advanced Parameters, run the prompt preview / dry-run / test for that chat, and confirm the outgoing request body now includes min_p: 0.1.
  • Manually verify the preview now matches a real generation: run a real reply for the same chat and confirm both requests carry the same min_p value.
  • Manually verify no regression for minP = 0 (default): confirm min_p is still omitted from the preview request (resolves to undefined), and that pure OpenAI/Anthropic connections are unaffected.
  • Manually verify a Claude temperature-only / no-sampling model: confirm preview parity with a real send (neither path strips minP; behavior should be identical between the two).

Docs and release impact

  • No docs changes needed

This is an internal server-side parity fix; no user-facing docs, config, or version-bearing files are touched. No version bump.

UI evidence (if applicable)

Not applicable — server-side request-construction change with no UI surface.

Summary by CodeRabbit

  • New Features
    • Added support for the minP sampling parameter in dry-run generation requests. The parameter can be configured through connection settings, chat parameters, or preset prompt assembly, with consistent handling in both streaming and non-streaming modes.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/2763 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 6/21/2026 **Status:** ✅ Merged **Merged:** 6/21/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/issue-2762-dry-run-minp` --- ### 📝 Commits (1) - [`f51a7e2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f51a7e20801da49e84200ab8b5dbd8317d6d0e9e) fix(generate): forward minP through the dry-run preview path (#2762) ### 📊 Changes **1 file changed** (+5 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/routes/generate/dry-run-route.ts` (+5 -0) </details> ### 📄 Description <!-- Target branch: staging --> ## Linked issue Closes #2762 ## Why this change The dry-run path (prompt **preview / test** generation) is meant to faithfully mirror a real send so users can tune prompts and sampling before generating. It silently dropped `minP`: presets and Chat/Connection Advanced Parameters can set `minP`, the real generate path forwards it, but the preview path resolved every other sampler and omitted this one. On backends that accept `min_p` (the bundled local sidecar model, or OpenAI-compatible / KoboldCpp backends where `shouldSendTopK()` is true), the preview's request omitted `min_p` while a real generation of the same chat included it — so the preview diverged from reality precisely for the parameter the user was trying to preview. This is a follow-up gap from #2668 / PR #2670, which wired `minP` through the main generation path and providers but did not update the separate dry-run route. ## What changed In `packages/server/src/routes/generate/dry-run-route.ts`, mirror the real route (`generate.routes.ts`): - Added `let minP = 0;` alongside the other sampler defaults. - Read it in `applyParameterOverrides` (`if (typeof params.minP === "number") minP = params.minP;`) so Connection defaults and per-chat overrides apply. - Read it in the preset block (`minP = assembled.parameters.minP ?? 0;`) next to the existing `topP` / `topK` assignments. - Passed `minP: minP || undefined` into both `provider.chatComplete(...)` calls (streaming and non-streaming). The existing Claude no-sampling / temperature-only stripping blocks already match the real route (neither strips `minP`), so they are intentionally unchanged — adding `minP` there would make the preview diverge from a real send rather than match it. Net change is 5 added lines; no behavior change for backends that don't accept `min_p` (a `minP` of `0` resolves to `undefined` and is omitted, exactly as on the real path). ## Validation <!-- Boxes intentionally left unchecked: they are a to-do list for the human contributor, not proof of completion. --> - [x] `pnpm check` passes locally - [x] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes Automated check already run by the author: `pnpm check` (clean-stale-client + impeccable:check + lint/tsc + build) completed successfully on this branch. Still needs manual verification by a human before merge: - Manually verify in the running app: on a connection whose backend accepts `min_p` (bundled local sidecar model, or an OpenAI-compatible / KoboldCpp backend), set `minP` = `0.1` in a preset or Chat Settings → Advanced Parameters, run the **prompt preview / dry-run / test** for that chat, and confirm the outgoing request body now includes `min_p: 0.1`. - Manually verify the preview now **matches a real generation**: run a real reply for the same chat and confirm both requests carry the same `min_p` value. - Manually verify **no regression for `minP` = 0** (default): confirm `min_p` is still omitted from the preview request (resolves to `undefined`), and that pure OpenAI/Anthropic connections are unaffected. - Manually verify a **Claude temperature-only / no-sampling model**: confirm preview parity with a real send (neither path strips `minP`; behavior should be identical between the two). ## Docs and release impact - [x] No docs changes needed This is an internal server-side parity fix; no user-facing docs, config, or version-bearing files are touched. No version bump. ## UI evidence (if applicable) Not applicable — server-side request-construction change with no UI surface. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added support for the `minP` sampling parameter in dry-run generation requests. The parameter can be configured through connection settings, chat parameters, or preset prompt assembly, with consistent handling in both streaming and non-streaming modes. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:18:51 +07:00
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#5721
No description provided.