mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #4520] [Issue]: Local-sidecar generation paths bypass connection admission #2462
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#2462
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?
Originally created by @Gunterlie on GitHub (Aug 3, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4520
Originally assigned to: @Gunterlie on GitHub.
Summary
PR #4514 added connection admission (foreground work always proceeds; background work yields to it and waits out an idle window) and wired the Noodle schedulers as the first background producers. Every path that resolves a remote connection is admitted, because it either passes
connectionIdtocreateLLMProvideror goes throughwithConnectionFallbackProvider. The local-sidecar branches are not: they hand out the rawgetLocalSidecarProvider()singleton with no wrapper.The result is that all local-sidecar work is invisible to admission — it neither registers as foreground activity nor yields as background.
Impact
Today this is latent, since only the Noodle schedulers produce background mode and they run on regular connections. It becomes a real defect as soon as any background caller targets the sidecar, or when sidecar foreground work should be blocking background work:
lastForegroundFinishedAt, so the 30s post-generation idle window never applies to it.Verified call sites (as of
1b6ddb3)Unadmitted local-sidecar providers:
packages/server/src/services/capability-packages/capability-language-model.service.ts:61— capability LLM hostpackages/server/src/services/professor-mari/workspace-agent.service.ts:832— Professor Mari workspace agentpackages/server/src/services/memory-recall-embedding.ts:122— memory recall embeddingspackages/server/src/routes/lorebooks.routes.ts:1179— lorebook vectorizationpackages/server/src/services/generation/agent-resolution.ts:315— cached sidecar agent providerpackages/server/src/routes/generate/sidecar.routes.ts:202— direct sidecar embed endpointpackages/server/src/routes/generate/raw-route.ts:415— raw-route embedAlready admitted, listed so they are not touched:
provider-generation-runtime.ts:203,retry-agents-route.ts:1408andraw-route.ts:236(viawithConnectionFallbackProvider),chat-summary/connection-resolution.ts:100,illustrator-prompt-runtime.ts:74,image-captioning-runtime.ts:157, anddry-run-route.ts(fixed in #4514).Suggested fix
Fix it once at the source rather than at seven call sites: add an admission-aware accessor next to
getLocalSidecarProvider()— e.g.getAdmittedLocalSidecarProvider(mode?)returningwithConnectionAdmissionProvider(getLocalSidecarProvider(), LOCAL_SIDECAR_CONNECTION_ID, mode)— and route the direct consumers through it. The wrapper is idempotent in practice only if applied once, so the already-admitted sites above must keep using the raw singleton as their primary.Worth deciding as part of this: whether embedding calls (memory recall, lorebook vectorization, the two embed endpoints) should hold a foreground slot at all, or whether admission should cover only generation. They run on the same sidecar process, which argues for including them.
Acceptance
LOCAL_SIDECAR_CONNECTION_ID.Context