[PR #2654] [MERGED] feat(conversation): add schedule shenanigans #5710

Closed
opened 2026-10-22 04:18:44 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2654
Author: @Gunterlie
Created: 6/20/2026
Status: ✅ Merged
Merged: 6/21/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feature-schedule-shenanigans


📝 Commits (10+)

  • 0684254 feat(conversation): add schedule shenanigans
  • 026f8b1 fix(conversation): avoid duplicate scheduler delay
  • 668fbb7 Add conversation status slash command
  • a3bf3b5 fix(conversation): preserve metadata and claims
  • 9c76414 feat(conversation): improve autonomous messaging
  • 0b33a0b fix(conversation): tighten schedule and emoji handling
  • 24ca12e fix(conversation): address CodeRabbit review findings
  • fb60c4f fix(scheduler): non-blocking busy delay — poll loop no longer stalls
  • 0ab148f fix(conversation): scope character presence status to chat, not character record
  • e8f77ea Filter messages hidden from AI when supported

📊 Changes

28 files changed (+2517 additions, -368 deletions)

View changed files

📝 .gitignore (+3 -0)
📝 packages/client/src/components/chat/ChatArea.tsx (+21 -3)
📝 packages/client/src/components/chat/ChatCommonOverlays.tsx (+4 -0)
📝 packages/client/src/components/chat/ChatConversationSurface.tsx (+3 -0)
📝 packages/client/src/components/chat/ChatRoleplaySurface.tsx (+3 -0)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+176 -75)
📝 packages/client/src/components/chat/ConversationInput.tsx (+159 -13)
➕ packages/client/src/components/chat/ConversationPresenceCard.tsx (+939 -0)
📝 packages/client/src/components/chat/ConversationView.tsx (+22 -156)
📝 packages/client/src/components/layout/ChatSidebar.tsx (+18 -1)
📝 packages/client/src/features/chat-settings/ChatSettingsSection.tsx (+15 -3)
📝 packages/client/src/hooks/use-autonomous-messaging.ts (+37 -4)
📝 packages/client/src/hooks/use-background-autonomous.ts (+5 -0)
📝 packages/client/src/hooks/use-generate.ts (+19 -3)
📝 packages/client/src/lib/slash-commands.ts (+133 -1)
📝 packages/client/src/stores/chat.store.ts (+16 -6)
📝 packages/server/src/routes/chats.routes.ts (+14 -6)
📝 packages/server/src/routes/conversation.routes.ts (+190 -22)
📝 packages/server/src/routes/generate.routes.ts (+170 -48)
📝 packages/server/src/services/conversation/autonomous.service.ts (+92 -7)

...and 8 more files

📄 Description

Linked Issue

No linked issue yet.

Why This Change

  • Autonomous messages already used schedule availability, but they did not carry a deterministic reason for why a character was reaching out, so follow-ups often felt generic.
  • Busy-delay handling was split between the scheduler and /generate, which made delay behavior hard to reason about and caused a confirmed double-delay bug for DND/idle scheduler sends.
  • Autonomous follow-ups had no centralized cap, so a chatty character could over-message during long available windows.
  • The chat surface did not expose enough schedule/presence state to explain why a character was available, delayed, or quiet.

