mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2491] 13-AGENT-RUNTIME-context-injection-cache: regeneration ignores cached prompt injections #1234
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#1234
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 @Promansis on GitHub (Jun 6, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2491
Originally assigned to: @Promansis on GitHub.
Summary
13-AGENT-RUNTIME-context-injection-cache: on regeneration, refactor does not reuse the target assistant message's cachedmessage.extra.contextInjections. It reruns pre-generation agents instead, so edited cached injections can be ignored or overwritten.Linked tracker: #2482.
Expected behavior
Legacy
mainreuses cached prompt injections from the target assistant message during regeneration, filters outsecret-plot-driver, emits cached injection results, and preserves Knowledge Retrieval / Knowledge Router prompt placement.Actual behavior
Refactor persists fresh
runtime.preInjectionstomessage.extra.contextInjections, but normal regeneration does not load those cached injections back into the runtime.generationReplaydoes not carry cached injections, andcreateGenerationAgentRuntimereruns pre-generation agents on regeneration unless the caller passes explicitagentInjectionOverrides.Steps to reproduce
Impact area
Environment
refactorstatic trace, Batch 7 parityscan for #2482Logs, screenshots, or video
Proof used:
upstream/main:packages/server/src/routes/generate.routes.ts:6615reuses cached injections on regeneration;:6623normalizes cache;:6625filterssecret-plot-driver;:6691splits cached placement;:8028savescontextInjections.upstream/main:packages/server/src/routes/generate/retry-agents-route.ts:1454keeps targetmessage.extra.contextInjectionssynced on injectable agent retry.src/engine/contracts/types/chat.ts:452defines cachedcontextInjections.src/engine/generation/start-generation.ts:3453savesruntime.preInjections.src/engine/generation/start-generation.ts:1159loadsgenerationReplay;src/engine/generation/generation-replay.ts:9replay fields omit cached injections.src/engine/generation/agent-runner.ts:1050only suppresses Echo Chamber on regeneration;src/engine/generation/agent-runner.ts:1676runs pre-generation agents.src/features/modes/roleplay/components/ContextInjectionPanel.tsx:159saves edits;:179rerolls;:22blocks KR/Router reroll.Regression notes
Legacy
mainpreserves edited cached injections for regeneration. Refactor has the UI and persistence surface, but misses regeneration reuse.Additional context
Acceptance criteria:
message.extra.contextInjectionsfrom that target when present.secret-plot-driver.message.extra.contextInjections.Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: