[GH-ISSUE #4305] [Issue]: Custom agents receive excessive and unrelated context #2330

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

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

Originally assigned to: @SpicyMarinara on GitHub.

Summary

Custom agents receive context they may not need, including character/persona data, summaries, custom fields, available backgrounds, and tracker data for each turn. More granular controls are needed to select which context types are included.

Expected behavior

A custom agent running alone should receive only the configured and necessary context. Users should be able to toggle context types such as chat history, character information, persona information, activated lorebook entries, active summaries, author's notes, tracker data, and recalled memories.

Actual behavior

The custom agent receives excessive context, including loaded characters, chat summaries, custom fields, available backgrounds, <current_game_state> at the start, and <commited_tracker_state> for every turn. The same result occurs when running the agent in-turn with an isolated model/API and when using the custom agent rerun button.

Steps to reproduce

  1. Create a custom agent.
  2. Configure an arbitrary context size.
  3. Run the agent on a task, either in-turn with an isolated model/API or with the custom agent rerun button.
  4. Inspect the context sent to the agent.
  5. Observe unrelated or excessive injected data, including character/persona information, summaries, backgrounds, and tracker state.

Environment

  • Marinara Engine version: 2.3.5 (build 571a766)
  • Install type: Not provided
  • OS + version: Windows; version not provided
  • Browser or app shell: Not provided

Logs, screenshots, or video

Screenshots showing the injected context: https://cdn.discordapp.com/attachments/1532370435528720564/1532370435755348109/Screenshot_20260730_144857_Samsung_Browser.jpg?ex=6a6c9aad&is=6a6b492d&hm=a747efb9a834c130e77294b6177b6a5902cbad00cb46d601b2e70afd46bc18bb&; https://cdn.discordapp.com/attachments/1532370435528720564/1532370436225237234/Screenshot_20260730_145007_Samsung_Browser.jpg?ex=6a6c9aae&is=6a6b492e&hm=be3cf1881f8d0e9a70074b70e5498f20550a752ad533cd487852df6efe645372&; https://cdn.discordapp.com/attachments/1532370435528720564/1532373546716758126/Screenshot_20260730_150413_Samsung_Browser.jpg?ex=6a6c9d93&is=6a6b4c13&hm=ccbef8962b62761b01676337e7f04bef578aa37c49d41248a483d6510a8ecb7f&

Additional context

The affected agent creates memory lorebook entries and was adapted from the lorebook agents. It ran alone, with no other agents requiring tracker data. When agents run together, the combined call should still include all context required by participating agents.

Discord thread: [Fr/Bug] custom agents get too much context -> more control? + ugly context (no regex?)
Discord thread link: https://discord.com/channels/1417099416812392641/1532370435528720564
Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653)

Discord thread transcript (8 messages)
[2026-07-30T12:53:01.896Z] ylliselmanii: - version: 2.3.5
- build: 571a766
- installation: windows
- steps to reproduce: 
  - create custom agent
  - give it a random context size
  - run it with a random task and observe its context
  - see that it has way too much info injected, like loaded characters, chat summaries, custom fields, even available backgrounds + tracker data for each turn

Well, like described above, custom agents (in my case, one that creates a memory lorebook entry, cannibalised from the lorebook agents) gets wayyy to much context infos, plus custom tracker data in each turn, which makes me suspect that the regex isn't working right? For more context: this agent ran completely alone, so no other agents that might have needed the tracker data

What i'd so kindly suggest:
1. Give a little more control in the custom agent menu, over what context is injected in its calls, beyond "X/5 messages", cause not all agents need to have the character/persona sections, or even the chat summaries. Of course, if its call is combined with other agents that make use of it, that's something else entirely. Would just be added up, like output size.
2. Maybe investigate the custom data being injected, such as available backgrounds from the background agent (leak?), or even tracker data from every turn (both <current_game_state> once at the start and <commited_tracker_state> every turn), clogging up the context (see included image)

