[PR #333] [MERGED] feat(conversation): configurable day rollover hour and message tail #4565

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/333
Author: @JorgeLTE
Created: 4/30/2026
Status: ✅ Merged
Merged: 5/3/2026
Merged by: @SpicyMarinara

Base: main ← Head: feat/conversation-day-rollover-and-tail


📝 Commits (6)

  • 50897c6 feat(chat): configurable day rollover hour and verbatim message tail
  • c9d0fbf chore(server): drop dev-only rollover seed script from the PR
  • 467ef35 Merge branch 'main' into feat/conversation-day-rollover-and-tail
  • 8990efe fix(chat): align dayRolloverHour clamp with UI 0-11 range
  • e105738 Merge branch 'main' into feat/conversation-day-rollover-and-tail
  • 0bc34b3 Merge branch 'main' into feat/conversation-day-rollover-and-tail

📊 Changes

4 files changed (+210 additions, -26 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+96 -9)
📝 packages/server/src/routes/generate.routes.ts (+100 -17)
📝 packages/shared/src/types/chat.ts (+13 -0)

📄 Description

Linked issue

Closes #334

Why this change

  • Conversation auto-summarization currently splits a session at calendar midnight. A late-night chat that runs from 22:00 → 03:00 has its early hours filed under "yesterday" and its late hours under "today", and the next morning the model's prompt only contains the summary of that night, not the actual flow of dialogue. Characters reliably forget the concrete texture of what was just said.
  • Two small, complementary settings fix this without disabling summarization or rewriting the schedule logic.

What changed

  • dayRolloverHour (default 4): shifts the logical "day" boundary. Messages timestamped before this hour are filed under the previous logical day, so a single late-night session lives in one bucket instead of two. The same logicalNow value drives both day-bucketing and week-consolidation, so the two boundaries always agree — no clash between the day and week machinery.
  • summaryTailMessages (default 10): keeps the last N already-summarized messages verbatim in the prompt with a [DD.MM HH:MM] prefix, spliced in immediately before today's first verbatim turn. Bridges the day boundary so characters can pick up the actual flow of last night's conversation, not just the gist.
  • UI controls live in the existing Automatic Summarization section of Chat Settings. The rollover-hour dropdown is restricted to 12 AM–11 AM (morning-only) to avoid the counterintuitive "today extends 22 hours into tomorrow" reading of pre-midnight values.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
    • I'm having issues building docker before and after my changes on Windows.
  • 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

Docs and release impact

  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

CHANGELOG entry added under [1.5.6] Added. No version bump.

UI evidence (if applicable)

Chat settings:
image

Chat settings (warning active after changing the value with existing summaries)
image

Chat settings in mobile:
image

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Configurable "Day Rollover Hour" (default 4 AM) to control when a new day begins for conversation summarization.
    • Configurable "Recent Message Tail" (default 10, clamped 0–50) to keep the last N messages verbatim across summarization boundaries.
    • Summarization UI expanded into a control panel with a conditional warning when changing rollover if prior summaries exist.

🔄 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/333 **Author:** [@JorgeLTE](https://github.com/JorgeLTE) **Created:** 4/30/2026 **Status:** ✅ Merged **Merged:** 5/3/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `main` ← **Head:** `feat/conversation-day-rollover-and-tail` --- ### 📝 Commits (6) - [`50897c6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/50897c6729940ef3cc48753b5d7557ffca0b4a9f) feat(chat): configurable day rollover hour and verbatim message tail - [`c9d0fbf`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c9d0fbf4cc9a3504f05b63eaae1ed4b19119a513) chore(server): drop dev-only rollover seed script from the PR - [`467ef35`](https://github.com/Pasta-Devs/Marinara-Engine/commit/467ef35a88a56e2055945ef7f816fe3e4e3c931e) Merge branch 'main' into feat/conversation-day-rollover-and-tail - [`8990efe`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8990efe6c8fb4a73b7a3153b0b313adcebc1360e) fix(chat): align dayRolloverHour clamp with UI 0-11 range - [`e105738`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e1057383bfc7d101432cd598e8612aff5eaf50e3) Merge branch 'main' into feat/conversation-day-rollover-and-tail - [`0bc34b3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0bc34b3f1963250bc43f8e5c553cb7e73d5321ba) Merge branch 'main' into feat/conversation-day-rollover-and-tail ### 📊 Changes **4 files changed** (+210 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+96 -9) 📝 `packages/server/src/routes/generate.routes.ts` (+100 -17) 📝 `packages/shared/src/types/chat.ts` (+13 -0) </details> ### 📄 Description ## Linked issue <!-- No prior issue tracked for this; happy to open one retroactively if maintainers prefer. --> Closes #334 ## Why this change - Conversation auto-summarization currently splits a session at calendar midnight. A late-night chat that runs from 22:00 → 03:00 has its early hours filed under "yesterday" and its late hours under "today", and the next morning the model's prompt only contains the *summary* of that night, not the actual flow of dialogue. Characters reliably forget the concrete texture of what was just said. - Two small, complementary settings fix this without disabling summarization or rewriting the schedule logic. ## What changed - **`dayRolloverHour`** (default `4`): shifts the logical "day" boundary. Messages timestamped before this hour are filed under the previous logical day, so a single late-night session lives in one bucket instead of two. The same `logicalNow` value drives both day-bucketing and week-consolidation, so the two boundaries always agree — no clash between the day and week machinery. - **`summaryTailMessages`** (default `10`): keeps the last N already-summarized messages verbatim in the prompt with a `[DD.MM HH:MM]` prefix, spliced in immediately before today's first verbatim turn. Bridges the day boundary so characters can pick up the actual flow of last night's conversation, not just the gist. - UI controls live in the existing **Automatic Summarization** section of Chat Settings. The rollover-hour dropdown is restricted to `12 AM`–`11 AM` (morning-only) to avoid the counterintuitive "today extends 22 hours into tomorrow" reading of pre-midnight values. ## Validation - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - I'm having issues building docker before and after my changes on Windows. - [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) - [x] Read and followed `CONTRIBUTING.md` ## Docs and release impact - [x] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) CHANGELOG entry added under `[1.5.6]` Added. No version bump. ## UI evidence (if applicable) <!-- Screenshots can be added on review request. The new controls are two rows added inside the existing Automatic Summarization section: a "Day Rollover Hour" select and a "Recent Message Tail" number input, plus a conditional amber warning row that only appears after the user touches the rollover hour. --> Chat settings: <img width="503" height="917" alt="image" src="https://github.com/user-attachments/assets/cfd6a15c-cb77-410b-a20a-8d2b7362777e" /> Chat settings (warning active after changing the value with existing summaries) <img width="507" height="916" alt="image" src="https://github.com/user-attachments/assets/665adbb2-e9d1-4018-97e0-be4d28a57d42" /> Chat settings in mobile: <img width="425" height="851" alt="image" src="https://github.com/user-attachments/assets/763478b9-ab62-4973-ac9e-beb95bcd3c8e" /> 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Configurable "Day Rollover Hour" (default 4 AM) to control when a new day begins for conversation summarization. * Configurable "Recent Message Tail" (default 10, clamped 0–50) to keep the last N messages verbatim across summarization boundaries. * Summarization UI expanded into a control panel with a conditional warning when changing rollover if prior summaries exist. <!-- 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:08:46 +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#4565
No description provided.