[GH-ISSUE #2274] [Issue]: 09-CHAT-API-generation-request-options trim flag is not sent by refactor generation requests #1111

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

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

Originally assigned to: @Promansis on GitHub.

Summary

09-CHAT-API-generation-request-options parity gap: the refactor keeps the trimIncompleteModelOutput setting and request schema field, but normal chat generation requests no longer send the setting into startGeneration.

Expected behavior

When "Trim incomplete model endings" is enabled, chat generation requests should carry trimIncompleteModelOutput: true through the refactor generation request envelope, matching legacy behavior.

Actual behavior

The refactor UI store and settings panel still expose trimIncompleteModelOutput, and generateRequestSchema still accepts it, but useGenerate() only adds status/activity/timezone/debug fields before calling startGeneration. The trim option is not forwarded by normal quick-send/generation paths.

Steps to reproduce

  1. Enable "Trim incomplete model endings" in settings on the refactor branch.
  2. Send or retry a chat generation request from a chat input surface.
  3. Inspect the request/input passed to startGeneration; trimIncompleteModelOutput is absent even though the setting is enabled.

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@37585ab9
  • Run mode: not run; static parity trace
  • OS + version: not relevant
  • Node + pnpm versions: not run
  • Rust version, if relevant: not relevant
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: chat generation request envelope; provider outcome not traced

Logs, screenshots, or video

Legacy behavior:

  • main:packages/shared/src/schemas/chat.schema.ts:27 defines the legacy generation request schema, including trimIncompleteModelOutput at main:packages/shared/src/schemas/chat.schema.ts:53.
  • main:packages/client/src/hooks/use-generate.ts:893 reads trimIncompleteModelOutput from useUIStore; main:packages/client/src/hooks/use-generate.ts:900 sends it in the /generate request body at main:packages/client/src/hooks/use-generate.ts:908.
  • main:packages/server/src/routes/generate.routes.ts:7898 consumes the option before saving non-impersonation output.

Refactor behavior:

  • src/engine/contracts/schemas/chat.schema.ts:33 defines the refactor generation request schema; trimIncompleteModelOutput remains accepted at src/engine/contracts/schemas/chat.schema.ts:63.
  • src/shared/stores/ui.store.ts:172 still stores the setting, and src/features/shell/settings/components/SettingsPanel.tsx:1109 still exposes the setting.
  • src/features/runtime/generation/hooks/use-generate.ts:1757 calls startGeneration; the forwarded request only adds userStatus, userActivity, userTimeZone, image prompt settings, summary hiding, debugMode, and debugSink at src/features/runtime/generation/hooks/use-generate.ts:1763. No trimIncompleteModelOutput is forwarded.
  • src/engine/generation/start-generation.ts:100 defines StartGenerationInput; it has debug/guide/attachment fields but no trimIncompleteModelOutput member.

Files inspected:

  • src/engine/contracts/schemas/chat.schema.ts
  • src/engine/generation/start-generation.ts
  • src/features/runtime/generation/hooks/use-generate.ts
  • src/features/modes/shared/chat-ui/components/ChatInput.tsx
  • src/features/modes/conversation/components/ConversationInput.tsx
  • src/features/shell/settings/components/SettingsPanel.tsx
  • src/shared/stores/ui.store.ts
  • main:packages/shared/src/schemas/chat.schema.ts
  • main:packages/client/src/hooks/use-generate.ts
  • main:packages/server/src/routes/generate.routes.ts
  • main:packages/client/src/components/chat/ChatInput.tsx

Regression notes

Confirmed by Batch 7 static parityscan for upstream tracker #2268. Legacy sent and consumed the trim option; refactor keeps the setting/schema but drops the option from the generation request path.

Additional context

Surface ID: 09-CHAT-API-generation-request-options

Linked tracker: #2268

Acceptance criteria:

  • Normal chat generation requests include trimIncompleteModelOutput from useUIStore when calling startGeneration.
  • The request/input type accepts the field intentionally rather than relying on an untyped passthrough.
  • The existing setting in Settings continues to control the request flag.
  • Quick send, retry/continue, guided reply, impersonate, and manual target generation keep their existing behavior while preserving the trim flag where applicable.
  • Add focused proof or a local harness showing the flag is forwarded from useGenerate() to the generation entrypoint.

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/2274 Originally assigned to: @Promansis on GitHub. ## Summary `09-CHAT-API-generation-request-options` parity gap: the refactor keeps the `trimIncompleteModelOutput` setting and request schema field, but normal chat generation requests no longer send the setting into `startGeneration`. ## Expected behavior When "Trim incomplete model endings" is enabled, chat generation requests should carry `trimIncompleteModelOutput: true` through the refactor generation request envelope, matching legacy behavior. ## Actual behavior The refactor UI store and settings panel still expose `trimIncompleteModelOutput`, and `generateRequestSchema` still accepts it, but `useGenerate()` only adds status/activity/timezone/debug fields before calling `startGeneration`. The trim option is not forwarded by normal quick-send/generation paths. ## Steps to reproduce 1. Enable "Trim incomplete model endings" in settings on the refactor branch. 2. Send or retry a chat generation request from a chat input surface. 3. Inspect the request/input passed to `startGeneration`; `trimIncompleteModelOutput` is absent even though the setting is enabled. ## Impact area - [ ] App shell, navigation, startup, or providers - [ ] Catalog resources - [x] Chat mode - [ ] Roleplay mode - [ ] Game mode - [x] Shared mode UI - [x] Runtime systems: generation, world-state, visuals, tracker, or haptics - [x] Professor Mari or shell tools - [x] 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@37585ab9` - Run mode: not run; static parity trace - OS + version: not relevant - Node + pnpm versions: not run - Rust version, if relevant: not relevant - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: chat generation request envelope; provider outcome not traced ## Logs, screenshots, or video Legacy behavior: - `main:packages/shared/src/schemas/chat.schema.ts:27` defines the legacy generation request schema, including `trimIncompleteModelOutput` at `main:packages/shared/src/schemas/chat.schema.ts:53`. - `main:packages/client/src/hooks/use-generate.ts:893` reads `trimIncompleteModelOutput` from `useUIStore`; `main:packages/client/src/hooks/use-generate.ts:900` sends it in the `/generate` request body at `main:packages/client/src/hooks/use-generate.ts:908`. - `main:packages/server/src/routes/generate.routes.ts:7898` consumes the option before saving non-impersonation output. Refactor behavior: - `src/engine/contracts/schemas/chat.schema.ts:33` defines the refactor generation request schema; `trimIncompleteModelOutput` remains accepted at `src/engine/contracts/schemas/chat.schema.ts:63`. - `src/shared/stores/ui.store.ts:172` still stores the setting, and `src/features/shell/settings/components/SettingsPanel.tsx:1109` still exposes the setting. - `src/features/runtime/generation/hooks/use-generate.ts:1757` calls `startGeneration`; the forwarded request only adds `userStatus`, `userActivity`, `userTimeZone`, image prompt settings, summary hiding, `debugMode`, and `debugSink` at `src/features/runtime/generation/hooks/use-generate.ts:1763`. No `trimIncompleteModelOutput` is forwarded. - `src/engine/generation/start-generation.ts:100` defines `StartGenerationInput`; it has debug/guide/attachment fields but no `trimIncompleteModelOutput` member. Files inspected: - `src/engine/contracts/schemas/chat.schema.ts` - `src/engine/generation/start-generation.ts` - `src/features/runtime/generation/hooks/use-generate.ts` - `src/features/modes/shared/chat-ui/components/ChatInput.tsx` - `src/features/modes/conversation/components/ConversationInput.tsx` - `src/features/shell/settings/components/SettingsPanel.tsx` - `src/shared/stores/ui.store.ts` - `main:packages/shared/src/schemas/chat.schema.ts` - `main:packages/client/src/hooks/use-generate.ts` - `main:packages/server/src/routes/generate.routes.ts` - `main:packages/client/src/components/chat/ChatInput.tsx` ## Regression notes Confirmed by Batch 7 static parityscan for upstream tracker #2268. Legacy sent and consumed the trim option; refactor keeps the setting/schema but drops the option from the generation request path. ## Additional context Surface ID: `09-CHAT-API-generation-request-options` Linked tracker: #2268 Acceptance criteria: - Normal chat generation requests include `trimIncompleteModelOutput` from `useUIStore` when calling `startGeneration`. - The request/input type accepts the field intentionally rather than relying on an untyped passthrough. - The existing setting in Settings continues to control the request flag. - Quick send, retry/continue, guided reply, impersonate, and manual target generation keep their existing behavior while preserving the trim flag where applicable. - Add focused proof or a local harness showing the flag is forwarded from `useGenerate()` to the generation entrypoint. ## 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:54 +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#1111
No description provided.