mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #276] [MERGED] feat(generate): add dry-run as flexible endpoint for extension creators #4542
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#4542
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/276
Author: @Xelvanis
Created: 4/28/2026
Status: ✅ Merged
Merged: 4/28/2026
Merged by: @SpicyMarinara
Base:
main← Head:feature/dryRun📝 Commits (2)
bee4ba1feat(generate): add dry-run endpoint for extension prompt inspection417498dMerge branch 'main' into feature/dryRun📊 Changes
3 files changed (+1430 additions, -0 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
packages/server/src/routes/generate.routes.ts(+2 -0)➕
packages/server/src/routes/generate/dry-run-route.ts(+1427 -0)📄 Description
Linked issue
Resolves #280 / lack of extension suitable endpoint so I can make my Silent Impersonate button a reality.
Why this change
Extensions currently have no way to send a generation request, or inspect/preview the generation pipeline, without side effects (e.g. triggering agents, firing webhooks, persisting/appending messages into chat history). Extensions are currently limited in what endpoints they can call to run requests, with sidecar/local being the only option for side effect free generation; this means API connections are rendered inaccessible for this purpose.
This adds a stopgap non-persisting endpoint that runs the full prompt assembly and LLM generation pipeline without any durable side effects — giving extensions a clean "what-if" surface until a proper extension API is designed.
What changed
packages/server/src/routes/generate/dry-run-route.ts— self-contained route registration with two endpoints:POST /api/generate/dryRun— runs the generation pipeline without side effectsPOST /api/generate/dryRun/abort— aborts an in-flight dry run byrunIdpackages/server/src/routes/generate.routes.ts— imports and registers the dry-run routeCHANGELOG.md— entry under[Unreleased] / ### AddedKey capabilities
POST /dryRunwith{ chatId, userMessage }{ chatId, impersonate: true, userMessage?: "direction" }{ ..., returnPrompt: true }→ returns{ prompt, parameters }{ ..., injectLorebook: true }{ ..., injectTrackers: true }{ ..., injectChatSummary: true }{ ..., presetId: "..." }or{ ..., presetText: "..." }{ ..., connectionId: "..." }{ ..., promptParts: { includePersona, includeCharacters, order: [...], ... } }{ ..., streaming: true }POST /dryRun/abortwith{ runId }What is NOT affected
Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
pnpm check(TypeScript + ESLint + full build): 0 errors, 0 new warningsconsole.*in server code)registerXRoute(app)async pattern asregisterRetryAgentsRoute/api/generateroute (Claude sampling restrictions, reasoning effort resolution, context fitting)POST /dryRunwith a realchatIdreturns generated contentPOST /dryRunwithreturnPrompt: truereturns assembled prompt without calling LLM400on missingchatId,404on nonexistent chatPOST /dryRun/abort; extensions can wire in button that emits abort request and cancels generation, successful in user testingDocs and release impact
[Unreleased] / ### AddedUI evidence (if applicable)
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.