mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6720] [MERGED] fix(decision): sidecar Thinking controls, warm-up and Open-Jev 2B statement budget #7298
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#7298
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/6720
Author: @kolacheee
Created: 9/26/2026
Status: ✅ Merged
Merged: 9/26/2026
Merged by: @kolacheee
Base:
staging← Head:fix/decision-sidecar-controls-warmup📝 Commits (5)
dec2165fix(decision): sidecar Thinking controls, warm-up and 2B statement budgetc23f036fix(decision): keep the reason when the sidecar dies during its warm-up9a6f076fix(decision): time limits per statement, never per groupa3d5a7dfix(decision): a stop cancels the sidecar warm-up requeste22a4cdfix(decision): cancel the sidecar warm-up when the process exits📊 Changes
15 files changed (+648 additions, -101 deletions)
View changed files
📝
CHANGELOG.md(+3 -0)📝
docs/connections/decision-models.md(+10 -5)📝
packages/client/src/components/connections/DecisionDefaultControl.tsx(+4 -1)📝
packages/client/src/localization/locales/en.json(+1 -1)📝
packages/server/src/routes/decision.routes.ts(+18 -12)📝
packages/server/src/services/decision/decision-default.ts(+59 -69)➕
packages/server/src/services/decision/decision-server-queue.ts(+61 -0)📝
packages/server/src/services/decision/decision-slots.ts(+10 -0)📝
packages/server/src/services/decision/sidecar-decision.backend.ts(+14 -3)📝
packages/server/src/services/sidecar/decision-process.service.ts(+55 -0)📝
packages/shared/src/types/decision-catalog.ts(+12 -4)📝
packages/shared/src/types/decision.ts(+5 -1)📝
scripts/regressions/decision-local-models.regression.ts(+27 -0)📝
scripts/regressions/decision-sidecar-runtime.regression.ts(+121 -5)➕
scripts/regressions/decision-time-limits.regression.ts(+248 -0)📄 Description
Linked issue
Closes #6716
Closes #6717
Closes #6718
Closes #6721
Why this change
What changed
DecisionDefaultControl.tsx): the Thinking block renders only for an entry the server sends athinkingvalue for, which is the server's existing signal that the slot has the setting. The Primary and Utility local models are unchanged. The shared type's comment now states that contract.decision-process.service.ts): after the sidecar prints its address and before the engine publishes it, the start sends one small question shaped like Test's. Callers already wait on the load, so the first gate and Test then see the normal speed. A failed warm-up is logged and does not fail the start. A stop during the warm-up cancels the warm-up request itself and then the start, like a stop during loading. If the process dies during the warm-up, which is where a CUDA failure on the first forward pass would show up, the exit reason is now kept for the panel. Before, the close handler passed it only through afinish()that ignores it once the address line has settled the start.decision-catalog.ts): Open-Jev 2B now carries a measuredperQuestionMsof 350, like 9B's 800. The request limit then grows per statement and per Choice option, capped at the existing 20 seconds. The field's comment no longer says the cost is negligible.decision-server-queue.ts(new) queues decision requests per model server, as many at a time as the server has slots, and hands a freed slot straight to the longest waiter. A request cancelled while waiting leaves the queue at once.serverSlots: the configured parallel jobs for the Primary and Utility models, and 1 for the sidecar, whose server answers one request at a time.decision-default.ts,perStatementLimitMsandanswersAskedForbuild every limit per statement, counting each Choice option and "none of these". A connection gets its Time limit for each. The sidecar gets 4 seconds for the first statement and its measured cost for each further one, or 4 seconds each when the cost is unmeasured. The 20-second group cap is gone.decision-sidecar-runtimepoints its fake sidecar at a small local server. It proves the warm-up is sent before the address is published, with the model's question shape, that a failed warm-up still publishes the address, that a stop during the warm-up cancels the start without reporting an error, and that a process killed during the warm-up fails the start with its exit reason recorded.decision-local-modelspins that the Thinking block needs athinkingvalue, and that a 32-statement turn at the measured cost fits the 2B budget.decision-time-limits(new) covers the per-answer arithmetic, the queue, and two stand-in servers that work one request at a time:docs/connections/decision-models.mdgains a short speed note in the install section and corrects the Thinking line. The Time limits section and the connection's Time limit paragraph now describe per-statement limits, and so does the Time limit field's help text. CHANGELOG entry under[Unreleased].Validation
pnpm checkpasses locallyCONTRIBUTING.mdThe boxes are left for a human to tick. What the agent ran is listed below.
pnpm check: exit 0 on the rebased branch, and again after the per-statement commit.pnpm checkanddecision-sidecar-runtimepassed again.node scripts/run-regressions.mjs: 401/401 passed on the first commit. After the review fix and the rebase onto staging14773492f, the five decision regressions and the two process-service regressions were run again, and all 7 passed:decision-sidecar-runtime,decision-local-models,decision-conditionals,lorebook-decision-activation,smart-group-decision,logging-failure-linesandrobustness-shutdown-safety.coderabbit review --committed --base-commit <merge-base>): the first commit reviewed 8 files with no findings.--agentmode lost its connection three times, so plain mode was used. The rerun on the rebased branch, which includes the review fix, also reviewed 8 files with no findings. With the per-statement commit, the whole branch (15 files) reviewed with no findings.perQuestionMscomment claimed every entry was measured on a full-length scene, but 9B's was measured on a short one. Reworded.Four were rejected with code-based reasons. The warm-up failure also writes the client's generic rate-limited "Activation request failed" line, which the Test routes already do. The docs' time-limit line not naming the existing 20 s cap and the Thinking line's wording both predate this PR. The changelog's "two seconds" matches what users see through Test, up to 2.3 s.
Manual verification notes
Measured on a scratch install of this branch (Linux, RTX 5090 Laptop, real Open-Jev 2B), never the live install:
POST /api/decision/thinking, which answered 409, and the dropdown went back to Auto under "Needs to think before answering".resolveDecisionBackend→askMixed), with five long messages trimmed to the model's limit:Needs manual verification:
Known limits:
Per-statement limits mean a slow or hung backend can now hold a reply up to its limit for each statement asked before the reply. The per-turn statement allowance bounds that, and cancelling the generation still stops it.
The queue only covers decision requests. Agents that use the same local model at the same time can still keep its slots busy.
Open-Jev 9B's 800 ms was measured on a short scene, so its budget may be tight on long chats. 9B was not available here to measure again.
A timed-out request is not cached, so later requests in the same turn ask the same statements again.
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)docs/connections/decision-models.mdchanged. The open batched docs-i18n issue #6667 already covers this guide, and a comment there lists what this PR changes.CHANGELOG.mdhas one entry.UI evidence (if applicable)
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.