[GH-ISSUE #698] [Feature]: Run autonomous messaging schedules on the server #333

Closed
opened 2026-10-20 17:27:44 +07:00 by bsakaguchi · 5 comments
Owner

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

Originally assigned to: @SpicyMarinara on GitHub.

What problem does this solve?

Autonomous messaging appears to depend on the UI being active. If the browser is closed or the user is away, a scheduled autonomous reply does not appear to be generated at the intended time. Instead, the character may reply later when the user opens the UI again and the character is enabled, which makes autonomous messaging feel reactive to app activity rather than genuinely scheduled.

This limits the "characters feel alive" workflow because an enabled character should be able to reply according to its schedule even when the user is not actively viewing the chat.

Source/context: Discord feature request. Source link: https://discord.com/channels/1417099416812392641/1503458087619792917

Proposed solution

Move or add autonomous-message scheduling to the server so enabled autonomous characters can generate scheduled messages without requiring an active browser session.

The server-side path should:

  • Track when autonomous replies are due.
  • Generate the reply at the scheduled time or the closest safe server-side opportunity.
  • Persist the generated message to the correct chat.
  • Avoid duplicate generation if the UI is also open.
  • Respect the existing per-character or per-chat autonomous settings.

This should be treated as the first implementation slice before adding more complex group speaker selection or Discord bot mirroring.

Alternatives considered

  • Keep autonomous messaging client-driven only. This is simpler, but scheduled replies cannot happen while the UI is closed.
  • Generate missed autonomous replies only when the UI opens. This preserves current architecture but still makes the reply timing feel wrong.

Additional context

This is split out from the broader group autonomy and Discord mirroring request so the core scheduling behavior can be evaluated independently.

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 @cha1latte on GitHub (May 11, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/698 Originally assigned to: @SpicyMarinara on GitHub. ## What problem does this solve? Autonomous messaging appears to depend on the UI being active. If the browser is closed or the user is away, a scheduled autonomous reply does not appear to be generated at the intended time. Instead, the character may reply later when the user opens the UI again and the character is enabled, which makes autonomous messaging feel reactive to app activity rather than genuinely scheduled. This limits the "characters feel alive" workflow because an enabled character should be able to reply according to its schedule even when the user is not actively viewing the chat. Source/context: Discord feature request. Source link: https://discord.com/channels/1417099416812392641/1503458087619792917 ## Proposed solution Move or add autonomous-message scheduling to the server so enabled autonomous characters can generate scheduled messages without requiring an active browser session. The server-side path should: - Track when autonomous replies are due. - Generate the reply at the scheduled time or the closest safe server-side opportunity. - Persist the generated message to the correct chat. - Avoid duplicate generation if the UI is also open. - Respect the existing per-character or per-chat autonomous settings. This should be treated as the first implementation slice before adding more complex group speaker selection or Discord bot mirroring. ## Alternatives considered - Keep autonomous messaging client-driven only. This is simpler, but scheduled replies cannot happen while the UI is closed. - Generate missed autonomous replies only when the UI opens. This preserves current architecture but still makes the reply timing feel wrong. ## Additional context This is split out from the broader group autonomy and Discord mirroring request so the core scheduling behavior can be evaluated independently. ## 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.
Author
Owner

@cha1latte commented on GitHub (May 11, 2026):

Suggested triage: scope-risk, because this likely requires server-side background scheduling and careful duplicate-generation handling.

Suggested triage comment:

Triage note: labeling this as scope-risk because it is aligned with autonomous character behavior but likely needs server-side scheduling and coordination with the existing client-driven autonomous path.

Least risky next step is to define the first supported scheduling behavior and duplicate-prevention rules before implementation.

<!-- gh-comment-id:4424236392 --> @cha1latte commented on GitHub (May 11, 2026): Suggested triage: `scope-risk`, because this likely requires server-side background scheduling and careful duplicate-generation handling. Suggested triage comment: Triage note: labeling this as `scope-risk` because it is aligned with autonomous character behavior but likely needs server-side scheduling and coordination with the existing client-driven autonomous path. Least risky next step is to define the first supported scheduling behavior and duplicate-prevention rules before implementation.
Author
Owner

@cha1latte commented on GitHub (May 14, 2026):

Scope clarification: this should not expand the first implementation slice into a full presence/status system. The core #698 slice should remain server-side autonomous scheduling: wake up, evaluate whether the character is currently allowed to message, avoid duplicates with any client-side path, and persist the generated message. User presence/status should be treated as a design constraint or follow-up slice unless the scheduler needs a minimal presence signal to make the first version safe.

User idea to consider for this feature: when the server-side autonomous scheduler wakes up and decides whether to generate a message, pass both the user's current presence/status and the character's current schedule/status into that decision.

Suggested user presence behavior:

  • Active/open UI: green.
  • UI open but inactive for a configured amount of time: yellow/away.
  • UI closed/disconnected: gray/offline.

The character should still follow its own schedule. If the character is offline, it should not send messages. If the character is in a busy/do-not-disturb state such as red, it also should not send messages. Yellow is less clear and may need product decision, but the general idea is that the character is still "doing its own things" according to its schedule.

This means messages are more likely when the user's real-life availability overlaps with the character's green/available schedule period. For example, if the user is away/offline and the character enters a green period, the scheduler could trigger a possible message such as the character reporting on its day, checking in, or saying something at night.

Before actually sending, there should be a logic check:

  • Is the character currently allowed to message based on its schedule/status?
  • What is the user's current presence/status?
  • Is autonomous messaging allowed for this user/character/chat state?
  • Has the character already sent too many consecutive messages while the user is away/offline?

When the user is gray/offline, autonomous messaging should be restrained. A character should only be allowed to send a maximum of 1-2 consecutive messages while the user remains offline, so background scheduling can still make characters feel alive without creating a long unattended reply chain.

<!-- gh-comment-id:4446169176 --> @cha1latte commented on GitHub (May 14, 2026): Scope clarification: this should not expand the first implementation slice into a full presence/status system. The core #698 slice should remain server-side autonomous scheduling: wake up, evaluate whether the character is currently allowed to message, avoid duplicates with any client-side path, and persist the generated message. User presence/status should be treated as a design constraint or follow-up slice unless the scheduler needs a minimal presence signal to make the first version safe. User idea to consider for this feature: when the server-side autonomous scheduler wakes up and decides whether to generate a message, pass both the user's current presence/status and the character's current schedule/status into that decision. Suggested user presence behavior: - Active/open UI: green. - UI open but inactive for a configured amount of time: yellow/away. - UI closed/disconnected: gray/offline. The character should still follow its own schedule. If the character is offline, it should not send messages. If the character is in a busy/do-not-disturb state such as red, it also should not send messages. Yellow is less clear and may need product decision, but the general idea is that the character is still "doing its own things" according to its schedule. This means messages are more likely when the user's real-life availability overlaps with the character's green/available schedule period. For example, if the user is away/offline and the character enters a green period, the scheduler could trigger a possible message such as the character reporting on its day, checking in, or saying something at night. Before actually sending, there should be a logic check: - Is the character currently allowed to message based on its schedule/status? - What is the user's current presence/status? - Is autonomous messaging allowed for this user/character/chat state? - Has the character already sent too many consecutive messages while the user is away/offline? When the user is gray/offline, autonomous messaging should be restrained. A character should only be allowed to send a maximum of 1-2 consecutive messages while the user remains offline, so background scheduling can still make characters feel alive without creating a long unattended reply chain.
Author
Owner

@Decidetto commented on GitHub (May 14, 2026):

The order of the logic check and generating the message should be flipped. There is no sense in spending tokens/API credits generating a message that we end up throwing away.

<!-- gh-comment-id:4449587469 --> @Decidetto commented on GitHub (May 14, 2026): The order of the logic check and generating the message should be flipped. There is no sense in spending tokens/API credits generating a message that we end up throwing away.
Author
Owner

@SpicyMarinara commented on GitHub (May 17, 2026):

On it.

<!-- gh-comment-id:4470015596 --> @SpicyMarinara commented on GitHub (May 17, 2026): On it.
Author
Owner

@SpicyMarinara commented on GitHub (May 17, 2026):

Implemented on staging in 2056b63e. The first server-side slice now runs an autonomous conversation scheduler when the browser poller is absent, reuses the existing eligibility/generation path, caps server/offline follow-ups to two, marks generated messages unread, and records recent client autonomous-poller presence so client and server generation do not duplicate each other. Full validation passed with pnpm check.

<!-- gh-comment-id:4470371037 --> @SpicyMarinara commented on GitHub (May 17, 2026): Implemented on staging in 2056b63e. The first server-side slice now runs an autonomous conversation scheduler when the browser poller is absent, reuses the existing eligibility/generation path, caps server/offline follow-ups to two, marks generated messages unread, and records recent client autonomous-poller presence so client and server generation do not duplicate each other. Full validation passed with pnpm check.
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#333
No description provided.