[PR #2256] [MERGED] Fix reroll seed reuse #5516

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2256
Author: @cha1latte
Created: 6/5/2026
Status: ✅ Merged
Merged: 6/5/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/issue-2243-reroll-seed


📝 Commits (6)

  • a6a0408 Fix reroll seed reuse
  • 07461bb Record PR metadata for issue 2243
  • 018b69d Merge remote-tracking branch 'upstream/refactor' into fix/issue-2243-reroll-seed
  • ceeef9e Tighten reroll seed normalization scope
  • f7b9fab Cover reroll seed parameter variants
  • b246113 Merge remote-tracking branch 'upstream/refactor' into fix/issue-2243-reroll-seed

📊 Changes

5 files changed (+209 additions, -7 deletions)

View changed files

📝 src/engine/contracts/schemas/prompt.schema.ts (+2 -0)
📝 src/engine/contracts/types/prompt.ts (+4 -0)
📝 src/engine/generation/generate-route-utils.ts (+8 -1)
📝 src/engine/generation/start-generation.test.ts (+141 -4)
📝 src/engine/generation/start-generation.ts (+54 -2)

📄 Description

Linked issue

Closes #2243

Why this change

  • Conversation rerolls could reuse a fixed provider seed from merged generation parameters, so rerolling against seeded OpenAI-compatible backends could produce the same response repeatedly.

What changed

  • Regenerate/reroll LLM requests now replace integer seed values in top-level parameters, customParameters, and custom_params with one fresh 32-bit seed before the provider call.
  • Generation parameter parsing now preserves provider-compatible seed and custom_params inputs instead of dropping them before runtime normalization.
  • Non-regenerate turns preserve explicit fixed seeds for users who intentionally want deterministic first-pass generations.
  • Added regression coverage that captures outgoing startGeneration stream parameters for regenerate, non-regenerate, integer, and nested non-integer seed paths.
  • Removed the obsolete tracked scratch/bugfix-verification.json proof file; current refactor enforces clean tracked scratch state.

Refactor impact

Primary owner:

  • Engine generation

Impact areas reviewed:

  • Conversation regenerate/reroll request assembly
  • Generation parameter parsing and merge compatibility
  • LLM runtime parameter preparation
  • Claude subscription runtime metadata append path
  • Non-regenerate fixed-seed behavior

Boundary notes:

  • The fix stays in src/engine and engine contract types/schemas.
  • No React, Tauri, shared API, storage persistence, dependency, release metadata, auth, or provider transport changes.

Pressure points touched:

  • src/engine/generation/start-generation.ts
  • src/engine/generation/generate-route-utils.ts
  • src/engine/contracts/schemas/prompt.schema.ts
  • src/engine/contracts/types/prompt.ts

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • Codex ran pnpm test src/engine/generation/start-generation.test.ts: passed, 12 tests.
  • Codex ran pnpm typecheck: passed.
  • Codex ran pnpm check: passed line endings, scratch cleanliness, architecture, frontend typecheck, Rust check, docs, discovery, launcher safety, and unused-code checks.
  • Codex ran Bunny local review before pushing the draft PR update: passed with no blocking findings.
  • GitHub CI, Bunny, and CodeRabbit are being rechecked on the pushed head.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • Bugfix only; no new discoverable workflow or setting.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

N/A. This is engine request-parameter normalization with focused request-path proof rather than a visible UI change.

Summary by CodeRabbit

  • New Features

    • Added support for seed parameters to enable deterministic AI generation.
    • Added support for custom_params field for advanced provider configuration.
    • Improved seed randomization when regenerating messages.
  • Tests

    • Extended test coverage for seed parameter handling during message regeneration scenarios.

🔄 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/2256 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/5/2026 **Status:** ✅ Merged **Merged:** 6/5/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-2243-reroll-seed` --- ### 📝 Commits (6) - [`a6a0408`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a6a04083676be359072196427d67b01482c4c7ae) Fix reroll seed reuse - [`07461bb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/07461bb6221b59966cd3fbfc7c78d2b3e258bf04) Record PR metadata for issue 2243 - [`018b69d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/018b69d27231e91cf82f01d20fdc0f2bba260469) Merge remote-tracking branch 'upstream/refactor' into fix/issue-2243-reroll-seed - [`ceeef9e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ceeef9e9f3e305a36079c28106a7d4e9494c08c7) Tighten reroll seed normalization scope - [`f7b9fab`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f7b9fab31581b36896b867e730f6b0660fe5984c) Cover reroll seed parameter variants - [`b246113`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b2461135cd0fa9c0b8c6df2b2f4ee3a00b1dd973) Merge remote-tracking branch 'upstream/refactor' into fix/issue-2243-reroll-seed ### 📊 Changes **5 files changed** (+209 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `src/engine/contracts/schemas/prompt.schema.ts` (+2 -0) 📝 `src/engine/contracts/types/prompt.ts` (+4 -0) 📝 `src/engine/generation/generate-route-utils.ts` (+8 -1) 📝 `src/engine/generation/start-generation.test.ts` (+141 -4) 📝 `src/engine/generation/start-generation.ts` (+54 -2) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue Closes #2243 ## Why this change - Conversation rerolls could reuse a fixed provider seed from merged generation parameters, so rerolling against seeded OpenAI-compatible backends could produce the same response repeatedly. ## What changed - Regenerate/reroll LLM requests now replace integer `seed` values in top-level parameters, `customParameters`, and `custom_params` with one fresh 32-bit seed before the provider call. - Generation parameter parsing now preserves provider-compatible `seed` and `custom_params` inputs instead of dropping them before runtime normalization. - Non-regenerate turns preserve explicit fixed seeds for users who intentionally want deterministic first-pass generations. - Added regression coverage that captures outgoing `startGeneration` stream parameters for regenerate, non-regenerate, integer, and nested non-integer seed paths. - Removed the obsolete tracked `scratch/bugfix-verification.json` proof file; current `refactor` enforces clean tracked scratch state. ## Refactor impact Primary owner: - Engine generation Impact areas reviewed: - Conversation regenerate/reroll request assembly - Generation parameter parsing and merge compatibility - LLM runtime parameter preparation - Claude subscription runtime metadata append path - Non-regenerate fixed-seed behavior Boundary notes: - The fix stays in `src/engine` and engine contract types/schemas. - No React, Tauri, shared API, storage persistence, dependency, release metadata, auth, or provider transport changes. Pressure points touched: - `src/engine/generation/start-generation.ts` - `src/engine/generation/generate-route-utils.ts` - `src/engine/contracts/schemas/prompt.schema.ts` - `src/engine/contracts/types/prompt.ts` ## Validation <!-- Check only what you personally ran or manually verified. Treat unchecked items as explicit TODOs. --> <!-- Do not submit *.test.ts or *.test.tsx files as PR proof; cite existing checks, command output, app/browser/Tauri verification, or manual notes instead. --> - [ ] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [ ] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - Codex ran `pnpm test src/engine/generation/start-generation.test.ts`: passed, 12 tests. - Codex ran `pnpm typecheck`: passed. - Codex ran `pnpm check`: passed line endings, scratch cleanliness, architecture, frontend typecheck, Rust check, docs, discovery, launcher safety, and unused-code checks. - Codex ran Bunny local review before pushing the draft PR update: passed with no blocking findings. - GitHub CI, Bunny, and CodeRabbit are being rechecked on the pushed head. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [ ] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - Bugfix only; no new discoverable workflow or setting. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence N/A. This is engine request-parameter normalization with focused request-path proof rather than a visible UI change. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added support for seed parameters to enable deterministic AI generation. * Added support for custom_params field for advanced provider configuration. * Improved seed randomization when regenerating messages. * **Tests** * Extended test coverage for seed parameter handling during message regeneration scenarios. <!-- 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:17:00 +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#5516
No description provided.