mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2291] [Issue]: Refactor generation path lacks request contract parity #1130
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1130
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Xelvanis on GitHub (Jun 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2291
Originally assigned to: @SpicyMarinara on GitHub.
Summary
The refactor generation path no longer has an active request-validation/defaulting boundary equivalent to legacy
/api/generate. The legacygenerateRequestSchemastill exists in the refactor tree, but it is not used byuseGenerate -> startGeneration, and the live refactor input shape is split between loose UI args andStartGenerationInput extends JsonRecord.This creates contract drift and at least one likely missing user-facing behavior: the persisted
trimIncompleteModelOutputsetting is no longer passed into or read by the normal refactor generation path.Expected behavior
Refactor generation should have a current, refactor-native input contract that preserves the legacy validation/defaulting that still matters while also covering new engine fields.
The contract should account for current refactor fields such as
message,messages,parameters,promptPresetId,imagePromptSettings,hideAutomatedSummarySourceMessages, and runtime debug handling, while preserving legacy checks/defaults for fields such asuserStatus,userActivity,generationGuideSource,agentInjectionOverrides,attachments, andtrimIncompleteModelOutputwhere those behaviors still apply.Actual behavior
Legacy accepted generation requests through
generateRequestSchema.parse(req.body)inpackages/server/src/routes/generate.routes.ts. That schema covered request defaults and validation for normal generation, includingstreaming,userStatus,userActivity,userTimeZone,generationGuideSource,agentInjectionOverrides,attachments, andtrimIncompleteModelOutput.In the refactor:
src/engine/contracts/schemas/chat.schema.tsstill exportsgenerateRequestSchema, but searches show no current imports or parses of it outside the definition.src/features/runtime/generation/hooks/use-generate.tsaccepts looseGenerateArgswith[key: string]: unknownand callsstartGenerationdirectly.src/engine/generation/start-generation.tsacceptsStartGenerationInput extends JsonRecord, so undeclared and malformed fields can pass through until individual helpers normalize or ignore them.src/engine/generation/prompt-assembly.tsreadsrequest.userStatusandrequest.userActivity, but those fields are not declared onStartGenerationInput.trimIncompleteModelOutput, but normal refactor generation does not pass it intostartGenerationand the engine does not appear to read it.The old schema cannot be reused directly because it does not match the current runtime shape. For example, current UI sends
message, while the legacy schema only haduserMessage; parsing with the old schema would likely strip or ignore current fields. It also lacks current fields such asmessages,parameters,promptPresetId,imagePromptSettings,hideAutomatedSummarySourceMessages, anddebugSink.Steps to reproduce
generateRequestSchemaand confirm it is only defined, not used as a generation boundary.src/features/runtime/generation/hooks/use-generate.tsintosrc/engine/generation/start-generation.ts.packages/shared/src/schemas/chat.schema.tsand legacy/api/generateroute parsing.trimIncompleteModelOutput: legacy client sent it to/generateand legacy server used it before saving output; refactor keeps the UI setting but does not appear to pass/read it in normal generation.Impact area
Environment
5ddb9840Logs, screenshots, or video
No runtime logs. Evidence is from static source trace.
Relevant refactor anchors:
src/engine/contracts/schemas/chat.schema.tssrc/features/runtime/generation/hooks/use-generate.tssrc/engine/generation/start-generation.tssrc/engine/generation/prompt-assembly.tssrc/shared/stores/ui/model.tsRelevant legacy anchors:
packages/shared/src/schemas/chat.schema.tspackages/server/src/routes/generate.routes.tspackages/client/src/hooks/use-generate.tsRegression notes
Legacy
/api/generateparsedgenerateRequestSchemaat the server boundary and usedtrimIncompleteModelOutputbefore saving model output. The refactor generation spine moved generation into the TypeScript engine path, but no equivalent refactor-native boundary schema appears to have replaced the legacy route contract.Additional context
Recommended direction: do not wire the old
generateRequestSchemadirectly intostartGeneration. Instead, define a refactor-native generation input schema or normalization boundary nearsrc/engine/generation/start-generation.ts, then remove or split the stale legacy-shaped schema fromchat.schema.tsso the contract surface reflects the live path.Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: