[GH-ISSUE #6349] [Issue]: Last active agent stalls and cannot be cancelled #3546

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

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

Originally assigned to: @SpicyMarinara on GitHub.

Summary

The last or only active agent remains processing for an extended period. Attempting to cancel it locks the application for nearly a minute and may fail after the agent finishes on its own.

Expected behavior

Agents should finish normally, and users should be able to cancel active agents immediately without locking the application.

Actual behavior

Whichever agent runs last, including an agent running by itself, stalls while processing. Cancelling locks the application for almost a minute and then reports "could not stop active agents" because the agent completed during the delay.

Steps to reproduce

  1. Start a World State, Character Tracker, Quest Tracker, or Inventory Tracker agent.
  2. Wait for the last active agent, or run only one tracker.
  3. Observe that the agent remains processing for an extended period.
  4. Attempt to cancel the active agent.
  5. Observe that the application locks up for nearly a minute and may report "could not stop active agents".

Environment

  • Marinara Engine version: 2.4.6 (build 2.4.6+7d04ebc48c1a, commit 7d04ebc48c)
  • Install type: termux
  • OS + version: Server: Android / Termux 6.1.124-android14-11-g8d713f9e8e7b-ab13202960 (arm64); Client: Android 16 on Pixel 9 Pro Fold
  • Browser or app shell: MarinaraEngine/Android WebView; Chrome 153.0.8010.36

Logs, screenshots, or video

Reported error: "could not stop active agents". Support diagnostics report no detected freeze. No screenshots or video provided.

Additional context

Reproduced with World State, Character Tracker, Quest Tracker, and Inventory Tracker. The last-triggered agent stalls even when it is the only tracker running. Active connection was Deepseek through OpenRouter using deepseek/deepseek-v4-flash. Agent versions were not provided.

Discord thread: Agents Stall Completely
Discord thread link: https://discord.com/channels/1417099416812392641/1550689737306800229
Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653)

Discord thread transcript (5 messages)
[2026-09-19T02:07:23.796Z] Leytra: Previous title: agents can't be aborted.
Changing because it's actually part of a bigger issue.
Old report:
So agents can't be properly cancelled anymore.

When I try it locks up the entire program for almost a whole minute, and resolves with "could not stop active agents" because in the time it was locked up, they finished running.

It's now basically impossible to see a message and go "nah", deciding to reroll it before the agents have finished and just cancelling the agents to reroll it immediately instead of waiting for them to finish.
Newer report in the reply.
[Discord message: https://discord.com/channels/1417099416812392641/1550689737306800229/1550689737306800229]

[2026-09-19T02:07:24.775Z] 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/1550689737306800229/1550689741412892796]

