[GH-ISSUE #6692] [Feature]: Reviewed server fixes, part 2: agents, memory scans, providers, media and storage services #3748

Closed
opened 2026-10-21 06:06:47 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @SirAdoni on GitHub (Sep 26, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6692

Originally assigned to: @SpicyMarinara on GitHub.

Part of the contribution roadmap in #6624 (package E).

What problem does this solve?

The same server read-through found bugs in services and storage, the layer below the routes:

  • Deleted built-in regex scripts come back on the next start.
  • Failed or cut-off uploads leave partial files behind, and gallery videos stay behind when their character or persona is deleted.
  • Bulk lorebook export drops books that share a name, and a failed entry move can lose the copies.
  • Built-in agents that were skipped on purpose can run on the default connection anyway.
  • Memory recall pruning is quadratic, so it slows down on long chats, and prompt assembly drops image-only history turns.
  • RunPod and ComfyUI jobs keep running after Stop, and a video fallback holds a queue slot while it waits.
  • A primary connection that already streamed text can still fall back and produce a second reply.
  • Smaller items: Anthropic top_k with thinking, Grok CLI output splitting multibyte characters, Discord webhook 429s, Spotify playlists without a track count, the Gemini Omni size cap, a non-atomic Codex auth.json write, and concurrent first writes in app settings and personal extensions.

Proposed solution

Targeted fixes inside the existing services, keeping their APIs and conventions. Each fix has its own regression (server-hunt-b<N>).

  • How it's switched: no switch. These are bug fixes; every request that worked before gets the same answer. The one stored flag (regexDefaultsSeeded) counts existing installs as already seeded, so nothing is re-added or removed for them.
  • Areas touched (for spotting overlap):
    • packages/server/src/routes: admin, agents, characters, generate, knowledge sources, lorebooks, sidecar
    • packages/server/src/services/generation and services/conversation: agent resolution, selfie, schedule and side-effect commands, awareness, intent, autonomous scheduler
    • packages/server/src/services/llm/providers: connection fallback, OpenAI, Anthropic, Grok subscription, ChatGPT auth
    • packages/server/src/services/lorebook and services/prompt: keyword scanner, regex timeout, memory recall, assembler, marker expander, format engine
    • packages/server/src/services/storage: app settings, connections, lorebooks, prompts, themes
    • Image, video, RunPod ComfyUI, importers, personal extensions, capability package manager, tool executor, Discord webhook, embeddings
    • packages/shared/src/utils/xml-wrapper.ts, db/seed-regex.ts, CHANGELOG.md
  • Size: about 83 files, about 4,700 added lines, of which 30 files are regressions.
  • Status: implemented and tested in a fork, on Windows and on Linux (WSL, the CI-equivalent run).

Alternatives considered

  • Folding these into package D: together they would pass the 150-file review limit, so routes and middleware (D) and services and storage (E) are split. A few fixes span both; their route side is in D and their service side here.
  • One memory import fix was left out because advanced-memory.ts has changed on staging since.

Additional context

  • Implementation depends on #6647 (foundations); PRs will follow once it merges, one package at a time.
  • If you're working in any of these areas, please comment so we can coordinate before a PR.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @SirAdoni on GitHub (Sep 26, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6692 Originally assigned to: @SpicyMarinara on GitHub. <!-- roadmap issue E, draft v1.0 --> Part of the contribution roadmap in #6624 (package E). ## What problem does this solve? The same server read-through found bugs in services and storage, the layer below the routes: - Deleted built-in regex scripts come back on the next start. - Failed or cut-off uploads leave partial files behind, and gallery videos stay behind when their character or persona is deleted. - Bulk lorebook export drops books that share a name, and a failed entry move can lose the copies. - Built-in agents that were skipped on purpose can run on the default connection anyway. - Memory recall pruning is quadratic, so it slows down on long chats, and prompt assembly drops image-only history turns. - RunPod and ComfyUI jobs keep running after Stop, and a video fallback holds a queue slot while it waits. - A primary connection that already streamed text can still fall back and produce a second reply. - Smaller items: Anthropic `top_k` with thinking, Grok CLI output splitting multibyte characters, Discord webhook 429s, Spotify playlists without a track count, the Gemini Omni size cap, a non-atomic Codex `auth.json` write, and concurrent first writes in app settings and personal extensions. ## Proposed solution Targeted fixes inside the existing services, keeping their APIs and conventions. Each fix has its own regression (`server-hunt-b<N>`). - **How it's switched:** no switch. These are bug fixes; every request that worked before gets the same answer. The one stored flag (`regexDefaultsSeeded`) counts existing installs as already seeded, so nothing is re-added or removed for them. - **Areas touched (for spotting overlap):** - `packages/server/src/routes`: admin, agents, characters, generate, knowledge sources, lorebooks, sidecar - `packages/server/src/services/generation` and `services/conversation`: agent resolution, selfie, schedule and side-effect commands, awareness, intent, autonomous scheduler - `packages/server/src/services/llm/providers`: connection fallback, OpenAI, Anthropic, Grok subscription, ChatGPT auth - `packages/server/src/services/lorebook` and `services/prompt`: keyword scanner, regex timeout, memory recall, assembler, marker expander, format engine - `packages/server/src/services/storage`: app settings, connections, lorebooks, prompts, themes - Image, video, RunPod ComfyUI, importers, personal extensions, capability package manager, tool executor, Discord webhook, embeddings - `packages/shared/src/utils/xml-wrapper.ts`, `db/seed-regex.ts`, `CHANGELOG.md` - **Size:** about 83 files, about 4,700 added lines, of which 30 files are regressions. - **Status:** implemented and tested in a fork, on Windows and on Linux (WSL, the CI-equivalent run). ## Alternatives considered - **Folding these into package D:** together they would pass the 150-file review limit, so routes and middleware (D) and services and storage (E) are split. A few fixes span both; their route side is in D and their service side here. - One memory import fix was left out because `advanced-memory.ts` has changed on `staging` since. ## Additional context - Implementation depends on #6647 (foundations); PRs will follow once it merges, one package at a time. - If you're working in any of these areas, please comment so we can coordinate before a PR. ## Template check - [ ] I DID NOT read this template and provide the requested details.
Author
Owner

@SpicyMarinara commented on GitHub (Sep 26, 2026):

Awaiting PR.

<!-- gh-comment-id:5848651194 --> @SpicyMarinara commented on GitHub (Sep 26, 2026): Awaiting PR.
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#3748
No description provided.