What Was Added

  • Intent resolution for autonomous messages so the server can produce stable prompt hints such as check_in, came_back_online, after_busy, good_morning, meal_break, and long_absence_check_in.
  • Central autonomous budgeting in /generate plus a chat-level override for the daily autonomous cap.
  • Server scheduler delay handling that waits busy-delay windows once and injects generation with skipPresenceDelay: true.
  • ConversationPresenceCard in the chat header so schedule-driven status, overrides, recent contact, and generated schedule preview are visible from the main conversation surface.
  • Reply now bypass behavior that aborts a pending delayed wait and restarts targeted generation without duplicating delay handling.
  • Schedule-generation UX that refetches chat data immediately and surfaces provider/network failures instead of failing silently.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Notes

  • Full pnpm check passed after the autonomous cap override wiring.
  • No browser click-through or mutating override curl test has been performed in this session.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added a conversation presence card to view and manage per-character presence (online/idle/dnd/offline).
    • Added a conversation-mode /status command to set or clear per-character presence.
    • Added “open to Autonomous Messaging” when launching chat settings.
  • Improvements

    • Improved slash-command autocomplete with richer, cursor-aware suggestions (including /status).
    • Updated schedule generation and regenerate behavior with clearer success/error feedback and smoother schedule controls.
    • Conversation presence indicators now reflect aggregated per-character status, including manual overrides.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/2654 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 6/20/2026 **Status:** ✅ Merged **Merged:** 6/21/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feature-schedule-shenanigans` --- ### 📝 Commits (10+) - [`0684254`](https://github.com/Pasta-Devs/Marinara-Engine/commit/068425478eedf4b42e0b36dd45a0e2b9dd591828) feat(conversation): add schedule shenanigans - [`026f8b1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/026f8b1a4d16c565df63d41a04659c216208eecb) fix(conversation): avoid duplicate scheduler delay - [`668fbb7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/668fbb7c6aeac9cc654340456f9e1afdfe4ea6f1) Add conversation status slash command - [`a3bf3b5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a3bf3b5f9dcbe0416ad9accec73641601aef77be) fix(conversation): preserve metadata and claims - [`9c76414`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9c7641435b631dd4c98b49b968809a4517e54a78) feat(conversation): improve autonomous messaging - [`0b33a0b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0b33a0bd1c068b8af079877791817e4b5671b08a) fix(conversation): tighten schedule and emoji handling - [`24ca12e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/24ca12ed73a8dcd57321dc6e53650d9f0b65d18a) fix(conversation): address CodeRabbit review findings - [`fb60c4f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/fb60c4fbab5ad80b986a131b67bb35ad959709cd) fix(scheduler): non-blocking busy delay — poll loop no longer stalls - [`0ab148f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0ab148f4ac57312f54a4b20caef90c16642edee8) fix(conversation): scope character presence status to chat, not character record - [`e8f77ea`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e8f77ea4a3a5966dad9c8da1601bc48c43214d8c) Filter messages hidden from AI when supported ### 📊 Changes **28 files changed** (+2517 additions, -368 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+3 -0) 📝 `packages/client/src/components/chat/ChatArea.tsx` (+21 -3) 📝 `packages/client/src/components/chat/ChatCommonOverlays.tsx` (+4 -0) 📝 `packages/client/src/components/chat/ChatConversationSurface.tsx` (+3 -0) 📝 `packages/client/src/components/chat/ChatRoleplaySurface.tsx` (+3 -0) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+176 -75) 📝 `packages/client/src/components/chat/ConversationInput.tsx` (+159 -13) ➕ `packages/client/src/components/chat/ConversationPresenceCard.tsx` (+939 -0) 📝 `packages/client/src/components/chat/ConversationView.tsx` (+22 -156) 📝 `packages/client/src/components/layout/ChatSidebar.tsx` (+18 -1) 📝 `packages/client/src/features/chat-settings/ChatSettingsSection.tsx` (+15 -3) 📝 `packages/client/src/hooks/use-autonomous-messaging.ts` (+37 -4) 📝 `packages/client/src/hooks/use-background-autonomous.ts` (+5 -0) 📝 `packages/client/src/hooks/use-generate.ts` (+19 -3) 📝 `packages/client/src/lib/slash-commands.ts` (+133 -1) 📝 `packages/client/src/stores/chat.store.ts` (+16 -6) 📝 `packages/server/src/routes/chats.routes.ts` (+14 -6) 📝 `packages/server/src/routes/conversation.routes.ts` (+190 -22) 📝 `packages/server/src/routes/generate.routes.ts` (+170 -48) 📝 `packages/server/src/services/conversation/autonomous.service.ts` (+92 -7) _...and 8 more files_ </details> ### 📄 Description ## Linked Issue No linked issue yet. ## Why This Change - Autonomous messages already used schedule availability, but they did not carry a deterministic reason for why a character was reaching out, so follow-ups often felt generic. - Busy-delay handling was split between the scheduler and `/generate`, which made delay behavior hard to reason about and caused a confirmed double-delay bug for DND/idle scheduler sends. - Autonomous follow-ups had no centralized cap, so a chatty character could over-message during long available windows. - The chat surface did not expose enough schedule/presence state to explain why a character was available, delayed, or quiet. ## What Was Added - Intent resolution for autonomous messages so the server can produce stable prompt hints such as `check_in`, `came_back_online`, `after_busy`, `good_morning`, `meal_break`, and `long_absence_check_in`. - Central autonomous budgeting in `/generate` plus a chat-level override for the daily autonomous cap. - Server scheduler delay handling that waits busy-delay windows once and injects generation with `skipPresenceDelay: true`. - `ConversationPresenceCard` in the chat header so schedule-driven status, overrides, recent contact, and generated schedule preview are visible from the main conversation surface. - `Reply now` bypass behavior that aborts a pending delayed wait and restarts targeted generation without duplicating delay handling. - Schedule-generation UX that refetches chat data immediately and surfaces provider/network failures instead of failing silently. ## Validation - [x] `pnpm check` passes locally - [x] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ## Notes - Full `pnpm check` passed after the autonomous cap override wiring. - No browser click-through or mutating override curl test has been performed in this session. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Added a conversation presence card to view and manage per-character presence (online/idle/dnd/offline). * Added a conversation-mode `/status` command to set or clear per-character presence. * Added “open to Autonomous Messaging” when launching chat settings. * **Improvements** * Improved slash-command autocomplete with richer, cursor-aware suggestions (including `/status`). * Updated schedule generation and regenerate behavior with clearer success/error feedback and smoother schedule controls. * Conversation presence indicators now reflect aggregated per-character status, including manual overrides. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:18:44 +07:00
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#5710
No description provided.