mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6600] [MERGED] feat(decision): priority and every-N-turns timing on decision statements #7247
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#7247
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/6600
Author: @kolacheee
Created: 9/24/2026
Status: ✅ Merged
Merged: 9/24/2026
Merged by: @kolacheee
Base:
staging← Head:feat/decision-priority-timing📝 Commits (2)
6f21af0feat(decision): priority and every-N-turns timing on decision statements6423787fix(decision): count every: from the last check with the current number📊 Changes
12 files changed (+449 additions, -50 deletions)
View changed files
📝
CHANGELOG.md(+2 -0)📝
docs/connections/decision-models.md(+1 -1)📝
docs/prompts/conditional-prompts.md(+35 -1)📝
docs/prompts/macros.md(+1 -1)📝
packages/server/src/routes/chats.routes.ts(+2 -2)📝
packages/server/src/routes/generate.routes.ts(+4 -2)📝
packages/server/src/routes/generate/dry-run-route.ts(+2 -2)📝
packages/server/src/services/decision/decision-timers.ts(+54 -6)📝
packages/server/src/services/decision/prompt-decisions.ts(+64 -24)📝
packages/shared/src/utils/macro-engine.ts(+29 -10)➕
scripts/regressions/decision-priority-timing.regression.ts(+254 -0)📝
scripts/regressions/decision-reachable-statements.regression.ts(+1 -1)📄 Description
Linked issue
Closes #6599
Why this change
What changed
priority:highandpriority:low, written after a statement likesticky:andcooldown:(#6582). When a turn has more statements than its limit, high ones are asked first and low ones dropped first; a statement with no priority is medium. Within a priority, source order still decides. A statement written in several places uses the highest priority given anywhere.every:Nasks a statement only every N turns. It is asked the first turn it is reached, then N turns later; between checks it reads as no, is not asked, and takes no slot. Turns count the same way as sticky and cooldown, so a regeneration reads the same answer. The next check is kept per chat beside the sticky and cooldown timers, only after a real answer, so a timed-out question is asked again next turn. A statement written in several places uses the smallestevery:.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Run by the agent:
pnpm check,pnpm localization:checkandpnpm regression:node(367 of 367, on staging9a737a137).scripts/regressions/decision-priority-timing.regression.ts:priority:high,every:3andsticky:2together;priority:mediumstored as the default; an unknown priority andevery:0ignored.every:.every:3; a check that comes due is dropped;every:1keeps nothing; the planner passes each statement'severy:to the timers, and a statement between checks takes no slot.every:2statement is between checks, so it reads as no and the low one gets its slot; a regeneration asks nothing; turn 3 the timed statement is due again.priority:lowmerged into medium.Please verify manually:
priority:high, no priority andpriority:low, set Decision statements per turn to 1, send{{prompt}}, and confirm Peek Prompt lists the medium and low ones as dropped.every:2, send a few messages with a Decision model set, and confirm it is asked every other turn (debug log:[decision] Prompt statement).Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Changed user docs for the batched
[docs-i18n]follow-up (#6532, updated to list them):docs/prompts/conditional-prompts.md(two new sections and one sentence),docs/prompts/macros.md(one sentence),docs/connections/decision-models.md(one sentence).UI evidence (if applicable)
No UI changes.
Summary by CodeRabbit
every:Nto ask a statement at set intervals. Between checks, it reads as “no” and doesn’t use a statement slot.priority:highorpriority:lowto control which statements are asked first when the per-turn limit is exceeded. Unspecified priority is treated as medium, and lower-priority statements are dropped first.every:interval and highest priority apply.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.