mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #5702] [MERGED] fix(conversation): keep last week's schedule instead of clearing it #6892
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#6892
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5702
Author: @Gunterlie
Created: 8/31/2026
Status: ✅ Merged
Merged: 8/31/2026
Merged by: @Gunterlie
Base:
staging← Head:fix/schedule-persistence-5689📝 Commits (4)
9ce0b2dfix(conversation): keep last week's schedule instead of clearing ite46342dfix(conversation): regenerate a stale schedule instead of waiting for the refresh buttone0f97e8Merge branch 'staging' into fix/schedule-persistence-5689f70b466Merge branch 'staging' into fix/schedule-persistence-5689📊 Changes
4 files changed (+73 additions, -56 deletions)
View changed files
📝
packages/client/src/components/chat/ConversationPresenceCard.tsx(+33 -5)📝
packages/client/src/hooks/use-autonomous-messaging.ts(+0 -23)📝
packages/server/src/services/storage/chats.storage.ts(+19 -28)📝
scripts/regressions/character-schedule-ownership.regression.ts(+21 -0)📄 Description
Closes #5689
Why
Users report that after upgrading to 2.4.4 their chat schedules were empty, and that a schedule regenerated on a Sunday was empty again the next morning.
Root cause: the read path treated "generated before this week's Monday" as "does not exist".
collectFreshConversationSchedulesandcollectConversationPresenceskipped any card schedule wherescheduleNeedsRefresh()was true.resolveConversationSchedulesthen saw an empty result and actively wiped the chat'scharacterSchedulescache andscheduleWeekStart.GET /conversation/statuscomputesneedsRefreshfrom the schedules that survived that same filter, so once every schedule went stale,needsRefreshwasfalse— and the client's refresh button only regenerates whenneedsRefreshistrue.So a stale schedule was hidden, deleted from the cache, and then permanently unregenerable. The Sunday case is the sharpest version:
getMonday()maps Sunday to the previous Monday, so a schedule generated on a Sunday is stale the very next day.What
1. Stop discarding last week's schedule. The read path returns the card's schedule regardless of its
weekStart. Days are keyed by weekday name, so last week's routine is still usable, presence keeps working, andneedsRefreshcorrectly reportstrue— which is what drives regeneration.2. Roll the week over automatically. Fixing
needsRefreshrepairs the refresh button, but nothing was regenerating on its own:useAutonomousMessagingexported anensureScheduleshelper that no component ever called, so the button was the only path and a routine silently stayed a week behind.ConversationPresenceCardnow regenerates when the server reportsneedsRefresh, once per chat per session so a missing or failing connection cannot loop. The dead helper is removed.scheduleNeedsRefreshitself is unchanged and still gates regeneration inPOST /conversation/schedule/generate.Behaviour note for review
Item 2 means a stale chat now spends one LLM call on open, without the user pressing anything. That matches what
ensureScheduleswas written to do and what the issue expects ("schedules should remain populated"), but it is a real change in when generation happens — worth a maintainer opinion. Chats with schedules switched off never reportneedsRefresh, so they never generate.Test plan
pnpm checknode scripts/run-regressions.mjs(thecharacter-schedule-ownershipregression gains a case pinning that a last-week schedule still resolves; it fails onstaging)Summary by CodeRabbit
Bug Fixes
Tests
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.