[attached image 1: https://cdn.discordapp.com/attachments/1532370435528720564/1532370435755348109/Screenshot_20260730_144857_Samsung_Browser.jpg?ex=6a6c9aad&is=6a6b492d&hm=a747efb9a834c130e77294b6177b6a5902cbad00cb46d601b2e70afd46bc18bb&]
[attached image 2: https://cdn.discordapp.com/attachments/1532370435528720564/1532370436225237234/Screenshot_20260730_145007_Samsung_Browser.jpg?ex=6a6c9aae&is=6a6b492e&hm=be3cf1881f8d0e9a70074b70e5498f20550a752ad533cd487852df6efe645372&]
[Discord message: https://discord.com/channels/1417099416812392641/1532370435528720564/1532370435528720564]

[2026-07-30T12:53:19.067Z] ylliselmanii: [Fr/Bug] custom agents get too much context -> more control? + ugly context (no regex?)
[Discord message: https://discord.com/channels/1417099416812392641/1532370435528720564/1532370507549118575]

[2026-07-30T12:59:26.003Z] Marinara: Are you sure you didn't run this agent in the pipeline together with another agent that needed that extra context?
[Discord message: https://discord.com/channels/1417099416812392641/1532370435528720564/1532372046590251171]

[2026-07-30T13:05:05.010Z] ylliselmanii: Fair question, fair question, but i've ran it both in turn (but set to an isolated model/api not used for anything else) and with the custom agent rerun button
[Discord message: https://discord.com/channels/1417099416812392641/1532370435528720564/1532373468488798319]

[2026-07-30T13:05:07.336Z] Marinara: 1. Otherwise, I agree that we should toggle on/off what type of context we provide the agent with. Chat History (last X messages), Character Info, Persona Info, Activated Lorebook entries, Active Summaries, Author's Notes, Tracker data, Recalled Memories.
[Discord message: https://discord.com/channels/1417099416812392641/1532370435528720564/1532373478244880384]

[2026-07-30T13:05:14.464Z] ylliselmanii: And both times the same resukt
[Discord message: https://discord.com/channels/1417099416812392641/1532370435528720564/1532373508141617335]

[2026-07-30T13:05:23.763Z] ylliselmanii: This one, i mean

[attached image 1: https://cdn.discordapp.com/attachments/1532370435528720564/1532373546716758126/Screenshot_20260730_150413_Samsung_Browser.jpg?ex=6a6c9d93&is=6a6b4c13&hm=ccbef8962b62761b01676337e7f04bef578aa37c49d41248a483d6510a8ecb7f&]
[Discord message: https://discord.com/channels/1417099416812392641/1532370435528720564/1532373547144708197]

[2026-07-30T13:05:49.402Z] Marinara: 2. This ties to the above. Of course, if we run it with another agent that needs more data, we should include all the needed info.
[Discord message: https://discord.com/channels/1417099416812392641/1532370435528720564/1532373654682206409]

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 30, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4305 Originally assigned to: @SpicyMarinara on GitHub. ## Summary Custom agents receive context they may not need, including character/persona data, summaries, custom fields, available backgrounds, and tracker data for each turn. More granular controls are needed to select which context types are included. ## Expected behavior A custom agent running alone should receive only the configured and necessary context. Users should be able to toggle context types such as chat history, character information, persona information, activated lorebook entries, active summaries, author's notes, tracker data, and recalled memories. ## Actual behavior The custom agent receives excessive context, including loaded characters, chat summaries, custom fields, available backgrounds, <current_game_state> at the start, and <commited_tracker_state> for every turn. The same result occurs when running the agent in-turn with an isolated model/API and when using the custom agent rerun button. ## Steps to reproduce 1. Create a custom agent. 2. Configure an arbitrary context size. 3. Run the agent on a task, either in-turn with an isolated model/API or with the custom agent rerun button. 4. Inspect the context sent to the agent. 5. Observe unrelated or excessive injected data, including character/persona information, summaries, backgrounds, and tracker state. ## Environment - Marinara Engine version: 2.3.5 (build 571a766) - Install type: Not provided - OS + version: Windows; version not provided - Browser or app shell: Not provided ## Logs, screenshots, or video Screenshots showing the injected context: https://cdn.discordapp.com/attachments/1532370435528720564/1532370435755348109/Screenshot_20260730_144857_Samsung_Browser.jpg?ex=6a6c9aad&is=6a6b492d&hm=a747efb9a834c130e77294b6177b6a5902cbad00cb46d601b2e70afd46bc18bb&; https://cdn.discordapp.com/attachments/1532370435528720564/1532370436225237234/Screenshot_20260730_145007_Samsung_Browser.jpg?ex=6a6c9aae&is=6a6b492e&hm=be3cf1881f8d0e9a70074b70e5498f20550a752ad533cd487852df6efe645372&; https://cdn.discordapp.com/attachments/1532370435528720564/1532373546716758126/Screenshot_20260730_150413_Samsung_Browser.jpg?ex=6a6c9d93&is=6a6b4c13&hm=ccbef8962b62761b01676337e7f04bef578aa37c49d41248a483d6510a8ecb7f& ## Additional context The affected agent creates memory lorebook entries and was adapted from the lorebook agents. It ran alone, with no other agents requiring tracker data. When agents run together, the combined call should still include all context required by participating agents. Discord thread: [Fr/Bug] custom agents get too much context -> more control? + ugly context (no regex?) Discord thread link: https://discord.com/channels/1417099416812392641/1532370435528720564 Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653) <details> <summary>Discord thread transcript (8 messages)</summary> ```text [2026-07-30T12:53:01.896Z] ylliselmanii: - version: 2.3.5 - build: 571a766 - installation: windows - steps to reproduce: - create custom agent - give it a random context size - run it with a random task and observe its context - see that it has way too much info injected, like loaded characters, chat summaries, custom fields, even available backgrounds + tracker data for each turn Well, like described above, custom agents (in my case, one that creates a memory lorebook entry, cannibalised from the lorebook agents) gets wayyy to much context infos, plus custom tracker data in each turn, which makes me suspect that the regex isn't working right? For more context: this agent ran completely alone, so no other agents that might have needed the tracker data What i'd so kindly suggest: 1. Give a little more control in the custom agent menu, over what context is injected in its calls, beyond "X/5 messages", cause not all agents need to have the character/persona sections, or even the chat summaries. Of course, if its call is combined with other agents that make use of it, that's something else entirely. Would just be added up, like output size. 2. Maybe investigate the custom data being injected, such as available backgrounds from the background agent (leak?), or even tracker data from every turn (both <current_game_state> once at the start and <commited_tracker_state> every turn), clogging up the context (see included image) [attached image 1: https://cdn.discordapp.com/attachments/1532370435528720564/1532370435755348109/Screenshot_20260730_144857_Samsung_Browser.jpg?ex=6a6c9aad&is=6a6b492d&hm=a747efb9a834c130e77294b6177b6a5902cbad00cb46d601b2e70afd46bc18bb&] [attached image 2: https://cdn.discordapp.com/attachments/1532370435528720564/1532370436225237234/Screenshot_20260730_145007_Samsung_Browser.jpg?ex=6a6c9aae&is=6a6b492e&hm=be3cf1881f8d0e9a70074b70e5498f20550a752ad533cd487852df6efe645372&] [Discord message: https://discord.com/channels/1417099416812392641/1532370435528720564/1532370435528720564] [2026-07-30T12:53:19.067Z] ylliselmanii: [Fr/Bug] custom agents get too much context -> more control? + ugly context (no regex?) [Discord message: https://discord.com/channels/1417099416812392641/1532370435528720564/1532370507549118575] [2026-07-30T12:59:26.003Z] Marinara: Are you sure you didn't run this agent in the pipeline together with another agent that needed that extra context? [Discord message: https://discord.com/channels/1417099416812392641/1532370435528720564/1532372046590251171] [2026-07-30T13:05:05.010Z] ylliselmanii: Fair question, fair question, but i've ran it both in turn (but set to an isolated model/api not used for anything else) and with the custom agent rerun button [Discord message: https://discord.com/channels/1417099416812392641/1532370435528720564/1532373468488798319] [2026-07-30T13:05:07.336Z] Marinara: 1. Otherwise, I agree that we should toggle on/off what type of context we provide the agent with. Chat History (last X messages), Character Info, Persona Info, Activated Lorebook entries, Active Summaries, Author's Notes, Tracker data, Recalled Memories. [Discord message: https://discord.com/channels/1417099416812392641/1532370435528720564/1532373478244880384] [2026-07-30T13:05:14.464Z] ylliselmanii: And both times the same resukt [Discord message: https://discord.com/channels/1417099416812392641/1532370435528720564/1532373508141617335] [2026-07-30T13:05:23.763Z] ylliselmanii: This one, i mean [attached image 1: https://cdn.discordapp.com/attachments/1532370435528720564/1532373546716758126/Screenshot_20260730_150413_Samsung_Browser.jpg?ex=6a6c9d93&is=6a6b4c13&hm=ccbef8962b62761b01676337e7f04bef578aa37c49d41248a483d6510a8ecb7f&] [Discord message: https://discord.com/channels/1417099416812392641/1532370435528720564/1532373547144708197] [2026-07-30T13:05:49.402Z] Marinara: 2. This ties to the above. Of course, if we run it with another agent that needs more data, we should include all the needed info. [Discord message: https://discord.com/channels/1417099416812392641/1532370435528720564/1532373654682206409] ``` </details> ## 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.
bsakaguchi 2026-10-21 05:47:20 +07:00
Author
Owner

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

Ownership note: @SpicyMarinara is addressing this in draft PR #4307 on agent/4303-4306-issue-sweep.

<!-- gh-comment-id:5131237181 --> @SpicyMarinara commented on GitHub (Jul 30, 2026): Ownership note: @SpicyMarinara is addressing this in draft PR #4307 on `agent/4303-4306-issue-sweep`.
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#2330
No description provided.