mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3573] [Issue]: marinara-autonomous-sse-roundrobin bug #1935
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1935
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @captinalex1 on GitHub (Jul 13, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3573
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Autonomous/offline character exchange in group Conversation mode could fail to save or chain valid character replies. The visible symptom looked like "offline/autonomous bickering does not work," but locally it was one combined failure chain across candidate selection, sequential/round-robin scoping, wrong-speaker pruning, and OpenAI-compatible SSE/provider parsing.
In the failing state, Marinara could generate or receive valid text, then lose it as an empty response or prune it as the wrong speaker. Separately, autonomous candidate selection could stop at one blocked/capped/cooldowned character instead of falling through to another eligible character. Together, those made offline multi-character chatter look dead or unreliable.
The related SSE/provider bug matters because a valid provider response could be treated as empty before the autonomous exchange had anything to save or chain.
Expected behavior
groupResponseOrder: "sequential"should behave like one-character-at-a-time generation, not merged multi-speaker generation.choice.delta.content,choice.message.content, or buffered provider result content.Actual behavior
Target: ...response.Observed local error pattern:
Related OpenAI-compatible non-stream/parser failure seen with gateway metadata:
Steps to reproduce
Extra conditions that made the local bug easier to hit:
CharacterName:.Environment
Root cause chain
This did not appear to be one single autonomous scheduler bug. It was a chain of smaller issues that masked each other:
checkCharacterExchange()returned only one randomly chosen candidate.choice.message.contentor buffered provider result content instead of onlychoice.delta.content.The result: valid autonomous turns were generated but not saved, saved as the wrong speaker, pruned to empty, or never attempted because candidate selection stopped too early.
Code locations and local patch notes
packages/server/src/services/conversation/autonomous.service.tsRelevant functions/behavior:
isAutonomousDailyCapUncapped(meta).isAutonomousDailyBudgetExhausted(characterId, schedule, meta).checkAutonomousMessaging()so group chats return all eligible candidates in priority order, not only the top one.checkCharacterExchange()so it shuffles eligible characters and returns the whole ordered candidate list, not just one candidate.Important behavior:
Why it matters:
The autonomous system needs enough candidate information for route-level checks to skip a blocked character and try the next eligible one.
packages/server/src/routes/conversation.routes.tsRelevant functions/behavior:
evaluateAutonomousCandidate()now callsisAutonomousDailyBudgetExhausted().characterIds, skips capped/cooldowned candidates, and starts generation for the first allowed one.Important behavior:
Why it matters:
Before this, one blocked candidate could make the whole autonomous pass look blocked even when another character should have been allowed to respond.
packages/server/src/routes/generate.routes.tsRelevant functions/behavior:
groupResponseOrder === "sequential"is treated like individual mode, same as manual.otherSpeakerNamesbefore building the regex.autonomousDailyCapMode: "uncapped".Critical guard detail:
Target-only prompt behavior:
Why it matters:
Round-robin/sequential generation only works if each generation pass is truly scoped to one target speaker. Otherwise characters can step on each other, write each other's reactions, or produce labels that later get pruned as wrong-speaker output.
packages/server/src/services/llm/providers/openai.provider.tsRelevant functions/behavior:
choice.delta.contentandchoice.message.content.result.contentis used when stream callbacks produce nothing but the provider result still contains text.Important behavior:
Why it matters:
Some OpenAI-compatible gateways/providers return useful assistant text in a final/full
message.contentframe or buffered result content. If Marinara only readsdelta.content, a valid reply can collapse into "empty response."UI/types touched locally
packages/shared/src/types/chat.tsautonomousDailyCapMode?: "default" | "capped" | "uncapped".packages/client/src/components/chat/ChatSettingsDrawer.tsxPower user: no daily cap.packages/client/src/components/chat/CharacterScheduleEditorModal.tsxLogs, screenshots, or video
Local verification after patch:
Group Convosaved real messages after patch.user_dnd.Additional context
Short version:
The bug was not just "autonomous failed" and not just "SSE parsing failed." It was a combined chain:
Fixing those together made offline/autonomous bickering persist and chain correctly.
Template check
Patch appendix
The full local diff is included below so maintainers can inspect or test the actual patch shape directly. It is scoped to the Marinara files involved in the autonomous/round-robin/wrong-speaker/SSE chain.
2.2.0 Patch for automatic offline character chatter.txt
@SpicyMarinara commented on GitHub (Jul 13, 2026):
Implemented and validated in #3574. The PR is ready for review against staging.