mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6625] [CLOSED] feat: engine foundations: request-traced logs, prompt caching fixes, opt-in robustness, feature switches, background jobs, Ctrl+K palette #7257
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#7257
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/6625
Author: @SirAdoni
Created: 9/24/2026
Status: ❌ Closed
Base:
staging← Head:contrib/engine-foundations📝 Commits (10+)
71afb1btest: isolate each regression file's storage and .env in the runnerf7863b3feat(server): request id trail, startup timeline and one line per failure in logsdd5d63cperf(server): stable lorebook group winners and compact stored lorebook scans (both opt-in)a5e9939fix(server): opt-in robustness settings for storage writes, Windows boot, shutdown and provider retry, plus runtime diagnostics46720c2fix(server): hold early internal inject() calls until startup registration ends417405bdocs: explain the developer foundations contributiond3f5d51feat(tools): add a Dev MCP for inspecting a local Marinara enginefa7be48feat: feature switches in Settings > Advanced > Features899a1bdfeat(server): keep media generations running when the tab closes (generationJobTracking, off)14a0acdfeat(client): generation jobs viewer and reattach for generationJobTracking📊 Changes
332 files changed (+31757 additions, -1557 deletions)
View changed files
📝
.dockerignore(+3 -0)📝
.env.example(+37 -0)📝
.gitattributes(+1 -0)📝
.gitignore(+2 -0)📝
CHANGELOG.md(+50 -0)📝
CONTRIBUTING.md(+12 -0)📝
docs/CONFIGURATION.md(+52 -0)➕
docs/configuration/features.md(+110 -0)➕
docs/contrib/ISSUE-dev-foundations.md(+38 -0)➕
docs/contrib/PR-dev-foundations.md(+54 -0)➕
docs/contrib/engine-foundations-overview.md(+558 -0)➕
docs/development/generation-jobs.md(+85 -0)➕
docs/development/logging.md(+109 -0)📝
docs/prompts/generation-parameters.md(+8 -0)📝
docs/settings/settings-overview.md(+2 -2)📝
packages/client/src/components/chat/ChatMessage.tsx(+10 -0)📝
packages/client/src/components/chat/ChatSettingsDrawer.tsx(+1 -0)📝
packages/client/src/components/chat/HomeNewChatLauncher.tsx(+17 -5)📝
packages/client/src/components/chat/PeekPromptModal.tsx(+3 -1)📝
packages/client/src/components/chat/chat-area.types.ts(+2 -0)...and 80 more files
📄 Description
Linked issue
Closes #6624
Why this change
The details are in the issue. In short:
"error".This PR builds on the existing logger, regression runner, storage design, shutdown, rate-limit handling and Settings layout. It doesn't rename or rewrite any of them. Every switch defaults off, so with an unchanged setup the app behaves as it does today; the few default-on changes are listed below.
What changed
38 commits on
staging5d9917fb0, grouped by area, oldest first. Each has its own regression filter, and the full per-commit list is indocs/contrib/engine-foundations-overview.md.Foundations
71afb1b04test: isolate each regression file's storage and.envin the runner.f7863b389feat(server): request id trail, startup timeline and one line per failure. Theloggerexport,LOG_LEVELandLOG_DISABLE_REQUEST_LOGGINGare unchanged. Addsdocs/development/logging.md, linked fromCONTRIBUTING.md.fa7be48bafeat: feature switches in Settings > Advanced > Features. One registry (isFeatureEnabled,useFeatureEnabled,GET/PUT /api/app-settings/features). Env variables still win. Switches:stableLorebookGroupPicks,providerRetry,cacheFriendlyPromptLayout,backgroundCallCap(+ calls per hour, 600),generationJobTracking,consoleTray. All off.Prompt caching
ec8519617fix(server): keep the Claude subscription history cache marker when the prompt ends with injections after the user's turn. It only acts on requests marked by the layout switch.b5c26d4fcchore(deps): Claude Agent SDK 0.3.280, so Opus 5.5 runs on the subscription provider. Only the Agent SDK is exempted from the 24 h minimum release age.94513896aperf(server): cache-friendly prompt layout for subscription providers, behindcacheFriendlyPromptLayout. Full lore goes first in one fixed<lore>block, and dynamic entries and per-turn blocks go next to the current turn. Off is byte-identical to today: I compared the exact request the Agent SDK receives before and after.c83d249acfeat(server): ChatGPT cache session (session-idheader andprompt_cache_key) for full-lore requests, under the same switch.dd5d63ca1perf(server): stable lorebook group winners, seeded per chat (stableLorebookGroupPicks), and compact stored lorebook scans (LOREBOOK_COMPACT_STORED_SCANS), with a one-time compaction script that backs up first and refuses to run while the engine is listening.c8e01df64feat: an optional per-chat warning before a send whose predicted cache share is under a threshold (default 80%). Off unless a chat turns it on.5d9d0d924feat: cache diagnostics (hashes and counts only), a next-turn Peek Prompt preview, and "N% cached" in the token usage label.Robustness and performance
a5e99399efix(server): opt-in settings for storage writes, Windows boot id caching, shutdown and provider retry (up to two retries for refused connections and 502/503 before any output), plus a read-only privilegedGET /api/admin/runtime-diagnostics.f96585b14feat(server): an hourly cap on background model calls (backgroundCallCap). Live turns are never counted.6f4e27ea7feat(server): runtime memory telemetry: heap, external memory, event-loop p99 and worker gauges, logged once per pressure episode.509b9170cfeat(server): optional prompt debug files underlogs/prompt-debug(LOG_PROMPT_DEBUG_FILES, off, because it writes prompt text to disk).Bug fixes (always on)
46720c28ffix(server): hold early internalinject()calls until startup registration ends. A package that calls an internal route duringactivate()orselfCheck()getsInjectDuringRegistrationErrorat once instead of hanging.463c2b4c3feat(server): check that the running build matches its sources. The build fails on a missing compiled module, startup warnsME_BUILD_STALE, and the updater no longer reports a false success. It costs about 60 ms at startup for 613 modules.706040216fix(server): retry once without "reasoning off" when a model always reasons. Only requests that fail today are affected.a04f4c465,cbed620fa,fb60c163e,84f0ce289: reviewed server fixes in three groups, plus logged best-effort helpers for deliberately swallowed failures. Each batch has its ownserver-hunt-b<N>regression (56/56 pass). Highlights: SSRF reserved-address checks, IP allowlist CIDR and IPv6, a crash flushes pending writes, per-route rate limits, importers, storage recovery and writer lease, sidecar downloads, and deleted built-in regex scripts staying deleted.0c6eee459fix(shared): mark the new chat metadata prefixes as engine-owned, so GM verbs can't write them.Background generation jobs (off by default)
899a1bd21feat(server): eight media generations run as server-side jobs that survive a closed tab: gallery image, selfie video, scene video, scene background, avatar and sheet drafts, sprite sheet and animated expressions. A restart marks unfinished jobs interrupted and never re-runs them. Records hold ids, codes and timings only, never prompts or keys, and are kept 7 days (at most 300).14a0acd45feat(client): a jobs viewer and a "finished while you were away" toast.2d8242f2cfeat(client): "Open generation jobs" in the palette while the switch is on.generationJobTrackingoff, routes run inline exactly as today and the job routes answer 404.Command palette
43295d937feat(client): Ctrl+K (Cmd+K on Mac), or a top-bar button on touch screens. It searches chats, characters, personas, lorebooks, presets, the Settings tabs and common actions (new chat of each mode, open any panel, theme, and more). Recent items come first, and search is typo- and accent-tolerant. It never opens over another dialog. The regression pins an exact allowlist of actions.62fd8ccf6feat(client): a "?" overlay listing the shortcuts that really exist, each one checked against its source by the regression.b896b6993fix(client): focus returns to whatever opened the palette when it closes.58c63cbe9fix(client): "Open generation jobs" is a 36px touch target on phones.Tools and launchers
299a7cc97feat(server): minimize the Windows console to the system tray (consoleTray, off;MARINARA_CONSOLE_TRAY). It does nothing on other platforms.ede18b58ffix(launcher): back up untracked source files before the launchers'git clean -fd -- packages/*/src.b9c0ad448fix(launcher): open the browser once/api/healthanswers, instead of after a fixed 4 s.d3f5d5171feat(tools): a Dev MCP intools/dev-mcp, outside the pnpm workspace and the Docker image. Drop this one commit to leave it out; nothing depends on it.Docs and style
417405b4e,8b6e80325,a447d3397: docs.f6973d728andea6dcc3c8: formatting only (the last one follows staging's move to Prettier 3.9).Default-on changes, listed for review:
reqIdis nowrequestId, and request lines drop query strings.Client aborted requestline at info.windowsHideon the Windows probes.Validation
pnpm checkpasses locallyCONTRIBUTING.mdTicked by me after checking the results below.
pnpm checkis left unticked for the two pre-existing failures noted. Everything below ran on the final tipea6dcc3c8unless noted.tsc --noEmit(shared, server, client)pnpm checkimpeccable:check(the local.agents/skills/impeccableskill isn't installed) andcredits:check(contributor list stale). Both fail identically on plainstaging.staging5d9917fb0on the same setup: 369 / 369; the 86 added regression files all pass)staging: 364 / 369). The 5 that fail here (decision-sidecar-runtime,gallery-previews,request-timeouts,server-signal-shutdown,storage-writer-lock) fail identically on plainstagingon the same machine and all pass on Linux./api/health200, the app page loads,/api/app-settings/featuresreports every switch off, and there are no error-level log lines.server-hunt-b3.slow-regression.tstakes about 50 s, over the runner's 30 s limit, so the runner doesn't pick it up. It passes when run directly.Manual verification notes
staging."error"activated normally, and the engine was ready in about 20 s.errorIdto its full request trail in the logs.staging.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)The PR adds:
[Unreleased]docs/development/logging.mdanddocs/development/generation-jobs.mddocs/configuration/features.md, plusdocs/CONFIGURATION.mdentries for every settingdocs/contrib/engine-foundations-overview.mdCONTRIBUTING.mdgains one link in its Logging section. A[docs-i18n]follow-up issue is needed for the translated guides.UI evidence (if applicable)
Screenshots from a test instance with invented data:
Settings > Advanced > Features
Ctrl+K palette with results
Palette on a phone (390x844)
"?" keyboard shortcuts overlay
Generation jobs viewer
Low-cache send warning
Open points
This is a stacked series. It can be split, but the logging commit, the runner isolation and the feature switch commit would need to land first, since the later commits use them.
Left out on purpose, as fork-only or dependent on excluded work:
Each can follow as its own PR if wanted.
After the server is listening, a package activated from the UI that adds a route the running server lacks now stays installed and activates on the next start, instead of rolling back. If you'd rather keep the old rollback there, the new handling can be limited to startup.
Regression isolation has no opt-out. I can add one if it's wanted.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.