mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2988] [Issue]: Regeneration aborts on any non-critical pre-gen agent failure, while a fresh message continues (mismatched failure gates) #1561
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#1561
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 @kolacheee on GitHub (Jun 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2988
Originally assigned to: @SpicyMarinara on GitHub.
What's wrong
The fresh-message pre-generation failure gate treats only secret_plot failures as critical and lets generation continue past every other failed pre-gen agent. The regeneration gate — despite a comment claiming it is "the same as the new-message path" — treats EVERY failed pre-gen agent (except knowledge-retrieval, knowledge-router, secret-plot-driver) as fatal and aborts the whole regeneration with a user-facing error. So the exact same transient failure (e.g. a pre_generation Director or a custom context_injection agent hitting a rate-limit/timeout/parse error) silently continues on a fresh message but hard-fails a regeneration.
How to reproduce (try it yourself)
You'll see: the fresh message proceeds (failure logged as non-critical); the regeneration aborts with "Pre-generation agent(s) failed (...): ... Please try again."
Expected: both degrade gracefully the same way — only a critical (secret_plot) failure should abort.
Where it is
packages/server/src/routes/generate.routes.ts:5671-5690(regen gate) vs:5512-5527(fresh gate).What's happening
There are two separate failure-gate implementations with mismatched criticality definitions. The fresh path classifies criticality by RESULT type (
!success && r.type === "secret_plot"). The regen path uses an allowlist by AGENT type (only knowledge-retrieval/knowledge-router/secret-plot-driver are non-fatal), so every other pre-gen failure aborts. The misleading "same as the new-message path" comment masks the divergence.Suggested fix
Make the regen gate mirror the fresh gate's criticality classification. Replace the body at generate.routes.ts:5671-5690:
No regression: secret_plot never runs on the regen path (the secret-plot agent is gated on
!regenerateMessageIdand excluded from the regen pre-gen filter), socriticalFailedRegenis always empty there and the gate becomes a correct warn-only no-op; continuing past a non-critical failure is already safe because injection-building skips!successresults. Recommended: extract a sharedconst isCriticalPreGenFailure = (r) => !r.success && r.type === "secret_plot";and use it in both gates so they cannot drift again.AI-investigated against v2.0.6; cited lines read and confirmed. Please verify before fixing.
@SpicyMarinara commented on GitHub (Jun 29, 2026):
Fixed in merged staging PR #3004.