mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8704] [MERGED] fix(logging): debug prompts print with real line breaks #8758
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#8758
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/8704
Author: @SpicyMarinara
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/debug-console-line-breaks📝 Commits (2)
35d67c7fix(logging): debug mode prompts print with real line breaks in the consolee3b252afix(logging): image payloads, decision request bodies and the Termux .env keep line breaks📊 Changes
42 files changed (+409 additions, -154 deletions)
View changed files
📝
.env.example(+3 -0)📝
docker-compose.yml(+1 -0)📝
docs/CONFIGURATION.md(+10 -1)📝
docs/development/logging.md(+3 -1)📝
e2e/decision-peek-report.e2e.ts(+3 -1)📝
packages/client/src/components/chat/DecisionDebugPanel.tsx(+2 -2)📝
packages/server/src/app.ts(+2 -2)📝
packages/server/src/config/env-watcher.ts(+2 -0)📝
packages/server/src/config/runtime-config.ts(+6 -0)📝
packages/server/src/lib/logger.ts(+33 -8)📝
packages/server/src/routes/encounter.routes.ts(+3 -3)📝
packages/server/src/routes/gallery.routes.ts(+2 -2)📝
packages/server/src/routes/game.routes.ts(+19 -27)📝
packages/server/src/routes/generate/raw-route.ts(+2 -6)📝
packages/server/src/routes/scene.routes.ts(+2 -2)📝
packages/server/src/routes/sidecar.routes.ts(+3 -3)📝
packages/server/src/services/advanced-memory.ts(+3 -3)📝
packages/server/src/services/avatars/generation/mesh-rig.ts(+2 -2)📝
packages/server/src/services/decision/sidecar-decision.backend.ts(+2 -2)📝
packages/server/src/services/decision/system-one.client.ts(+3 -3)...and 22 more files
📄 Description
Linked issue
Closes #8691
Why this change
With debug mode on, prompts and replies print in the server console without line breaks. There were two causes:
NODE_ENV=production.lib/logger.tschose readable pino-pretty output only outside production, so the console a person reads printed raw JSON lines, and every line break showed as a literal\n.%j: Claude, Gemini, OpenAI-compatible, Game tool planning.JSON.stringify(...): raw generate, Professor Mari, scene planning, image captioning, advanced memory, decisions, combat, storyboards, video and image payloads.The in-app Peek Prompt already kept line breaks. The Decision debug panel's request bodies did not.
What changed
lib/logger.ts: the log format follows where the output goes.pnpm dev, start.sh, start.bat and the Windows launcher window.docker logsstay one JSON object per line, as before.LOG_FORMAT=pretty|jsonoverrides it. It's a restart-required key.tee, so it exportsLOG_FORMAT=${LOG_FORMAT:-pretty}and reads it from.env.debugJson(value, replacer?), used with%sin place of%jandJSON.stringifyin every structured debug dump.[debug/image/*] final request payload, 13 call sites) and the Game asset request dump use it too.DecisionDebugPanel's prepared request bodies now show their line breaks.docs/CONFIGURATION.md: a "Log format" subsection, andLOG_FORMATin the restart list.docs/development/logging.md: the format choice anddebugJson..env.exampleand thedocker-compose.ymlcomment.Behaviour change worth noting: a production server whose output is a terminal now prints readable lines instead of JSON. Anyone who scraped JSON from a launcher terminal needs
LOG_FORMAT=json. Piped, file and Docker output is unchanged.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
What the agent ran locally, rebased on staging:
node ./scripts/pnpm-runner.mjs checkexits 0.debug-log-line-breaks. Real Claude and OpenAI generations, and an image generation, run with debug mode on, both in production mode to a pipe and in a terminal. It checks that the prompts print with real line breaks. It fails on unmodified staging.%jargument now compare the rendered text: provider-compat, anthropic-safe-retry, card-field-generation. The PTY shutdown fixture pinsLOG_FORMAT=jsonfor its production pass.For a human to verify:
./start.sh, turn on Settings → Advanced → Debug mode, and send a Roleplay message with a multi-line system prompt. Manually verify the terminal shows coloured, readable lines with the prompt's line breaks, not JSON with\n.start-termux.sh. Manually verify "Open Console" shows readable lines, and that~/.marinara-engine/logs/server-*.loghas no colour codes.docker logsstill shows one JSON object per line by default, and readable lines withLOG_FORMAT=pretty.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)The English
docs/CONFIGURATION.mdanddocs/development/logging.mdare updated. The translations follow in #8701.UI evidence (if applicable)
No visual change except the Decision debug panel's request bodies, which now wrap at their line breaks.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.