[GH-ISSUE #6977] [Feature]: Configurable agent batching (un-hardcode) #3903

Closed
opened 2026-10-21 06:08:36 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @usagirei on GitHub (Oct 2, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6977

Originally assigned to: @SpicyMarinara on GitHub.

What problem does this solve?

Currently, agent batching maintains a list of known agents that should not be batched, and applies some heuristics based on its capabilities or output type to determine it otherwise. (agent-executor.ts::shouldRunAgentIndividually)

There's no direct way to either globally disable agent batching, or tell a custom agent to not be batched.

Locally ran models, especially, can often lose track of what they're supposed to do when batched, and produce outputs containing information they should not be privy to, pulled from the batched context.

Proposed solution

  • Add a per-agent toggle / setting to exclude it from the batching process
  • Add a connection setting to disable all agent batching through that specific connection (or limit its agent concurrency)
    • Separate from the Max Parallel Agent Jobs setting, that seems to controls parallel requests of batch agents, not how many agents can be in a batch
  • Add a marinara-wide setting to change agent batching concurrency (currently hardcoded to 4, when set to 1 effectively disables it as well)

Alternatives considered

Additional context

After this, the agents in the hardcoded batching blacklist could be shipped with the do-not-batch setting active instead of being hardcoded.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @usagirei on GitHub (Oct 2, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6977 Originally assigned to: @SpicyMarinara on GitHub. ## What problem does this solve? Currently, agent batching maintains a list of known agents that should not be batched, and applies some heuristics based on its capabilities or output type to determine it otherwise. (`agent-executor.ts::shouldRunAgentIndividually`) There's no direct way to either globally disable agent batching, or tell a custom agent to not be batched. Locally ran models, especially, can often lose track of what they're supposed to do when batched, and produce outputs containing information they should not be privy to, pulled from the batched context. <!-- Describe the pain point or gap this feature would address --> ## Proposed solution * Add a per-agent toggle / setting to exclude it from the batching process * Add a connection setting to disable all agent batching through that specific connection (or limit its agent concurrency) * Separate from the `Max Parallel Agent Jobs` setting, that seems to controls parallel requests of batch agents, not how many agents can be in a batch * Add a marinara-wide setting to change agent batching concurrency (currently hardcoded to 4, when set to 1 effectively disables it as well) <!-- What would you like to see added or changed? --> ## Alternatives considered <!-- Any other approaches you thought about? --> ## Additional context After this, the agents in the hardcoded batching blacklist could be shipped with the do-not-batch setting active instead of being hardcoded. <!-- Optional: mockups, related issues, references, or examples --> ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
Author
Owner

@SpicyMarinara commented on GitHub (Oct 2, 2026):

Is there a specific reason why you don't want to batch them together? If you want to use different connections for different agents, agents assigned to different connections will not be batched together. Otherwise, separating the calls will greatly increase token use and response wait time.

<!-- gh-comment-id:5961293460 --> @SpicyMarinara commented on GitHub (Oct 2, 2026): Is there a specific reason why you don't want to batch them together? If you want to use different connections for different agents, agents assigned to different connections will not be batched together. Otherwise, separating the calls will greatly increase token use and response wait time.
Author
Owner

@usagirei commented on GitHub (Oct 2, 2026):

Is there a specific reason why you don't want to batch them together? If you want to use different connections for different agents, agents assigned to different connections will not be batched together. Otherwise, separating the calls will greatly increase token use and response wait time.

Like i said in the initial request:
A locally ran model hallucinating and mixing instructions, like custom tracker creating fields with world tracker stuff and vice versa

For a locally ran model, token use and response time are meaningless, I'm not getting billed extra for running an extra request on my own GPU.
And in fact I'd be saving time by not having to re-run the agents and hopefully get a correct response the second time.

It's a minor change, and as a hack you can toggle the "previous output context" or "trigger lorebook entry" and untick the chat active lorebooks, both introduce unnecessary side effects that could be solved by a toggle

It would be just standardizing it for custom agents, that as the comment in shouldRunAgentIndividually says

  // These agents either need compact prompts or carry large private extras that
  // must not be merged into unrelated batched agent requests.
<!-- gh-comment-id:5961947781 --> @usagirei commented on GitHub (Oct 2, 2026): > Is there a specific reason why you don't want to batch them together? If you want to use different connections for different agents, agents assigned to different connections will not be batched together. Otherwise, separating the calls will greatly increase token use and response wait time. Like i said in the initial request: A locally ran model hallucinating and mixing instructions, like custom tracker creating fields with world tracker stuff and vice versa For a locally ran model, token use and response time are meaningless, I'm not getting billed extra for running an extra request on my own GPU. And in fact I'd be saving time by not having to re-run the agents and hopefully get a correct response the second time. It's a minor change, and as a hack you can toggle the "previous output context" or "trigger lorebook entry" and untick the chat active lorebooks, both introduce unnecessary side effects that could be solved by a toggle It would be just standardizing it for custom agents, that as the comment in shouldRunAgentIndividually says ``` // These agents either need compact prompts or carry large private extras that // must not be merged into unrelated batched agent requests. ```
Author
Owner

@SpicyMarinara commented on GitHub (Oct 2, 2026):

I can add a toggle in Agents editors that lets you group the request with others if it's sent on the same generation route and connection. It's a queuing system that could be problematic if you're running consecutive generations on one model; I suppose the order doesn't matter much, but it still needs to exist.

<!-- gh-comment-id:5962723374 --> @SpicyMarinara commented on GitHub (Oct 2, 2026): I can add a toggle in Agents editors that lets you group the request with others if it's sent on the same generation route and connection. It's a queuing system that could be problematic if you're running consecutive generations on one model; I suppose the order doesn't matter much, but it still needs to exist.
Author
Owner

@usagirei commented on GitHub (Oct 2, 2026):

Yeah, the main pain point is just preventing some (custom) agents to get batched when they decide to ignore instructions / take stuff from other batched agents for the ride - the connection / max agents per batch is of minor / unnecessary importance compared to it

<!-- gh-comment-id:5962802272 --> @usagirei commented on GitHub (Oct 2, 2026): Yeah, the main pain point is just preventing some (custom) agents to get batched when they decide to ignore instructions / take stuff from other batched agents for the ride - the connection / max agents per batch is of minor / unnecessary importance compared to it
Author
Owner

@SpicyMarinara commented on GitHub (Oct 3, 2026):

This is in staging now with #6991, and it ships in the next release. The Agent editor has a Share requests with other agents switch under Connection Override. Turn it off and that agent gets its own request, while the other agents on the connection still share theirs. Agents that always run alone (Illustrator, Beholder, agents that use Previous output, and so on) show it as off and locked. The global and per-connection batching settings are out of scope for this one.

<!-- gh-comment-id:5967316600 --> @SpicyMarinara commented on GitHub (Oct 3, 2026): This is in staging now with #6991, and it ships in the next release. The Agent editor has a **Share requests with other agents** switch under **Connection Override**. Turn it off and that agent gets its own request, while the other agents on the connection still share theirs. Agents that always run alone (Illustrator, Beholder, agents that use Previous output, and so on) show it as off and locked. The global and per-connection batching settings are out of scope for this one.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#3903
No description provided.