[GH-ISSUE #1034] [Issue]: custom agent prompt sections can lag one run behind #506

Closed
opened 2026-10-20 17:29:36 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @cha1latte on GitHub (May 20, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1034

Originally assigned to: @cha1latte on GitHub.

Summary

Custom agent output added as a prompt section appears to be one turn behind, while the same agent output is inserted at the end of the prompt on the turn the agent runs.

Source Discord thread: https://discord.com/channels/1417099416812392641/1480379733173731458/threads/1506490621953577080

Reporter: Wozza

Expected behavior

When a custom pre-processing agent is included as a prompt section, the prompt section should contain the current agent output for the relevant turn or have clear behavior that does not indefinitely reuse stale output.

Actual behavior

With a pre-processing custom agent on a 5-turn cadence:

  1. Turn 1: the agent runs, output is included at the end of the prompt, but the added prompt section has no output.
  2. Turns 2-5: the agent is on cooldown, no output is included at the end of the prompt, but the added prompt section contains the previous output.
  3. Turn 6: the agent runs again, the second output is included at the end of the prompt, while the added prompt section contains the first output.
  4. Turns 7-10: the added prompt section contains the second output.

The reporter says that even if the agent is turned off, the preset keeps inserting the last output into the added prompt section indefinitely.

Steps to reproduce

  1. Create or use a custom pre-processing agent.
  2. Set it to a 5-turn cadence.
  3. Add the agent as a prompt section in a preset.
  4. Send enough messages to cover at least two agent runs.
  5. Inspect generated prompts across turns.
  6. Observe that prompt-section insertion lags behind current agent output and can keep reusing stale output.

Marinara Engine version

Not specified.

Install type

Not specified.

OS + version

Not specified.

Browser or app shell

Not specified.

Screenshots or video

Screenshots are referenced in the Discord post but are not attached here. See the source Discord thread.

Logs

The reporter said this log message helped diagnose the cadence behavior:

{"level":20,"time":1779242845347,"pid":5860,"hostname":"DESKTOP-5IIOQTO","msg":"[agents] Skipping custom agent custom-plot-consultant-ab1d02f4-89e5-47a5-a4f2-30f26a066e4c until cadence threshold: 1/5 user messages"}

Additional context

The reporter concludes there may be a timing issue between main prompt creation and storage of agent output.

Template check

  • I provided the required summary, behavior, reproduction, and environment details.
  • If this is a visual/UI bug, blank screen, layout issue, mobile/responsive issue, incorrect image or sprite, broken animation, or unexpected error state, I attached screenshots or video.
Originally created by @cha1latte on GitHub (May 20, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1034 Originally assigned to: @cha1latte on GitHub. ## Summary Custom agent output added as a prompt section appears to be one turn behind, while the same agent output is inserted at the end of the prompt on the turn the agent runs. Source Discord thread: https://discord.com/channels/1417099416812392641/1480379733173731458/threads/1506490621953577080 Reporter: Wozza ## Expected behavior When a custom pre-processing agent is included as a prompt section, the prompt section should contain the current agent output for the relevant turn or have clear behavior that does not indefinitely reuse stale output. ## Actual behavior With a pre-processing custom agent on a 5-turn cadence: 1. Turn 1: the agent runs, output is included at the end of the prompt, but the added prompt section has no output. 2. Turns 2-5: the agent is on cooldown, no output is included at the end of the prompt, but the added prompt section contains the previous output. 3. Turn 6: the agent runs again, the second output is included at the end of the prompt, while the added prompt section contains the first output. 4. Turns 7-10: the added prompt section contains the second output. The reporter says that even if the agent is turned off, the preset keeps inserting the last output into the added prompt section indefinitely. ## Steps to reproduce 1. Create or use a custom pre-processing agent. 2. Set it to a 5-turn cadence. 3. Add the agent as a prompt section in a preset. 4. Send enough messages to cover at least two agent runs. 5. Inspect generated prompts across turns. 6. Observe that prompt-section insertion lags behind current agent output and can keep reusing stale output. ## Marinara Engine version Not specified. ## Install type Not specified. ## OS + version Not specified. ## Browser or app shell Not specified. ## Screenshots or video Screenshots are referenced in the Discord post but are not attached here. See the source Discord thread. ## Logs The reporter said this log message helped diagnose the cadence behavior: ```json {"level":20,"time":1779242845347,"pid":5860,"hostname":"DESKTOP-5IIOQTO","msg":"[agents] Skipping custom agent custom-plot-consultant-ab1d02f4-89e5-47a5-a4f2-30f26a066e4c until cadence threshold: 1/5 user messages"} ``` ## Additional context The reporter concludes there may be a timing issue between main prompt creation and storage of agent output. ## Template check - [ ] I provided the required summary, behavior, reproduction, and environment details. - [ ] If this is a visual/UI bug, blank screen, layout issue, mobile/responsive issue, incorrect image or sprite, broken animation, or unexpected error state, I attached screenshots or video.
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#506
No description provided.