mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #778] [Feature]: Expose pre-generation injections and parallel agent results to opt-in post-processing custom agents #377
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#377
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 @Alatheus1 on GitHub (May 13, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/778
Originally assigned to: @SpicyMarinara on GitHub.
What problem does this solve?
Marinara's AgentContext for post-processing custom agents currently includes the base context and the main model's response, but not the pre-generation injections or parallel-phase results from the same turn. That means a post-processor that needs data a pre-gen or parallel agent already produced has to re-fetch / re-compute it.
For agents that drive tool-heavy retrieval (RAG against an external source, fetching external data via a webhook), this is duplicate tool calls, duplicate tokens, and divergence risk — the second pull may rank or expand differently than the first.
A concrete case: a pre-gen "vault searcher" agent calls a webhook tool to fetch character-creation rules from a user's note system and emits a context_injection for the main model. A separate post-processing agent watches the assistant's response, detects when a new named character was introduced, and authors a character sheet using those rules. Today the post-processor has to repeat the full tool-call loop the pre-gen agent already did. With access to the pre-gen injection, it could reuse the work directly.
Proposed solution
Two opt-in agent settings, both defaulting to false so existing agents are unaffected:
Alternatives considered
The native solution is cleaner than all three. The data is already collected upstream of the post-processing phase — it just isn't exposed.
Additional context
This came up while building a Marinara-Engine integration that uses a pre-gen custom agent to pull external knowledge into context. The agent works well in isolation (obsidian_vault_searcher, marinara-obsidian-relay), but designing a sibling post-processing agent that authors derived content from the same source meant either duplicating the lookups or going through memory. Neither felt right for a pattern that I expect is general — pre-gen retrieves, post-processor uses what was retrieved.
The opt-in default keeps surface area small. The change should be additive on AgentContext (existing destructuring patterns won't break). I'm happy to put up a PR if the proposal lands well, but wanted to confirm direction first.
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@cha1latte commented on GitHub (May 13, 2026):
Triage note: labeling this as
scope-riskbecause the request is strongly aligned with Marinara's custom-agent workflow, but it changes the AgentContext data contract and exposes cross-phase pipeline data that needs an explicit product/API decision.The least risky next step is to confirm the first supported slice, likely opt-in post-processing access only, before plumbing broader parallel-phase result sharing.
@SpicyMarinara commented on GitHub (May 17, 2026):
We'll do the least risky implementation for now.
@SpicyMarinara commented on GitHub (May 17, 2026):
Implemented on staging in
4c002caa. Custom post-processing agents now have opt-in Turn Data Access controls for current-turn pre-generation injections and parallel agent results. The pipeline keeps those fields out of existing agents by default and splits post-processing batches by the opt-in flags so mixed batches do not leak context.