[GH-ISSUE #2264] [Issue]: 08-PRESET-CONTRACT-advanced-generation-params downgrades xhigh reasoning #1105

Closed
opened 2026-10-21 05:26:43 +07:00 by bsakaguchi · 1 comment
Owner

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

Originally assigned to: @Xelvanis on GitHub.

Summary

08-PRESET-CONTRACT-advanced-generation-params: prompt preset advanced generation parameters mostly survive schema, merge, prompt formatting, and provider request mapping, but the refactor Rust LLM provider contract downgrades reasoningEffort: "xhigh" and "maximum" to "high" before sending OpenAI/OpenRouter reasoning requests.

Linked parity target: #2259.

Expected behavior

Legacy behavior:

Prompt preset generation parameters include reasoning, verbosity, service tier, assistant prefill, custom parameters, max context, stop sequences, thoughts/showThoughts, strict role formatting, and single-user-message flags. For reasoning, legacy resolves reasoningEffort: "maximum" to "xhigh" for supported newer models and to "high" otherwise.

The refactor should preserve the same advanced generation-parameter contract, including sending xhigh reasoning effort where the current provider/model contract supports it.

Actual behavior

Refactor behavior:

The refactor schema and merge path carry the listed advanced generation fields, and most provider mappings exist. However, the Rust LLM provider helper accepts reasoningEffort values "xhigh" and "maximum" but normalizes both to "high" before the OpenAI/OpenRouter reasoning send path. That loses the legacy-supported xhigh reasoning level for eligible models.

Steps to reproduce

  1. Configure a prompt preset or generation parameter source with reasoningEffort: "xhigh" or "maximum" for an eligible OpenAI/OpenRouter reasoning model.
  2. Trace the refactor provider request body built from src-tauri/crates/llm/src/lib.rs.
  3. Observe that the outgoing reasoning effort becomes "high" instead of preserving/resolving to "xhigh".

Impact area

  • App shell, navigation, startup, or providers
  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: refactor
  • Run mode: Tauri desktop / remote runtime provider contract path
  • OS + version: not relevant; static trace
  • Node + pnpm versions: not relevant; static trace
  • Rust version, if relevant: not relevant; static trace
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: OpenAI/OpenRouter reasoning-capable models with xhigh support

Logs, screenshots, or video

Static parityscan proof:

  • Legacy schema includes the advanced generation parameters at main:packages/shared/src/schemas/prompt.schema.ts.
  • Legacy stored-parameter salvage accepts reasoning, verbosity, service tier, assistant prefill, custom parameters, showThoughts, useMaxContext, strictRoleFormatting, singleUserMessage, and stopSequences at main:packages/server/src/routes/generate/generate-route-utils.ts:464.
  • Legacy dry-run/generation path resolves maximum to xhigh for supported models, else high, at main:packages/server/src/routes/generate/dry-run-route.ts:1427.
  • Legacy provider options allow reasoningEffort?: "low" | "medium" | "high" | "xhigh" at main:packages/server/src/services/llm/base-provider.ts:96.
  • Refactor schema includes reasoningEffort: "low" | "medium" | "high" | "xhigh" | "maximum" and other advanced fields at src/engine/contracts/schemas/prompt.schema.ts:37.
  • Refactor merge path carries prompt preset parameters into generation at src/engine/generation/prompt-assembly.ts:2853 and src/engine/generation/context.ts:89.
  • Refactor max-context trimming uses merged parameters at src/engine/generation/start-generation.ts:3301.
  • Refactor provider helper downgrades "maximum" and "xhigh" to "high" at src-tauri/crates/llm/src/lib.rs:368.

Files inspected:

  • src/engine/contracts/schemas/prompt.schema.ts
  • src/engine/contracts/types/prompt.ts
  • src/engine/generation/generate-route-utils.ts
  • src/engine/generation/prompt-assembly.ts
  • src/engine/generation/context.ts
  • src/engine/generation/start-generation.ts
  • src-tauri/crates/llm/src/lib.rs
  • main:packages/shared/src/schemas/prompt.schema.ts
  • main:packages/server/src/routes/generate/generate-route-utils.ts
  • main:packages/server/src/routes/generate/dry-run-route.ts
  • main:packages/server/src/services/llm/base-provider.ts
  • main:packages/server/src/services/llm/providers/openai.provider.ts
  • main:packages/server/src/services/llm/providers/google.provider.ts

Regression notes

Legacy main preserves or resolves advanced reasoning effort to xhigh for supported models. Refactor src-tauri/crates/llm/src/lib.rs collapses xhigh and maximum to high in the OpenAI/OpenRouter reasoning helper.

Additional context

Acceptance criteria:

  • 08-PRESET-CONTRACT-advanced-generation-params preserves xhigh reasoning effort in the refactor provider contract for eligible providers/models.
  • reasoningEffort: "maximum" resolves to the highest supported effort level using provider/model-aware logic equivalent to legacy behavior.
  • Unsupported providers/models still degrade safely to the highest supported valid effort rather than sending invalid values.
  • Existing advanced generation parameters remain preserved: verbosity, service tier, assistant prefill, custom parameters, max context, stop sequences, showThoughts/thought capture, strict role formatting, and single-user-message.
  • Add static or focused provider-body proof for supported xhigh, fallback-to-high, and unchanged non-reasoning parameter mappings.

Template check

Please uncheck 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 @Promansis on GitHub (Jun 5, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2264 Originally assigned to: @Xelvanis on GitHub. ## Summary `08-PRESET-CONTRACT-advanced-generation-params`: prompt preset advanced generation parameters mostly survive schema, merge, prompt formatting, and provider request mapping, but the refactor Rust LLM provider contract downgrades `reasoningEffort: "xhigh"` and `"maximum"` to `"high"` before sending OpenAI/OpenRouter reasoning requests. Linked parity target: #2259. ## Expected behavior Legacy behavior: Prompt preset generation parameters include reasoning, verbosity, service tier, assistant prefill, custom parameters, max context, stop sequences, thoughts/showThoughts, strict role formatting, and single-user-message flags. For reasoning, legacy resolves `reasoningEffort: "maximum"` to `"xhigh"` for supported newer models and to `"high"` otherwise. The refactor should preserve the same advanced generation-parameter contract, including sending `xhigh` reasoning effort where the current provider/model contract supports it. ## Actual behavior Refactor behavior: The refactor schema and merge path carry the listed advanced generation fields, and most provider mappings exist. However, the Rust LLM provider helper accepts `reasoningEffort` values `"xhigh"` and `"maximum"` but normalizes both to `"high"` before the OpenAI/OpenRouter reasoning send path. That loses the legacy-supported `xhigh` reasoning level for eligible models. ## Steps to reproduce 1. Configure a prompt preset or generation parameter source with `reasoningEffort: "xhigh"` or `"maximum"` for an eligible OpenAI/OpenRouter reasoning model. 2. Trace the refactor provider request body built from `src-tauri/crates/llm/src/lib.rs`. 3. Observe that the outgoing reasoning effort becomes `"high"` instead of preserving/resolving to `"xhigh"`. ## Impact area - [ ] App shell, navigation, startup, or providers - [ ] Catalog resources - [ ] Chat mode - [ ] Roleplay mode - [ ] Game mode - [ ] Shared mode UI - [ ] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [x] React-free engine behavior, contracts, agents, or capability ports - [ ] Shared API wrapper or remote runtime routing - [x] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: `refactor` - Run mode: Tauri desktop / remote runtime provider contract path - OS + version: not relevant; static trace - Node + pnpm versions: not relevant; static trace - Rust version, if relevant: not relevant; static trace - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: OpenAI/OpenRouter reasoning-capable models with `xhigh` support ## Logs, screenshots, or video Static parityscan proof: - Legacy schema includes the advanced generation parameters at `main:packages/shared/src/schemas/prompt.schema.ts`. - Legacy stored-parameter salvage accepts reasoning, verbosity, service tier, assistant prefill, custom parameters, showThoughts, useMaxContext, strictRoleFormatting, singleUserMessage, and stopSequences at `main:packages/server/src/routes/generate/generate-route-utils.ts:464`. - Legacy dry-run/generation path resolves `maximum` to `xhigh` for supported models, else `high`, at `main:packages/server/src/routes/generate/dry-run-route.ts:1427`. - Legacy provider options allow `reasoningEffort?: "low" | "medium" | "high" | "xhigh"` at `main:packages/server/src/services/llm/base-provider.ts:96`. - Refactor schema includes `reasoningEffort: "low" | "medium" | "high" | "xhigh" | "maximum"` and other advanced fields at `src/engine/contracts/schemas/prompt.schema.ts:37`. - Refactor merge path carries prompt preset parameters into generation at `src/engine/generation/prompt-assembly.ts:2853` and `src/engine/generation/context.ts:89`. - Refactor max-context trimming uses merged parameters at `src/engine/generation/start-generation.ts:3301`. - Refactor provider helper downgrades `"maximum"` and `"xhigh"` to `"high"` at `src-tauri/crates/llm/src/lib.rs:368`. Files inspected: - `src/engine/contracts/schemas/prompt.schema.ts` - `src/engine/contracts/types/prompt.ts` - `src/engine/generation/generate-route-utils.ts` - `src/engine/generation/prompt-assembly.ts` - `src/engine/generation/context.ts` - `src/engine/generation/start-generation.ts` - `src-tauri/crates/llm/src/lib.rs` - `main:packages/shared/src/schemas/prompt.schema.ts` - `main:packages/server/src/routes/generate/generate-route-utils.ts` - `main:packages/server/src/routes/generate/dry-run-route.ts` - `main:packages/server/src/services/llm/base-provider.ts` - `main:packages/server/src/services/llm/providers/openai.provider.ts` - `main:packages/server/src/services/llm/providers/google.provider.ts` ## Regression notes Legacy `main` preserves or resolves advanced reasoning effort to `xhigh` for supported models. Refactor `src-tauri/crates/llm/src/lib.rs` collapses `xhigh` and `maximum` to `high` in the OpenAI/OpenRouter reasoning helper. ## Additional context Acceptance criteria: - `08-PRESET-CONTRACT-advanced-generation-params` preserves `xhigh` reasoning effort in the refactor provider contract for eligible providers/models. - `reasoningEffort: "maximum"` resolves to the highest supported effort level using provider/model-aware logic equivalent to legacy behavior. - Unsupported providers/models still degrade safely to the highest supported valid effort rather than sending invalid values. - Existing advanced generation parameters remain preserved: verbosity, service tier, assistant prefill, custom parameters, max context, stop sequences, showThoughts/thought capture, strict role formatting, and single-user-message. - Add static or focused provider-body proof for supported `xhigh`, fallback-to-`high`, and unchanged non-reasoning parameter mappings. ## Template check Please uncheck 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:26:43 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@Xelvanis commented on GitHub (Jun 5, 2026):

Claiming this. I’ll work the Rust LLM provider normalization path and validate with focused provider-body coverage plus cargo check.

<!-- gh-comment-id:4628703762 --> @Xelvanis commented on GitHub (Jun 5, 2026): Claiming this. I’ll work the Rust LLM provider normalization path and validate with focused provider-body coverage plus cargo check.
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#1105
No description provided.