[PR #6482] [MERGED] fix: schedules, Advanced Memory responsiveness, and disabled controls #7195

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

📋 Pull Request Information

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

Base: staging ← Head: codex/sept21-assigned-sweep


📝 Commits (5)

  • 1fabb0a fix: reuse generic model discovery for image connections
  • 9dca06b fix: make schedule generation explicit, cancellable and repairable
  • 0d5d87f fix: clear cancelled day progress and localize shared routine guidance
  • 3751fe2 fix: keep Advanced Memory scene edits responsive
  • f27430b fix: keep advanced recall responsive and group scene context

📊 Changes

32 files changed (+1102 additions, -232 deletions)

View changed files

📝 CHANGELOG.md (+9 -0)
📝 docs/agents/memory.md (+9 -9)
📝 docs/conversation/schedules.md (+6 -4)
📝 e2e/advanced-memory.e2e.ts (+164 -1)
📝 e2e/schedule-generation.e2e.ts (+30 -4)
📝 packages/client/src/components/chat/AdvancedMemoryInspector.tsx (+3 -3)
📝 packages/client/src/components/chat/CharacterScheduleEditorModal.tsx (+78 -4)
📝 packages/client/src/components/chat/CharacterScheduleManagerModal.tsx (+66 -37)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+22 -19)
📝 packages/client/src/components/chat/ChatSetupWizard.tsx (+1 -1)
📝 packages/client/src/components/chat/ConversationPresenceCard.tsx (+44 -32)
📝 packages/client/src/components/panels/PresetsPanel.tsx (+2 -4)
📝 packages/client/src/hooks/use-advanced-memory.ts (+4 -9)
📝 packages/client/src/hooks/use-generate.ts (+4 -0)
📝 packages/client/src/localization/locales/en.json (+7 -2)
📝 packages/server/src/routes/advanced-memory.routes.ts (+3 -1)
📝 packages/server/src/routes/connections.routes.ts (+1 -1)
📝 packages/server/src/routes/conversation.routes.ts (+40 -9)
📝 packages/server/src/routes/generate.routes.ts (+2 -0)
📝 packages/server/src/routes/generate/dry-run-route.ts (+1 -0)

...and 12 more files

📄 Description

Linked issue

Closes #6481
Closes #6480
Closes #6477
Closes #6476
Closes #6463
Closes #6484

Follow-up to #6464. Translation PRs #6483 and #6486 are merged to docs-i18n, and #6467 is closed. They cover the schedule and Advanced Memory guides in all ten packs. #6453 remains excluded at the maintainer's request.

Why this change

Enabling schedules could start unwanted model calls, failed renewal could repeat after reopening a chat, and closing the editor did not cancel the provider request. Imperfect model output was discarded even when the user could repair it. Character-owned routines also failed to appear in existing chats.

Advanced Memory stalled long chats by repeatedly parsing the entire transcript for each archive record, returning unused excerpts, and queueing user edits behind background model work. Polling ready archives every five seconds also blocked unrelated character and preset requests while idle. Prompt preparation re-parsed the same metadata and repeatedly scanned long ongoing scenes while fitting the context budget.

What changed

  • Keep Advanced Memory edits responsive: parse source metadata once per snapshot, return only inspector summaries, avoid refetching unchanged chats/source messages, and cancel background preparation before applying a valid user edit. Original messages, paid summary checkpoints, and deleted-scene suppression are preserved.
  • Stop polling ready archives. Refresh after explicit actions and generation completion, relay available background progress through the existing stream, and poll only while a memory job is running.
  • Fit long scenes using a binary search for the same live message range. Keep source metadata parsed during generation and preview, and retain history IDs in previews without a preset.
  • Render all recalled scene summaries and their optional excerpts in one Recalled Scenes section. Preserve legacy markers as placement aliases and reuse old swipe snapshots without repeating retrieval.
  • Reject empty memory edits before cancelling paid work or changing stored revisions (GitHub CodeRabbit follow-up).
  • Reuse saved character routines across Conversation chats while respecting a chat's explicit off setting. Routines remain available when autonomous messaging is off.
  • Keep generation explicit. Weekly automatic renewal requires a per-character opt-in, does not create missing routines for other characters, and does not repeatedly retry a failed chat on remount.
  • Cancel editor, manager and chat-settings requests through to the provider. Add Stop controls and preserve completed days in the unsaved draft if a later day fails.
  • Keep invalid model JSON editable, validate repairs through the existing schedule importer, and leave the saved routine untouched until Save.
  • Dim only disabled Regex/Functions descriptions, preserving switch and action visibility.
  • Use /models for compatible image connections with custom base URLs. This reuses existing image-provider support; no MuAPI-specific provider is added.

