mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[PR #1093] [MERGED] fix(slurp2): stop the world tick freezing the Engine every 5 minutes (0.2.41) #1292
Labels
No labels
agent: chess
agent: conversation-calls
agent: eightball
agent: haptic
agent: hierarchical-maps
agent: hierarchical-maps
agent: illustrator
agent: poker
agent: rock-paper-scissors
agent: tic-tac-toe
agent: uno
artifacts
bug
bugfix
build
catalog
ci
client
dependencies
docs
documentation
enhancement
feature
fixed-in-staging
in-pr
normal-scope
packages
pull-request
qol
regression
roadmap
scope-risk
server
soup
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Agents#1292
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-Agents/pull/1093
Author: @Gunterlie
Created: 9/26/2026
Status: ✅ Merged
Merged: 9/26/2026
Merged by: @Gunterlie
Base:
staging← Head:hotfix/slurp2-settings-cache📝 Commits (3)
df1d891fix(slurp2): cache normalized settings so the world tick stops freezing the Engine8bd0335fix(slurp2): yield to the event loop between world tick stepsc391998docs(slurp2): describe the 0.2.41 tick fix without an unmeasured guarantee📊 Changes
15 files changed (+482 additions, -391 deletions)
View changed files
➕
artifacts/slurp2-0.2.41.zip(+0 -0)📝
catalog/catalog.json(+8 -8)📝
catalog/notes.json(+6 -6)📝
catalog/v2/catalog.json(+8 -8)📝
catalog/v2/notes.json(+6 -6)📝
catalog/v3/catalog.json(+8 -8)📝
catalog/v3/notes.json(+6 -6)📝
packages/slurp2/CHANGELOG.md(+4 -0)📝
packages/slurp2/client.js(+51 -51)📝
packages/slurp2/manifest.json(+5 -5)📝
packages/slurp2/server.mjs(+338 -291)📝
packages/slurp2/src/engine/packages/client/src/slp/features/onboarding/slp-release.ts(+8 -1)📝
packages/slurp2/src/engine/packages/server/src/slp/features/world/slp-world-operation.ts(+17 -0)📝
packages/slurp2/src/engine/packages/server/src/slp/modules/settings/slp-settings.ts(+16 -0)📝
scripts/build-feature-packages.mjs(+1 -1)📄 Description
Pull request
Linked issue
Closes #1094
Emergency hotfix for SonaGate's report.
Why this change
Every
tickMinutes(default 5), the[slurp-world]tick held the Engine's event loop for about 7 s. Every other package, API route and open tab froze until it finished. SonaGate's CPU profile of one freeze put 4.4 s of the 7 s inside Slurp'sgetSettings()→normalizeSlurpSettings, which ran the full zod validation of the settings object on every call. The tick calls it many times per pass. Most of the remaining 1.5 s was GC from those parses.What changed
modules/settings/slp-settings.ts):normalizeSlurpSettingskeeps the last stored raw string (ornullbefore the first save) and its parsed result. Callers get astructuredClone, so a caller that changes its copy cannot corrupt the cache. Object inputs (theupdateSettingspath) still parse every time. Any settings write stores a new string, so the next read misses the cache and parses again.features/world/slp-world-operation.ts): the tick's storage calls resolve without real I/O, so a large world ran as one block. Each per-creator, per-commission and per-action loop now awaitssetImmediatebefore its next step, so routes and other packages keep responding during a tick. The world-tick claim andtrySlpOperationlock still hold across the yields, so a catch-up that runs in parallel still getsbusy.client.js,server.mjs,manifest.json, artifact and catalogs are rebuilt.Package and security impact
slurp2Validation
node scripts/validate-catalog.mjspasses locallygit diff --checkpasses locallyCONTRIBUTING.mdManual verification notes
The agent ran these (built against Marinara-Engine
staging4629eb913, clean):node scripts/build-feature-packages.mjs slurp2,node scripts/typecheck-packages.mjs slurp2, the architecture regression,test-catalog-lanes,validate-package-locales,validate-catalog,catalog-release-notes,git diff --checkand Prettier on the changed sources: all pass.slp-settings.tschecked that the cached and uncached results are equal for string,nulland object input, that callers get a clone, that a changed clone does not leak into the cache, and that a new string misses the cache. Per call: 0.28 ms cached against 2.9 ms uncached.slp-settings.ts,slp-world-operation.tsor the storage were run against a cleanstagingworktree and this branch: the pass/fail result is the same for every file (46 pass, 24 fail on both, which is the known pre-existing red set).slurp-world,slurp-world-pulse,slurp2-free-clockandslurp2-simulation-fixespass.nullsettings row skipped the cache). It is fixed in this branch.Not verified: the package was not sideloaded into a running Engine, and the freeze was not measured again on a real world. A re-measurement with SonaGate's lag watchdog would confirm the fix.
Documentation impact
UI evidence (if applicable)
Not applicable (server only).
Summary by CodeRabbit
New Features
Improvements
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.