[GH-ISSUE #5931] [Issue]: Push Story direction is omitted or stale with prompt presets #3277

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

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

Originally assigned to: @SpicyMarinara on GitHub.

Summary

In Roleplay chats using a prompt preset, the current Push Story direction is not included in the next generation prompt. Adding a Narrative Director marker causes the previous turn's direction to be used instead, while re-rolling applies the current direction.

Expected behavior

The armed Push Story direction should be included in the prompt for the immediately following response, including when a prompt preset is active and a Narrative Director marker is used.

Actual behavior

The response ignores the current Push Story direction and may remain inconsistent with it. With a Narrative Director marker and prompt section enabled, the previous turn's direction is used instead. Re-rolling applies the current direction, requiring two generations per push.

Steps to reproduce

  1. Use Marinara Engine in Roleplay mode with the Narrative Director agent installed and a prompt preset active.
  2. Arm Push Story and enter a direction for the next response, such as "we went to the realtor."
  3. Generate a response and observe that the direction is ignored; in the reported example, the reply remained in the café and the HUD was unchanged.
  4. Add a Narrative Director (Agent) marker to the preset with "Add prompt section" enabled, then arm Push Story with a new direction.
  5. Generate another response and observe that the previous turn's direction is used instead of the current one.
  6. Re-roll the response and observe that the current direction is then applied.

Environment

  • Marinara Engine version: 2.4.4 (build 2.4.4+1a299369ac70, commit 1a299369ac)
  • Install type: Not provided
  • OS + version: Server: Linux 6.8.0-137-generic (x64); client: Windows 10.0
  • Browser or app shell: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Whale/4.39.410.14 Safari/537.36

Logs, screenshots, or video

No screenshots or video were provided. Diagnostics reportedly show that affected messages have no direction in extra.cachedPrompt and have extra.contextInjections set to null, while agent_runs reports success.

Additional context

Active connection: 젬마_Ollama; provider: custom; model: gemma4:31b. Chatting mode: RolePlay. Narrative Director installed version 1.0.2. The reported diagnosis is that prompt presets enable presetOwnsAgentPlacement, causing unmatched runtime injections to be omitted; the director uses resultType director_event rather than context_injection and therefore does not match the preset marker. When a marker is present, the marker reportedly resolves the latest stored director run during assembly, producing a one-turn-stale direction. The issue was reported as introduced in v2.4.0 by commit 91ba44fd2; Long-Term Memory received a related fix in v2.4.3 / #5200.

Discord thread: [Bug] Push Story direction never reaches the prompt when the chat uses a prompt preset
Discord thread link: https://discord.com/channels/1417099416812392641/1546505832169087056
Requested by: Kuc0 (kuc0, Discord ID 108988150629531648)

Discord thread transcript (3 messages)
[2026-09-07T13:02:03.078Z] Lattete: **Symptoms**
Roleplay + prompt preset. I arm Push Story, the popover shows a direction for the next response, but the reply ignores it.

Adding a `Narrative Director (Agent)` marker to the preset (with "Add prompt section" on) doesn't fix it: the prompt then gets the **previous** turn's direction, which overrides what I wrote. My turn said "we went to the realtor" and the reply stayed in the café, HUD unchanged. Only re-rolling applies the current direction — so each push costs two generations.

**Diagnosis** *(compiled with Claude Code's help — please verify)*
- On affected messages `extra.cachedPrompt` contains none of the direction and `extra.contextInjections` is null, though `agent_runs` shows success.
- With a preset, `presetOwnsAgentPlacement` is true, so `splitRuntimeHandledAgentInjections(..., { omitUnmatched: true })` drops injections with no matching marker (generate.routes.ts ~5320).
- `director` can never match one: eligibility needs `resultType === "context_injection"`, but director's is `director_event` (runtime-agent-sections.ts ~108).
- Introduced in v2.4.0 by 91ba44fd2 (LTM integration), which added `omitUnmatched`. Same bug was fixed for Long-Term Memory only in v2.4.3 / #5200.
- With a marker, `{{agent::director}}` resolves from the latest stored run at assembly time — one turn stale (marker-expander.ts ~565).


Marinara Engine diagnostics
Version: 2.4.4
Build: 2.4.4+1a299369ac70
Commit: 1a299369ac70
Server OS: Linux 6.8.0-137-generic (x64)
Server memory: heap 301.7 / 526 MiB; RSS 270.8 MiB
Client OS: Windows 10.0
Browser / app shell: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Whale/4.39.410.14 Safari/537.36
GPU: ANGLE (NVIDIA, NVIDIA GeForce GTX 1050 (0x00001C81) Direct3D11 vs_5_0 ps_5_0, D3D11)
Active connection: 젬마_Ollama
Connection provider: custom
LLM model: gemma4:31b

Chatting Mode: RolePlay
Narrative Director, Installed v1.0.2
[Discord message: https://discord.com/channels/1417099416812392641/1546505832169087056/1546505832169087056]

[2026-09-07T13:02:03.981Z] Professor Mari [bot]: Howdy!

Thank you for submitting a new bug report/feature request, your support means a lot. A member of the team will look into it as soon as possible, and if they find it valid, they will open a GitHub Issue out of it. You can check whether it was addressed on the staging build of Marinara Engine. **Do not ping any of the developers, this will not speed up the process.**

**Please include a Support Diagnostic in the post if you haven't done it yet.** Otherwise, ignore this step. To grab it, go to the Marinara Engine tab:

`Settings -> Advanced -> Support Diagnostics -> Copy Support Diagnostics.`

If your report is about any of the **Agents**, please provide **the Agent's version** which you can grab from here:

`Agents -> Download Agents -> Installed Agents -> Selected Agent -> Installed Version`

Thank you, this will help tremendously.

This is an automated message, but if you reply to it, I will do my best to assist you using my LLM-powered brain. That said, it's best for a human to handle this case.

Cheers!
[Discord message: https://discord.com/channels/1417099416812392641/1546505832169087056/1546505835956543583]

[2026-09-07T13:31:13.231Z] ylliselmanii: have the same problem, but was too lazy to make a post lol. thanks
[Discord message: https://discord.com/channels/1417099416812392641/1546505832169087056/1546513172842811573]

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 (Sep 7, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5931 Originally assigned to: @SpicyMarinara on GitHub. ## Summary In Roleplay chats using a prompt preset, the current Push Story direction is not included in the next generation prompt. Adding a Narrative Director marker causes the previous turn's direction to be used instead, while re-rolling applies the current direction. ## Expected behavior The armed Push Story direction should be included in the prompt for the immediately following response, including when a prompt preset is active and a Narrative Director marker is used. ## Actual behavior The response ignores the current Push Story direction and may remain inconsistent with it. With a Narrative Director marker and prompt section enabled, the previous turn's direction is used instead. Re-rolling applies the current direction, requiring two generations per push. ## Steps to reproduce 1. Use Marinara Engine in Roleplay mode with the Narrative Director agent installed and a prompt preset active. 2. Arm Push Story and enter a direction for the next response, such as "we went to the realtor." 3. Generate a response and observe that the direction is ignored; in the reported example, the reply remained in the café and the HUD was unchanged. 4. Add a Narrative Director (Agent) marker to the preset with "Add prompt section" enabled, then arm Push Story with a new direction. 5. Generate another response and observe that the previous turn's direction is used instead of the current one. 6. Re-roll the response and observe that the current direction is then applied. ## Environment - Marinara Engine version: 2.4.4 (build 2.4.4+1a299369ac70, commit 1a299369ac70) - Install type: Not provided - OS + version: Server: Linux 6.8.0-137-generic (x64); client: Windows 10.0 - Browser or app shell: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Whale/4.39.410.14 Safari/537.36 ## Logs, screenshots, or video No screenshots or video were provided. Diagnostics reportedly show that affected messages have no direction in extra.cachedPrompt and have extra.contextInjections set to null, while agent_runs reports success. ## Additional context Active connection: 젬마_Ollama; provider: custom; model: gemma4:31b. Chatting mode: RolePlay. Narrative Director installed version 1.0.2. The reported diagnosis is that prompt presets enable presetOwnsAgentPlacement, causing unmatched runtime injections to be omitted; the director uses resultType director_event rather than context_injection and therefore does not match the preset marker. When a marker is present, the marker reportedly resolves the latest stored director run during assembly, producing a one-turn-stale direction. The issue was reported as introduced in v2.4.0 by commit 91ba44fd2; Long-Term Memory received a related fix in v2.4.3 / #5200. Discord thread: [Bug] Push Story direction never reaches the prompt when the chat uses a prompt preset Discord thread link: https://discord.com/channels/1417099416812392641/1546505832169087056 Requested by: Kuc0 (kuc0, Discord ID 108988150629531648) <details> <summary>Discord thread transcript (3 messages)</summary> ```text [2026-09-07T13:02:03.078Z] Lattete: **Symptoms** Roleplay + prompt preset. I arm Push Story, the popover shows a direction for the next response, but the reply ignores it. Adding a `Narrative Director (Agent)` marker to the preset (with "Add prompt section" on) doesn't fix it: the prompt then gets the **previous** turn's direction, which overrides what I wrote. My turn said "we went to the realtor" and the reply stayed in the café, HUD unchanged. Only re-rolling applies the current direction — so each push costs two generations. **Diagnosis** *(compiled with Claude Code's help — please verify)* - On affected messages `extra.cachedPrompt` contains none of the direction and `extra.contextInjections` is null, though `agent_runs` shows success. - With a preset, `presetOwnsAgentPlacement` is true, so `splitRuntimeHandledAgentInjections(..., { omitUnmatched: true })` drops injections with no matching marker (generate.routes.ts ~5320). - `director` can never match one: eligibility needs `resultType === "context_injection"`, but director's is `director_event` (runtime-agent-sections.ts ~108). - Introduced in v2.4.0 by 91ba44fd2 (LTM integration), which added `omitUnmatched`. Same bug was fixed for Long-Term Memory only in v2.4.3 / #5200. - With a marker, `{{agent::director}}` resolves from the latest stored run at assembly time — one turn stale (marker-expander.ts ~565). Marinara Engine diagnostics Version: 2.4.4 Build: 2.4.4+1a299369ac70 Commit: 1a299369ac70 Server OS: Linux 6.8.0-137-generic (x64) Server memory: heap 301.7 / 526 MiB; RSS 270.8 MiB Client OS: Windows 10.0 Browser / app shell: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Whale/4.39.410.14 Safari/537.36 GPU: ANGLE (NVIDIA, NVIDIA GeForce GTX 1050 (0x00001C81) Direct3D11 vs_5_0 ps_5_0, D3D11) Active connection: 젬마_Ollama Connection provider: custom LLM model: gemma4:31b Chatting Mode: RolePlay Narrative Director, Installed v1.0.2 [Discord message: https://discord.com/channels/1417099416812392641/1546505832169087056/1546505832169087056] [2026-09-07T13:02:03.981Z] Professor Mari [bot]: Howdy! Thank you for submitting a new bug report/feature request, your support means a lot. A member of the team will look into it as soon as possible, and if they find it valid, they will open a GitHub Issue out of it. You can check whether it was addressed on the staging build of Marinara Engine. **Do not ping any of the developers, this will not speed up the process.** **Please include a Support Diagnostic in the post if you haven't done it yet.** Otherwise, ignore this step. To grab it, go to the Marinara Engine tab: `Settings -> Advanced -> Support Diagnostics -> Copy Support Diagnostics.` If your report is about any of the **Agents**, please provide **the Agent's version** which you can grab from here: `Agents -> Download Agents -> Installed Agents -> Selected Agent -> Installed Version` Thank you, this will help tremendously. This is an automated message, but if you reply to it, I will do my best to assist you using my LLM-powered brain. That said, it's best for a human to handle this case. Cheers! [Discord message: https://discord.com/channels/1417099416812392641/1546505832169087056/1546505835956543583] [2026-09-07T13:31:13.231Z] ylliselmanii: have the same problem, but was too lazy to make a post lol. thanks [Discord message: https://discord.com/channels/1417099416812392641/1546505832169087056/1546513172842811573] ``` </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 06:01:36 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Sep 7, 2026):

Owner: @SpicyMarinara (Codex). Investigating the Engine-owned behavior in draft #5939 as part of the assigned issue sweep. Existing open/draft PRs and issue links were checked; package-owned changes, if required, will be kept out of Engine.

<!-- gh-comment-id:5575868608 --> @SpicyMarinara commented on GitHub (Sep 7, 2026): Owner: @SpicyMarinara (Codex). Investigating the Engine-owned behavior in draft #5939 as part of the assigned issue sweep. Existing open/draft PRs and issue links were checked; package-owned changes, if required, will be kept out of Engine.
Author
Owner

@SpicyMarinara commented on GitHub (Sep 8, 2026):

Push Story now keeps the current Director output both at preset markers and in the no-marker fallback. Merged into staging in #5939 at 20b3d2ce99 after the full required CI matrix and CodeRabbit review completed. Automated evidence and manual verification limits are recorded in the PR.

<!-- gh-comment-id:5577393659 --> @SpicyMarinara commented on GitHub (Sep 8, 2026): Push Story now keeps the current Director output both at preset markers and in the no-marker fallback. Merged into staging in #5939 at 20b3d2ce99245fa03a09bd14a81e66a1c9536716 after the full required CI matrix and CodeRabbit review completed. Automated evidence and manual verification limits are recorded in the PR.
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#3277
No description provided.