mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #6018] [Bug]: {{model}} macro resolves to an empty string during real generation — prompt assembler never passes the model to the macro context #3332
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#3332
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 @oakosb on GitHub (Sep 10, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6018
Originally assigned to: @SpicyMarinara on GitHub.
Summary
The
{{model}}macro always resolves to an empty string during real generation, even when a model is selected on the connection. It only resolves in the dry-run/preview path.Expected behavior
Per docs/prompts/macros.md:
{{model}}resolves to "The current model name, when one is selected." With a model selected on the active connection, preset sections containing{{model}}should render that model name in the prompt that is actually sent.Actual behavior
The model receives literally e.g.
Assistant is , a large language model.— the macro slot is empty. Verified by asking the model to quote its own system prompt. The same prompt resolves correctly in the dry-run/preview path, which confirms the selection itself is fine.Root cause (code analysis on
main)BuildPromptMacroContextInputacceptsmodel?: stringandbuildPromptMacroContextcopies it into the macro context (packages/server/src/services/prompt/macro-context.ts, ~line 722:model: input.model).model: conn.model(packages/server/src/routes/generate/dry-run-route.ts, ~line 882). This is why preview works.packages/server/src/services/prompt/assembler.ts, ~line 365): itsbuildPromptMacroContext({ ... })call omitsmodel, andAssemblerInputhas nomodelfield at all, so the generation path cannot supply it.MacroContext.modelisundefinedat generation time →{{model}}resolves to"".Steps to reproduce
{{model}}(e.g.Assistant is {{model}}, a large language model.).Proposed fix
Add
model?: stringtoAssemblerInput, pass the resolved connection's model from the generate routes, and forward it in thebuildPromptMacroContextcall inassembler.ts. (Alternatively, resolve the connection model inside the assembler if it already has access to it.)Why it matters
{{model}}is the only mechanism a preset has to anchor the model's identity ("You are X, a large language model"). This matters especially for distilled/open models that tend to hallucinate a different vendor's identity and system-prompt guidelines; without the slug, the prompt can't contradict that. Currently the macro silently produces broken sentences instead.Environment
mainsource, commit1a29936)Template check
@SpicyMarinara commented on GitHub (Sep 10, 2026):
Owner: @SpicyMarinara (Codex). This issue is included in draft PR #6026, targeting staging, as part of the requested assigned-issue sweep. Implementation is starting; the draft will carry the regression and browser verification evidence.