[PR #7231] [MERGED] fix(commands): apply [schedule_update] to the character's status #7637

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7231
Author: @SpicyMarinara
Created: 10/7/2026
Status: ✅ Merged
Merged: 10/7/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/schedule-update-command-7230


📝 Commits (6)

  • ead189f fix(commands): apply [schedule_update] to the character's status
  • 136a15e Merge origin/staging into fix/schedule-update-command-7230
  • 4a0c858 Merge origin/staging into fix/schedule-update-command-7230
  • 74acc8b fix(presence): stop showing a character's timed status after it ends
  • 52268dc fix(commands): read schedule_update durations by whole units
  • 9d978d7 Merge origin/staging into fix/schedule-update-command-7230

📊 Changes

9 files changed (+371 additions, -33 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 docs/conversation/calls.md (+1 -1)
📝 docs/conversation/schedules.md (+9 -0)
📝 packages/client/src/components/chat/ConversationPresenceCard.tsx (+8 -2)
📝 packages/client/src/hooks/use-generate.ts (+3 -0)
📝 packages/server/src/routes/generate.routes.ts (+1 -0)
📝 packages/server/src/services/conversation/character-commands.ts (+9 -5)
📝 packages/server/src/services/generation/conversation-schedule-command-runtime.ts (+109 -25)
➕ scripts/regressions/conversation-schedule-update-command.regression.ts (+230 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #7230

Why this change

  • With Schedule Updates on, a character's [schedule_update: status="dnd", activity="Busy", duration="1h"] was hidden from the reply but changed nothing. Its status, activity, and schedule stayed the same, and no error appeared. This has been happening since at least 2.4.6.
  • A parser and a handler did exist. The handler (conversation-schedule-command-runtime.ts) edited the chat's metadata.characterSchedules, but that map is only a cache now: the character card owns the schedule. On the next presence read, resolveConversationSchedules (chats.storage.ts:1691) saw the cache differed from the card and replaced it, so the edit vanished. Characters without a schedule were skipped without any message, and the client ignored the schedule_updated event.

What changed

  • Outside shared rooms, the command now sets a temporary conversationStatusOverride on the issuing character's card. The presence menu and /status already write this record, and every presence surface reads it (presence pill, chat list, prompts, autonomous pacing). It expires after the requested duration, which defaults to one hour and can't go past seven days. It never edits the saved weekly routine, and it also works for characters without a schedule.
  • A status the user set by hand (no end time) stays in charge, so the character can't replace it. An activity-only command keeps the current status.
  • parseDuration now reads decimal hours (1.5h used to become 5 hours) and bare numbers as hours, because the prompt asks for "number of hours". Units must be whole words, so 2 months is no longer read as 2 minutes and 1.5m no longer as 5 minutes.
  • The presence menu ignores an override once it has expired. It used to read the chat's cached override as-is, so after a timed status ended it kept the Override badge and the old activity. The server, chat list and prompts already skipped expired overrides.
  • Invalid commands are still stripped. They now log a warning, and an unreadable duration falls back to one hour. Conversation commands have no notice for invalid commands (only Roleplay has roleplay_command_error), so I didn't add one.
  • After saving, the server refreshes the chat's presence cache, and the client refetches the chat and /conversation/status on schedule_updated.
  • Shared multiplayer rooms keep their room-local schedule-block edit, which already persisted, unchanged. The existing room-policy regression still covers it.
  • New regression: scripts/regressions/conversation-schedule-update-command.regression.ts. It fails on staging ("the command changes the character's live status and activity": still online/free time).
  • Docs: docs/conversation/schedules.md (new "Characters can change their own status" section) and docs/conversation/calls.md. CHANGELOG entry added.

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

Agent-run checks, not a substitute for the boxes above: pnpm check exited 0. These regressions passed: conversation-schedule-update-command, multiplayer-generation-policy, character-schedule-ownership, character-schedule-transfer, command-only-regenerate, autonomous-scheduler-gate, autonomous-check-storage, schedule-generation, slash-command-usage, roleplay-commands, haptic, open-issues, and issue-sweep-5391-5394. pnpm localization:check exited 0. The new regression fails on staging without the fix.

Manual verification notes

  • Manually verify: in a Conversation chat with Chat Settings → Agents → Commands and Schedule Updates on, ask a scheduled character to "set your status to dnd for 1 hour". The command should disappear from the reply, and the presence pill should switch to Busy with the character's activity without a page reload.
  • Manually verify: open the presence menu. The character shows the override, and Clear manual override returns it to its schedule.
  • Manually verify the same request with a character that has no schedule (schedules off). The status should still change.
  • Manually verify that the character's weekly schedule in the schedule editor is unchanged after the command.
  • Manually verify that after setting a status yourself with /status offline <name>, asking the character to go online leaves your offline status in place.
  • Manually verify that a garbled command such as [schedule_update: status="sleeping"] (for example, by editing a prompt to provoke it) is stripped with no visible error and a [commands] warning in the server log.
  • Manually verify that the status returns to the schedule after the duration ends. A short duration="1m" request makes this quick. Within about a minute of the end, the presence menu should show Following schedule with no Override badge, and the scheduled activity instead of the command's.
  • Manually verify that swiping to a reply without the command leaves the status in place until it expires. Like the other command side effects (memories, notes, influence), a swipe does not undo it; Clear manual override in the presence menu removes it.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

Changed English guides: docs/conversation/schedules.md, docs/conversation/calls.md. A [docs-i18n] follow-up issue is linked in a comment below.

UI evidence (if applicable)

No new UI. The existing presence pill and menu now reflect the command.

Summary by CodeRabbit

  • New Features
    • Characters can temporarily change their status and activity using Schedule Updates, even without a saved schedule. When the duration ends, they return to their schedule or Online.
    • Durations can be specified in hours or minutes, up to seven days; omitted or unreadable durations default to one hour.
    • These temporary updates do not change saved schedules or override a status set through /status or the presence menu.

🔄 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/7231 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/7/2026 **Status:** ✅ Merged **Merged:** 10/7/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/schedule-update-command-7230` --- ### 📝 Commits (6) - [`ead189f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ead189f6b978056bc8c45e999c4ce9260cf48777) fix(commands): apply [schedule_update] to the character's status - [`136a15e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/136a15e777189ba1f1d1c84871d9dfef7c96b7ee) Merge origin/staging into fix/schedule-update-command-7230 - [`4a0c858`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4a0c8589783f75099adfabdf0e084c18f2909b73) Merge origin/staging into fix/schedule-update-command-7230 - [`74acc8b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/74acc8bc4f021121869783e009ceb281f06bf4cb) fix(presence): stop showing a character's timed status after it ends - [`52268dc`](https://github.com/Pasta-Devs/Marinara-Engine/commit/52268dcbe7878e49e484b1785e72869b5edf5927) fix(commands): read schedule_update durations by whole units - [`9d978d7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9d978d789492db7704d29ee8671c751c9b3bd9be) Merge origin/staging into fix/schedule-update-command-7230 ### 📊 Changes **9 files changed** (+371 additions, -33 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `docs/conversation/calls.md` (+1 -1) 📝 `docs/conversation/schedules.md` (+9 -0) 📝 `packages/client/src/components/chat/ConversationPresenceCard.tsx` (+8 -2) 📝 `packages/client/src/hooks/use-generate.ts` (+3 -0) 📝 `packages/server/src/routes/generate.routes.ts` (+1 -0) 📝 `packages/server/src/services/conversation/character-commands.ts` (+9 -5) 📝 `packages/server/src/services/generation/conversation-schedule-command-runtime.ts` (+109 -25) ➕ `scripts/regressions/conversation-schedule-update-command.regression.ts` (+230 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Closes #7230 ## Why this change - With **Schedule Updates** on, a character's `[schedule_update: status="dnd", activity="Busy", duration="1h"]` was hidden from the reply but changed nothing. Its status, activity, and schedule stayed the same, and no error appeared. This has been happening since at least 2.4.6. - A parser and a handler did exist. The handler (`conversation-schedule-command-runtime.ts`) edited the chat's `metadata.characterSchedules`, but that map is only a cache now: the character card owns the schedule. On the next presence read, `resolveConversationSchedules` (`chats.storage.ts:1691`) saw the cache differed from the card and replaced it, so the edit vanished. Characters without a schedule were skipped without any message, and the client ignored the `schedule_updated` event. ## What changed - Outside shared rooms, the command now sets a temporary `conversationStatusOverride` on the issuing character's card. The presence menu and `/status` already write this record, and every presence surface reads it (presence pill, chat list, prompts, autonomous pacing). It expires after the requested duration, which defaults to one hour and can't go past seven days. It never edits the saved weekly routine, and it also works for characters without a schedule. - A status the user set by hand (no end time) stays in charge, so the character can't replace it. An activity-only command keeps the current status. - `parseDuration` now reads decimal hours (`1.5h` used to become 5 hours) and bare numbers as hours, because the prompt asks for "number of hours". Units must be whole words, so `2 months` is no longer read as 2 minutes and `1.5m` no longer as 5 minutes. - The presence menu ignores an override once it has expired. It used to read the chat's cached override as-is, so after a timed status ended it kept the **Override** badge and the old activity. The server, chat list and prompts already skipped expired overrides. - Invalid commands are still stripped. They now log a warning, and an unreadable duration falls back to one hour. Conversation commands have no notice for invalid commands (only Roleplay has `roleplay_command_error`), so I didn't add one. - After saving, the server refreshes the chat's presence cache, and the client refetches the chat and `/conversation/status` on `schedule_updated`. - Shared multiplayer rooms keep their room-local schedule-block edit, which already persisted, unchanged. The existing room-policy regression still covers it. - New regression: `scripts/regressions/conversation-schedule-update-command.regression.ts`. It fails on staging ("the command changes the character's live status and activity": still `online`/`free time`). - Docs: `docs/conversation/schedules.md` (new "Characters can change their own status" section) and `docs/conversation/calls.md`. CHANGELOG entry added. ## 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` Agent-run checks, not a substitute for the boxes above: `pnpm check` exited 0. These regressions passed: `conversation-schedule-update-command`, `multiplayer-generation-policy`, `character-schedule-ownership`, `character-schedule-transfer`, `command-only-regenerate`, `autonomous-scheduler-gate`, `autonomous-check-storage`, `schedule-generation`, `slash-command-usage`, `roleplay-commands`, `haptic`, `open-issues`, and `issue-sweep-5391-5394`. `pnpm localization:check` exited 0. The new regression fails on staging without the fix. ### Manual verification notes - Manually verify: in a Conversation chat with **Chat Settings → Agents → Commands** and **Schedule Updates** on, ask a scheduled character to "set your status to dnd for 1 hour". The command should disappear from the reply, and the presence pill should switch to Busy with the character's activity without a page reload. - Manually verify: open the presence menu. The character shows the override, and **Clear manual override** returns it to its schedule. - Manually verify the same request with a character that has no schedule (schedules off). The status should still change. - Manually verify that the character's weekly schedule in the schedule editor is unchanged after the command. - Manually verify that after setting a status yourself with `/status offline <name>`, asking the character to go online leaves your offline status in place. - Manually verify that a garbled command such as `[schedule_update: status="sleeping"]` (for example, by editing a prompt to provoke it) is stripped with no visible error and a `[commands]` warning in the server log. - Manually verify that the status returns to the schedule after the duration ends. A short `duration="1m"` request makes this quick. Within about a minute of the end, the presence menu should show **Following schedule** with no **Override** badge, and the scheduled activity instead of the command's. - Manually verify that swiping to a reply without the command leaves the status in place until it expires. Like the other command side effects (memories, notes, influence), a swipe does not undo it; **Clear manual override** in the presence menu removes it. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) Changed English guides: `docs/conversation/schedules.md`, `docs/conversation/calls.md`. A `[docs-i18n]` follow-up issue is linked in a comment below. ## UI evidence (if applicable) No new UI. The existing presence pill and menu now reflect the command. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Characters can temporarily change their status and activity using **Schedule Updates**, even without a saved schedule. When the duration ends, they return to their schedule or **Online**. * Durations can be specified in hours or minutes, up to seven days; omitted or unreadable durations default to one hour. * These temporary updates do not change saved schedules or override a status set through `/status` or the presence menu. <!-- 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-24 04:06:04 +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#7637
No description provided.