Validation

Advanced Memory: eight Node regression suites pass, including a synthetic 1,000-message archive and edits during a held background model call. Local API measurements were about 25–125 ms for toggle/delete; inspector responses fell from over 5 MB of mostly unused excerpts to about 57 KB. Invalid and empty edits leave paid work running. The generation path went from 722,002 metadata parses to 2,000. Fitting a long ongoing scene dropped from 16.4 seconds to about 0.3 seconds after removing repeated scans; Peek Prompt took about 0.4 seconds. A concurrent status request, character list and preset group change finished in 18 ms. These are local fixture measurements, not physical-phone latency. The fix reuses existing archives; no reset or regeneration is needed.

Real HTTP OpenAI Responses fixtures using gpt-6-astra verify text renders before provider completion in desktop Chromium, mobile Chromium and iPhone-sized WebKit. Browser checks also verify no status polling while idle, progress polling during a held post-generation scene check, and no polling after completion. All 15 Advanced Memory browser cases pass across those three projects, including memory edits, deletion errors, resume and idle/background transitions. Prompt regressions cover a single section in XML/Markdown/None, marker precedence and old swipe reuse without additional preparation.

Completed locally: pnpm check; pnpm regression:prompt; five schedule regression files; three Conversation regression files; compatible image model discovery regression; nine schedule browser cases across desktop Chromium, mobile Chromium and mobile WebKit. Provider fixtures verify disconnection on cancellation and saved-data preservation.

Separate visual checks exercised both disabled controls in desktop Chromium and iPhone-sized WebKit, dark and light themes. Full ARM64 container build and a readiness-synchronized runtime probe passed API/frontend, native binding and persistent-volume checks.

Local CodeRabbit review completed for the full sweep and the idle-polling fix. The final review covered all 16 follow-up files with zero findings; one interrupted review-service connection was retried successfully. Its earlier schedule suggestion to tie routine availability back to autonomous messaging was declined: that would undo the intentional separation of character routines from proactive messaging. A later suggestion to change minimum excerpt reserves describes pre-existing near-cap behavior; this performance patch intentionally preserves the same budget policy, with a regression proving the largest fitting live range is unchanged.

Temporary before/after screenshots and schedule proof. The before images reproduce the previous row-wide opacity class; after images show the patched UI. All data is synthetic.

Disabled controls before Disabled controls after
Previous opacity Patched opacity

Merged to staging as daa5a3f6 at the maintainer’s explicit request to land before the final GitHub CodeRabbit review and address any new findings in a separate PR. All required CI checks passed before merge, as did the complete Node regression suite and every native/container platform check. The broader browser matrix and final GitHub CodeRabbit review were still running without reported failures. The final local CodeRabbit review passed with zero findings. The staging tree matches the locally tested feature-branch tree.

Human checklist (left unchecked):

  • 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)
  • Read and followed CONTRIBUTING.md

Manual verification notes

Manually verify cancellation and editable malformed output with the reporter's live KoboldCpp model, plus the controls on a physical phone. Local model requests used fixtures and phone checks used browser emulation.

Docs and release impact

Includes user-facing Unreleased entries and the corrected English schedule guide. #6483, already merged to docs-i18n, mirrors the schedule guide and preceding Advanced Memory fixes across all ten documentation packs. #6486 is also merged and updates those ten packs for the combined recall section and removal of idle polling. The matching English guide and preset help text are in this PR.

Post-merge CI follow-up: the complete browser matrix found one outdated wizard fixture waiting for the removed idle poll, failing that same case in three browser projects. #6487 corrects the trigger to an explicit settings revisit and preserves all stale-response assertions. Its six wizard cases, pnpm check, required GitHub checks and CodeRabbit status pass; it is merged to staging as c3ec8764. No application behavior was changed by that follow-up.


