[GH-ISSUE #3783] [Issue]: Tracker-agent retries split same-connection agents into separate model requests #2040

Closed
opened 2026-10-21 05:44:50 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @SpicyMarinara on GitHub (Jul 18, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3783

Originally assigned to: @SpicyMarinara on GitHub.

Summary

Retrying tracker agents that share the same connection, model, phase, and standard batch lane can send separate LLM requests instead of one combined tracker batch. Expression Engine is also hard-coded to run outside otherwise compatible agent batches.

Expected behavior

With Max Parallel Agent Jobs set to 1, compatible tracker agents such as Expression Engine, World State, and Background should share one provider request when they use the same connection, model, phase, context, and batch lane.

Agent debug output should show one Agent Batch (3) (__batch__) request and response, followed by individual logical agent results.

Actual behavior

The retry resolver creates a new provider wrapper for each saved agent configuration. Retry grouping keys providers by object identity, so separately wrapped instances of the same stored connection cannot be grouped.

Additionally, shouldRunAgentIndividually explicitly isolates the expression agent type.

The observed retry emitted three provider request/response debug pairs with separate usage and duration totals:

  • Expression Engine: 1,757 total tokens
  • World State: 5,048 total tokens
  • Background: 5,083 total tokens

Steps to reproduce

  1. Configure Expression Engine, World State, and Background to use the same agent connection and model, with Max Parallel Agent Jobs set to 1.
  2. Enable agent debug mode and retry those three tracker agents for the same assistant message.
  3. Observe three individual [Marinara Agent Debug] request events instead of one Agent Batch (3) (__batch__) request.

Environment

  • Marinara Engine version: 2.3.3, source checkout based on origin/staging
  • Install type: source
  • OS + version: macOS 26.5.1
  • Browser or app shell: Firefox, version not captured

Logs, screenshots, or video

The browser debug output showed all three requests beginning at the same timestamp, followed by distinct response timings and usage totals. All agent results succeeded, confirming this is request grouping behavior rather than a parse-fallback retry.

Relevant implementation paths:

  • packages/server/src/routes/generate/retry-agents-route.ts
  • packages/server/src/services/agents/agent-executor.ts
  • packages/server/src/services/agents/agent-pipeline.ts

Additional context

Normal generation caches resolved providers by connection ID, but retry resolution does not. The narrow fix is to reuse retry connection resolutions and allow Expression Engine to participate in compatible batches. Existing provider/model/phase/lane and Max Parallel Agent Jobs boundaries should remain intact.

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 @SpicyMarinara on GitHub (Jul 18, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3783 Originally assigned to: @SpicyMarinara on GitHub. ## Summary Retrying tracker agents that share the same connection, model, phase, and standard batch lane can send separate LLM requests instead of one combined tracker batch. Expression Engine is also hard-coded to run outside otherwise compatible agent batches. ## Expected behavior With `Max Parallel Agent Jobs` set to `1`, compatible tracker agents such as Expression Engine, World State, and Background should share one provider request when they use the same connection, model, phase, context, and batch lane. Agent debug output should show one `Agent Batch (3) (__batch__)` request and response, followed by individual logical agent results. ## Actual behavior The retry resolver creates a new provider wrapper for each saved agent configuration. Retry grouping keys providers by object identity, so separately wrapped instances of the same stored connection cannot be grouped. Additionally, `shouldRunAgentIndividually` explicitly isolates the `expression` agent type. The observed retry emitted three provider request/response debug pairs with separate usage and duration totals: - Expression Engine: 1,757 total tokens - World State: 5,048 total tokens - Background: 5,083 total tokens ## Steps to reproduce 1. Configure Expression Engine, World State, and Background to use the same agent connection and model, with `Max Parallel Agent Jobs` set to `1`. 2. Enable agent debug mode and retry those three tracker agents for the same assistant message. 3. Observe three individual `[Marinara Agent Debug] request` events instead of one `Agent Batch (3) (__batch__)` request. ## Environment - Marinara Engine version: 2.3.3, source checkout based on `origin/staging` - Install type: source - OS + version: macOS 26.5.1 - Browser or app shell: Firefox, version not captured ## Logs, screenshots, or video The browser debug output showed all three requests beginning at the same timestamp, followed by distinct response timings and usage totals. All agent results succeeded, confirming this is request grouping behavior rather than a parse-fallback retry. Relevant implementation paths: - `packages/server/src/routes/generate/retry-agents-route.ts` - `packages/server/src/services/agents/agent-executor.ts` - `packages/server/src/services/agents/agent-pipeline.ts` ## Additional context Normal generation caches resolved providers by connection ID, but retry resolution does not. The narrow fix is to reuse retry connection resolutions and allow Expression Engine to participate in compatible batches. Existing provider/model/phase/lane and `Max Parallel Agent Jobs` boundaries should remain intact. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [x] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:44:50 +07:00
  • closed this issue
  • added the
    in-pr
    bug
    labels
Author
Owner

@SpicyMarinara commented on GitHub (Jul 18, 2026):

Addressed by #3784. The PR is ready for review, CodeRabbit follow-up produced no actionable comments, and both pnpm validation and container build checks pass.

<!-- gh-comment-id:5011138775 --> @SpicyMarinara commented on GitHub (Jul 18, 2026): Addressed by #3784. The PR is ready for review, CodeRabbit follow-up produced no actionable comments, and both pnpm validation and container build checks pass.
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#2040
No description provided.