mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #5134] [MERGED] fix(mari): reference the preset variables Mari creates so they take effect #6644
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#6644
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/5134
Author: @kolacheee
Created: 8/16/2026
Status: ✅ Merged
Merged: 8/16/2026
Merged by: @kolacheee
Base:
staging← Head:fix/5080-mari-preset-variable-guidance📝 Commits (1)
0e8d825fix(mari): reference the preset variables Mari creates so they take effect (#5080)📊 Changes
4 files changed (+63 additions, -4 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
package.json(+1 -1)📝
packages/server/src/services/professor-mari/workspace-agent.service.ts(+3 -3)➕
scripts/regressions/professor-mari-preset-variables.regression.ts(+58 -0)📄 Description
Linked issue
Closes #5080
Why this change
Professor Mari can create preset variables (choice blocks), but the prompt she builds never uses them, so they have no effect. A preset variable only reaches the model where a prompt section's content references it with the
{{variableName}}macro (resolved inpackages/server/src/services/prompt/assembler.ts). Mari's workspace guidance told her to createdata.choiceBlocksbut never that the variable is inert until a section references it — and her own worked example demonstrated the anti-pattern: atonechoice block next to a section whose content was a bare"You are {{char}}.", so{{tone}}never appeared. Users then saw a picker in the preset UI that changed nothing, which reads as broken.What changed
Guidance-only (prompt + worked example) in
packages/server/src/services/professor-mari/workspace-agent.service.ts:preset.createguidance now states that a choice block does nothing on its own — its picked value only reaches the model where a section'scontentreferences it with{{variableName}}— and that Mari must add that reference when she defines a variable. When she adds a variable to an existing preset withaddChoiceBlock, she must alsoupdateSectionto weave{{variableName}}into a section."You are {{char}}. Speak in a {{tone}} tone.".No engine or schema change (the alternative of auto-inserting the macro engine-side was rejected in the issue — where a variable belongs is a semantic authoring decision).
Added a regression (
professor-mari-preset-variables, wired intoregression:issues) that parses eachpreset.createworked example and asserts everychoiceBlockvariable is referenced as{{variableName}}in a section, plus that the guidance names the macro and the inert-until-referenced rule. It fails on the old anti-pattern and passes on the fix (verified by temporarily reverting the example).workspaceCommandProtocolPromptis exported solely so the regression can read the prompt — test affordance only, no behavior change.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Automated (run locally against this branch, all green):
pnpm checkpnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/professor-mari-preset-variables.regression.ts(new; also inregression:issues)"You are {{char}}."makes the regression fail withpreset.create example defines choice block 'tone' but no section references {{tone}}; restoring the fix passes.professor-mari-prompt-context,professor-mari-documentation,mari-preset-granular,mari-workspace-context.Still worth a manual check (a human should verify): ask Professor Mari to "create a preset with a tone variable" and confirm the section she writes actually contains
{{tone}}, then pick a value in the preset UI and confirm the assembled prompt changes.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)CHANGELOG.mdgets aFixedentry. No user-facing docs underdocs/changed —docs/prompts/preset-variables.mdalready teaches the correct{{tone}}-in-a-section pattern, so there is nothing to mirror ondocs-i18n. No version bump.Summary by CodeRabbit
New Features
{{variableName}}macros.Bug Fixes
Documentation
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.