🔄 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/6482 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 9/21/2026 **Status:** ✅ Merged **Merged:** 9/21/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `codex/sept21-assigned-sweep` --- ### 📝 Commits (5) - [`1fabb0a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1fabb0a38ba65c4c130a4998f83a4fec1e4f03ab) fix: reuse generic model discovery for image connections - [`9dca06b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9dca06b5588bad448f09c2d9c1b80d1b3b5fa540) fix: make schedule generation explicit, cancellable and repairable - [`0d5d87f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0d5d87f376d92d349411cd9f604e42f854a784b0) fix: clear cancelled day progress and localize shared routine guidance - [`3751fe2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3751fe23fb99daea6edc870e8727aaa737e326cb) fix: keep Advanced Memory scene edits responsive - [`f27430b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f27430b85ca2c18e6ef156349e683f4a9c9077bc) fix: keep advanced recall responsive and group scene context ### 📊 Changes **32 files changed** (+1102 additions, -232 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+9 -0) 📝 `docs/agents/memory.md` (+9 -9) 📝 `docs/conversation/schedules.md` (+6 -4) 📝 `e2e/advanced-memory.e2e.ts` (+164 -1) 📝 `e2e/schedule-generation.e2e.ts` (+30 -4) 📝 `packages/client/src/components/chat/AdvancedMemoryInspector.tsx` (+3 -3) 📝 `packages/client/src/components/chat/CharacterScheduleEditorModal.tsx` (+78 -4) 📝 `packages/client/src/components/chat/CharacterScheduleManagerModal.tsx` (+66 -37) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+22 -19) 📝 `packages/client/src/components/chat/ChatSetupWizard.tsx` (+1 -1) 📝 `packages/client/src/components/chat/ConversationPresenceCard.tsx` (+44 -32) 📝 `packages/client/src/components/panels/PresetsPanel.tsx` (+2 -4) 📝 `packages/client/src/hooks/use-advanced-memory.ts` (+4 -9) 📝 `packages/client/src/hooks/use-generate.ts` (+4 -0) 📝 `packages/client/src/localization/locales/en.json` (+7 -2) 📝 `packages/server/src/routes/advanced-memory.routes.ts` (+3 -1) 📝 `packages/server/src/routes/connections.routes.ts` (+1 -1) 📝 `packages/server/src/routes/conversation.routes.ts` (+40 -9) 📝 `packages/server/src/routes/generate.routes.ts` (+2 -0) 📝 `packages/server/src/routes/generate/dry-run-route.ts` (+1 -0) _...and 12 more files_ </details> ### 📄 Description ## Linked issue Closes #6481 Closes #6480 Closes #6477 Closes #6476 Closes #6463 Closes #6484 Follow-up to #6464. Translation PRs #6483 and #6486 are merged to `docs-i18n`, and #6467 is closed. They cover the schedule and Advanced Memory guides in all ten packs. #6453 remains excluded at the maintainer's request. ## Why this change Enabling schedules could start unwanted model calls, failed renewal could repeat after reopening a chat, and closing the editor did not cancel the provider request. Imperfect model output was discarded even when the user could repair it. Character-owned routines also failed to appear in existing chats. Advanced Memory stalled long chats by repeatedly parsing the entire transcript for each archive record, returning unused excerpts, and queueing user edits behind background model work. Polling ready archives every five seconds also blocked unrelated character and preset requests while idle. Prompt preparation re-parsed the same metadata and repeatedly scanned long ongoing scenes while fitting the context budget. ## What changed - Keep Advanced Memory edits responsive: parse source metadata once per snapshot, return only inspector summaries, avoid refetching unchanged chats/source messages, and cancel background preparation before applying a valid user edit. Original messages, paid summary checkpoints, and deleted-scene suppression are preserved. - Stop polling ready archives. Refresh after explicit actions and generation completion, relay available background progress through the existing stream, and poll only while a memory job is running. - Fit long scenes using a binary search for the same live message range. Keep source metadata parsed during generation and preview, and retain history IDs in previews without a preset. - Render all recalled scene summaries and their optional excerpts in one Recalled Scenes section. Preserve legacy markers as placement aliases and reuse old swipe snapshots without repeating retrieval. - Reject empty memory edits before cancelling paid work or changing stored revisions (GitHub CodeRabbit follow-up). - Reuse saved character routines across Conversation chats while respecting a chat's explicit off setting. Routines remain available when autonomous messaging is off. - Keep generation explicit. Weekly automatic renewal requires a per-character opt-in, does not create missing routines for other characters, and does not repeatedly retry a failed chat on remount. - Cancel editor, manager and chat-settings requests through to the provider. Add Stop controls and preserve completed days in the unsaved draft if a later day fails. - Keep invalid model JSON editable, validate repairs through the existing schedule importer, and leave the saved routine untouched until Save. - Dim only disabled Regex/Functions descriptions, preserving switch and action visibility. - Use `/models` for compatible image connections with custom base URLs. This reuses existing image-provider support; no MuAPI-specific provider is added. ## Validation Advanced Memory: eight Node regression suites pass, including a synthetic 1,000-message archive and edits during a held background model call. Local API measurements were about 25–125 ms for toggle/delete; inspector responses fell from over 5 MB of mostly unused excerpts to about 57 KB. Invalid and empty edits leave paid work running. The generation path went from 722,002 metadata parses to 2,000. Fitting a long ongoing scene dropped from 16.4 seconds to about 0.3 seconds after removing repeated scans; Peek Prompt took about 0.4 seconds. A concurrent status request, character list and preset group change finished in 18 ms. These are local fixture measurements, not physical-phone latency. The fix reuses existing archives; no reset or regeneration is needed. Real HTTP OpenAI Responses fixtures using `gpt-6-astra` verify text renders before provider completion in desktop Chromium, mobile Chromium and iPhone-sized WebKit. Browser checks also verify no status polling while idle, progress polling during a held post-generation scene check, and no polling after completion. All 15 Advanced Memory browser cases pass across those three projects, including memory edits, deletion errors, resume and idle/background transitions. Prompt regressions cover a single section in XML/Markdown/None, marker precedence and old swipe reuse without additional preparation. Completed locally: `pnpm check`; `pnpm regression:prompt`; five schedule regression files; three Conversation regression files; compatible image model discovery regression; nine schedule browser cases across desktop Chromium, mobile Chromium and mobile WebKit. Provider fixtures verify disconnection on cancellation and saved-data preservation. Separate visual checks exercised both disabled controls in desktop Chromium and iPhone-sized WebKit, dark and light themes. Full ARM64 container build and a readiness-synchronized runtime probe passed API/frontend, native binding and persistent-volume checks. Local CodeRabbit review completed for the full sweep and the idle-polling fix. The final review covered all 16 follow-up files with zero findings; one interrupted review-service connection was retried successfully. Its earlier schedule suggestion to tie routine availability back to autonomous messaging was declined: that would undo the intentional separation of character routines from proactive messaging. A later suggestion to change minimum excerpt reserves describes pre-existing near-cap behavior; this performance patch intentionally preserves the same budget policy, with a regression proving the largest fitting live range is unchanged. [Temporary before/after screenshots and schedule proof](https://gist.github.com/SpicyMarinara/edd4fd12f0c4cb61cd9a63f538c25b5d). The before images reproduce the previous row-wide opacity class; after images show the patched UI. All data is synthetic. | Disabled controls before | Disabled controls after | | --- | --- | | ![Previous opacity](https://gist.githubusercontent.com/SpicyMarinara/edd4fd12f0c4cb61cd9a63f538c25b5d/raw/iphone-light-before-reproduced.png) | ![Patched opacity](https://gist.githubusercontent.com/SpicyMarinara/edd4fd12f0c4cb61cd9a63f538c25b5d/raw/iphone-light-after.png) | Merged to `staging` as `daa5a3f6` at the maintainer’s explicit request to land before the final GitHub CodeRabbit review and address any new findings in a separate PR. All required CI checks passed before merge, as did the complete Node regression suite and every native/container platform check. The broader browser matrix and final GitHub CodeRabbit review were still running without reported failures. The final local CodeRabbit review passed with zero findings. The staging tree matches the locally tested feature-branch tree. Human checklist (left unchecked): - [ ] `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) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes Manually verify cancellation and editable malformed output with the reporter's live KoboldCpp model, plus the controls on a physical phone. Local model requests used fixtures and phone checks used browser emulation. ## Docs and release impact Includes user-facing Unreleased entries and the corrected English schedule guide. #6483, already merged to `docs-i18n`, mirrors the schedule guide and preceding Advanced Memory fixes across all ten documentation packs. #6486 is also merged and updates those ten packs for the combined recall section and removal of idle polling. The matching English guide and preset help text are in this PR. Post-merge CI follow-up: the complete browser matrix found one outdated wizard fixture waiting for the removed idle poll, failing that same case in three browser projects. #6487 corrects the trigger to an explicit settings revisit and preserves all stale-response assertions. Its six wizard cases, `pnpm check`, required GitHub checks and CodeRabbit status pass; it is merged to staging as `c3ec8764`. No application behavior was changed by that follow-up. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:17:24 +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#7195
No description provided.