mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #4536] [Issue]: Pre-generation agents silently stop running after upgrade to 2.4.0 #2471
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#2471
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 @Gunterlie on GitHub (Aug 3, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4536
Originally assigned to: @SpicyMarinara on GitHub.
Summary
A user upgraded 2.3.4 → 2.4.0 and pre-generation ("preprocessing") agents stopped running. The main model generates immediately with nothing injected into the prompt. No error is surfaced, no log line is written, and the agent configs are still present in the UI — so from the user's side the feature simply vanished.
Reported on Discord: https://discord.com/channels/1417099416812392641/1533926858889105619
Reproduction (unconfirmed — see Open questions)
Actual: main model generates immediately, no injection
Candidate cause #1 — externally imported agents, gate defaults to off on upgrade
packages/server/src/services/agents/custom-agent-import-policy.service.ts:9reads thecustom-agent-imports-enabledapp setting and treats an unset value as OFF:The gate was added in
8b4c9018d("Gate external Agent imports"), which is in thev2.3.4..v2.4.0range. There is no backfill migration, so every install that upgraded with agents already imported gets the gate off by default.Effect: at
packages/server/src/routes/generate.routes.ts:1612-1618, every agent matchingisExternallyImportedAgentis filtered out ofconfiguredPromptAgentsbefore phase resolution. Pre-generation agents never run andcontextInjectionsstays empty. The same gate filters atpackages/server/src/routes/generate/retry-agents-route.ts:1231andpackages/server/src/services/prompt/marker-expander.ts:573.The filtering is silent — no log, no user-facing error. That is the part that turned a config change into an unreproducible-looking bug report.
Workaround: Settings → Advanced → Danger Zone → Allow custom Agent imports.
Proposed fix: treat unset as enabled (
!== "false"), so an explicit opt-out still disables the feature but an upgrade does not silently break a working pipeline. Add alogger.debugwherever agents are dropped by this filter.Candidate cause #2 — in-engine agents misclassified by name
isExternallyImportedAgent(packages/shared/src/types/agent.ts:675-681) classifies partly by type prefixcustom-import-. Agents authored in-engine getcustom-<slug>-<uuid>frompackages/client/src/components/agents/AgentEditor.tsx:143, where the slug derives from the agent name.An in-engine agent named "Import Helper" or "Importer" therefore produces
custom-import-helper-<uuid>and is falsely treated as externally imported, then dropped by the gate above. Narrow, but it presents identically to #1 and is a genuine classification bug independent of the upgrade issue.Open questions
The reporter may have created these agents in-engine (via Professor Mari) rather than importing them. In-engine agents get a plain
custom-<slug>-<uuid>type with nocustomAgentImportSourcesetting, so neither the gate nor the Danger Zone toggle applies to them — in which case the real cause is still unidentified.Next places to look for that path:
chatMeta.enableAgentsandchatMeta.activeAgentIdshandling atpackages/server/src/routes/generate.routes.ts:1586-1593, specifically whether 2.4.0 changed how per-chat agent activation is persisted for pre-existing chats.Ruled out: the agent refactor commits
5610c23f9andb03318e2clanded in v2.3.0, before the reporter's known-good version.Regardless of which cause
Agents being dropped from the pipeline should never be silent. A debug log at each filter point, and ideally a visible indicator when enabled agents are skipped, would have made this self-diagnosable.
@SpicyMarinara commented on GitHub (Aug 4, 2026):
Implementation has started in draft PR #4553. Owner: @SpicyMarinara.
@SpicyMarinara commented on GitHub (Aug 4, 2026):
Delivered to staging via #4553 (merge commit
7708b7f0b2).