[2026-09-19T02:07:29.632Z] Leytra: Marinara Engine diagnostics
Version: 2.4.6
Build: 2.4.6+7d04ebc48c1a
Commit: 7d04ebc48c1a
Server OS: Android / Termux 6.1.124-android14-11-g8d713f9e8e7b-ab13202960 (arm64)
Server memory: heap 186.7 / 3936 MiB; RSS 337.6 MiB
Background wake lock: acquired
Last detected freeze: none detected
Previous session: ended without shutting down - last alive 2026-09-19T01:57:32.190Z (up 5m, RSS 325.7 MiB); device rebooted before next launch: no
Sessions ended without shutdown: 10 recorded
Client OS: Android 16
Browser / app shell: Mozilla/5.0 (Linux; Android 16; Pixel 9 Pro Fold Build/BP2A.250605.031.A3; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/153.0.8010.36 Safari/537.36 MarinaraEngine/Android
Client runtime: {"build":"2.4.6+7d04ebc48c1a","page":"mu7qrhup-mitlw8f6","persistence":"local","navigation":"navigate","standalone":false,"view":[803,0,0,0],"events":[{"at":1789781298518,"page":"mu7li1ph-1r932ggn","build":"2.4.6+04511dec3d92","kind":"message-edited","view":[803,0,0,0]},{"at":1789782740277,"page":"mu7li1ph-1r932ggn","build":"2.4.6+04511dec3d92","kind":"reload-requested","reason":"version-update","view":[803,0,0,0]},{"at":1789782769582,"page":"mu7qg7fy-hyykgmx5","build":"2.4.6+7d04ebc48c1a","kind":"page-start","view":[803,0,0,0]},{"at":1789782868034,"page":"mu7qg7fy-hyykgmx5","build":"2.4.6+7d04ebc48c1a","kind":"message-edited","view":[803,0,0,0]},{"at":1789783296290,"page":"mu7qrhup-mitlw8f6","build":"2.4.6+7d04ebc48c1a","kind":"page-start","view":[803,0,0,0]}]}
GPU: Mali-G715
Active connection: Deepseek
Connection provider: openrouter
LLM model: deepseek/deepseek-v4-flash
Mari last acted on: none recorded this session
[Discord message: https://discord.com/channels/1417099416812392641/1550689737306800229/1550689761784631377]

[2026-09-19T03:48:29.035Z] Leytra: Doing further testing 
The issue seems to be that the last agent always gets stuck infinitely processing.
I've tried world state, character tracker, quest tracker, inventory tracker 
Whichever triggers last, even if it's the only tracker running, stalls for ages and can't be cancelled properly.
[Discord message: https://discord.com/channels/1417099416812392641/1550689737306800229/1550715176763007048]

[2026-09-19T03:50:46.230Z] Leytra: Agents Stall Completely
[Discord message: https://discord.com/channels/1417099416812392641/1550689737306800229/1550715752200274051]

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 19, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6349 Originally assigned to: @SpicyMarinara on GitHub. ## Summary The last or only active agent remains processing for an extended period. Attempting to cancel it locks the application for nearly a minute and may fail after the agent finishes on its own. ## Expected behavior Agents should finish normally, and users should be able to cancel active agents immediately without locking the application. ## Actual behavior Whichever agent runs last, including an agent running by itself, stalls while processing. Cancelling locks the application for almost a minute and then reports "could not stop active agents" because the agent completed during the delay. ## Steps to reproduce 1. Start a World State, Character Tracker, Quest Tracker, or Inventory Tracker agent. 2. Wait for the last active agent, or run only one tracker. 3. Observe that the agent remains processing for an extended period. 4. Attempt to cancel the active agent. 5. Observe that the application locks up for nearly a minute and may report "could not stop active agents". ## Environment - Marinara Engine version: 2.4.6 (build 2.4.6+7d04ebc48c1a, commit 7d04ebc48c1a) - Install type: termux - OS + version: Server: Android / Termux 6.1.124-android14-11-g8d713f9e8e7b-ab13202960 (arm64); Client: Android 16 on Pixel 9 Pro Fold - Browser or app shell: MarinaraEngine/Android WebView; Chrome 153.0.8010.36 ## Logs, screenshots, or video Reported error: "could not stop active agents". Support diagnostics report no detected freeze. No screenshots or video provided. ## Additional context Reproduced with World State, Character Tracker, Quest Tracker, and Inventory Tracker. The last-triggered agent stalls even when it is the only tracker running. Active connection was Deepseek through OpenRouter using deepseek/deepseek-v4-flash. Agent versions were not provided. Discord thread: Agents Stall Completely Discord thread link: https://discord.com/channels/1417099416812392641/1550689737306800229 Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653) <details> <summary>Discord thread transcript (5 messages)</summary> ```text [2026-09-19T02:07:23.796Z] Leytra: Previous title: agents can't be aborted. Changing because it's actually part of a bigger issue. Old report: So agents can't be properly cancelled anymore. When I try it locks up the entire program for almost a whole minute, and resolves with "could not stop active agents" because in the time it was locked up, they finished running. It's now basically impossible to see a message and go "nah", deciding to reroll it before the agents have finished and just cancelling the agents to reroll it immediately instead of waiting for them to finish. Newer report in the reply. [Discord message: https://discord.com/channels/1417099416812392641/1550689737306800229/1550689737306800229] [2026-09-19T02:07:24.775Z] 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/1550689737306800229/1550689741412892796] [2026-09-19T02:07:29.632Z] Leytra: Marinara Engine diagnostics Version: 2.4.6 Build: 2.4.6+7d04ebc48c1a Commit: 7d04ebc48c1a Server OS: Android / Termux 6.1.124-android14-11-g8d713f9e8e7b-ab13202960 (arm64) Server memory: heap 186.7 / 3936 MiB; RSS 337.6 MiB Background wake lock: acquired Last detected freeze: none detected Previous session: ended without shutting down - last alive 2026-09-19T01:57:32.190Z (up 5m, RSS 325.7 MiB); device rebooted before next launch: no Sessions ended without shutdown: 10 recorded Client OS: Android 16 Browser / app shell: Mozilla/5.0 (Linux; Android 16; Pixel 9 Pro Fold Build/BP2A.250605.031.A3; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/153.0.8010.36 Safari/537.36 MarinaraEngine/Android Client runtime: {"build":"2.4.6+7d04ebc48c1a","page":"mu7qrhup-mitlw8f6","persistence":"local","navigation":"navigate","standalone":false,"view":[803,0,0,0],"events":[{"at":1789781298518,"page":"mu7li1ph-1r932ggn","build":"2.4.6+04511dec3d92","kind":"message-edited","view":[803,0,0,0]},{"at":1789782740277,"page":"mu7li1ph-1r932ggn","build":"2.4.6+04511dec3d92","kind":"reload-requested","reason":"version-update","view":[803,0,0,0]},{"at":1789782769582,"page":"mu7qg7fy-hyykgmx5","build":"2.4.6+7d04ebc48c1a","kind":"page-start","view":[803,0,0,0]},{"at":1789782868034,"page":"mu7qg7fy-hyykgmx5","build":"2.4.6+7d04ebc48c1a","kind":"message-edited","view":[803,0,0,0]},{"at":1789783296290,"page":"mu7qrhup-mitlw8f6","build":"2.4.6+7d04ebc48c1a","kind":"page-start","view":[803,0,0,0]}]} GPU: Mali-G715 Active connection: Deepseek Connection provider: openrouter LLM model: deepseek/deepseek-v4-flash Mari last acted on: none recorded this session [Discord message: https://discord.com/channels/1417099416812392641/1550689737306800229/1550689761784631377] [2026-09-19T03:48:29.035Z] Leytra: Doing further testing The issue seems to be that the last agent always gets stuck infinitely processing. I've tried world state, character tracker, quest tracker, inventory tracker Whichever triggers last, even if it's the only tracker running, stalls for ages and can't be cancelled properly. [Discord message: https://discord.com/channels/1417099416812392641/1550689737306800229/1550715176763007048] [2026-09-19T03:50:46.230Z] Leytra: Agents Stall Completely [Discord message: https://discord.com/channels/1417099416812392641/1550689737306800229/1550715752200274051] ``` </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:04:10 +07:00
Author
Owner

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

Owner: @SpicyMarinara, assisted by Codex. Taking this report in the issue sweep tracked by draft PR #6359. I will trace the affected path, keep the fix small, and record the relevant regression proof before merging to staging.

<!-- gh-comment-id:5741686144 --> @SpicyMarinara commented on GitHub (Sep 19, 2026): Owner: @SpicyMarinara, assisted by Codex. Taking this report in the issue sweep tracked by draft PR #6359. I will trace the affected path, keep the fix small, and record the relevant regression proof before merging to staging.
Author
Owner

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

Merged to staging in #6359. Agent completions now stop at the terminal SSE frame even when the provider keeps HTTP open. Both completion and streaming paths cancel their readers, and unfinished responses remain cancellable. Provider regressions pass. The reported physical Termux/OpenRouter setup remains a manual retest.

<!-- gh-comment-id:5742475278 --> @SpicyMarinara commented on GitHub (Sep 19, 2026): Merged to staging in #6359. Agent completions now stop at the terminal SSE frame even when the provider keeps HTTP open. Both completion and streaming paths cancel their readers, and unfinished responses remain cancellable. Provider regressions pass. The reported physical Termux/OpenRouter setup remains a manual retest.
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#3546
No description provided.