[PR #6172] [MERGED] fix: preserve empty quotes and redact image debug logs #7078

Closed
opened 2026-10-23 04:16:20 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6172
Author: @SpicyMarinara
Created: 9/13/2026
Status: ✅ Merged
Merged: 9/13/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/image-debug-review-followup


📝 Commits (3)

  • cf15e67 fix: redact image debug payloads and clean up failed browser fixtures
  • 73be95d Merge remote-tracking branch 'origin/staging' into fix/image-debug-review-followup
  • 8bb1c27 fix: keep prose after empty Markdown quotes outside the quote

📊 Changes

7 files changed (+159 additions, -70 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 e2e/chat-sweep.e2e.ts (+14 -10)
📝 e2e/core-flows.e2e.ts (+33 -33)
📝 packages/client/src/lib/markdown.tsx (+1 -1)
📝 packages/server/src/services/image/image-generation.ts (+42 -22)
📝 scripts/regressions/assigned-issue-sweep.regression.ts (+10 -0)
📝 scripts/regressions/image-custom-parameters.regression.ts (+57 -4)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Refs #6167 and #6170. Addresses the remaining valid review findings from #6168 and #6171.

Why this change

Image debug mode could write embedded image data and custom credential fields into logs. In mixed HTML messages, a bare Markdown quote line could absorb the following ordinary text. Browser fixtures could also remain in the test database when setup or an earlier cleanup request failed.

What changed

  • Reuse the existing image MIME detector in one log-only payload formatter. Redact credentials, image data, and uploaded files, including nested serialized form/workflow values, while retaining prompts and token settings. Provider requests remain unchanged.
  • Allow an empty quote capture in the existing mixed-HTML formatter, keeping following prose and adjacent rules outside that quote.
  • Start fixture cleanup scopes before fallible setup and attempt chat/character cleanup independently.
  • Keep the existing per-entry lorebook race guard. Its timing results depend on the same override snapshot, so the proposed review change would install stale timing after a newer user toggle; the actual scan/toggle/persist regression passes.

No new dependency, migration, UI copy, or version change. Changelog updated.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Automated validation

  • Image logging regression fails before the fix and passes afterward. Captured logs exclude image bytes and credentials across eight JSON providers, serialized NanoGPT payloads, and multipart uploads. Actual HTTP request fields, authorization headers, and uploaded image bytes remain unchanged; prompts and token-limit/count diagnostics remain visible.
  • Server typecheck, E2E typecheck, formatting, and diff checks pass.
  • The existing assigned-issue regression fails before the empty-quote correction and passes afterward, covering following prose and adjacent empty quotes/rules.
  • The existing lorebook scan/toggle/persist regression passes and confirms why the requested guard removal is unsafe.
  • Full local pnpm check passes on final commit 8bb1c27442603f0fff2af54f47d72d8d6fef7010, including TypeScript, ESLint, localization validation, and the production build. Hosted CI passed: 268/268 Node regression files and 874 browser tests across all ten desktop Chromium, mobile Chromium, and mobile WebKit shards. Container, Windows, validation, and CodeQL checks passed. CodeRabbit completed; the one non-actionable cleanup suggestion was checked and explained in its resolved review thread.

Manual verification needed

  • Manually inspect an image-generation debug log and confirm prompts/settings remain useful while credentials and reference-image data are hidden.

Provider proof uses local HTTP fixtures, without paid generation.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened
  • Version/release files updated

Summary by CodeRabbit

  • Bug Fixes

    • Fixed mixed HTML and Markdown rendering so empty blockquotes remain separate and don’t absorb following text.
    • Improved image-generation debug logs by redacting credentials, image data, and other sensitive content while retaining useful prompts and request settings.
  • Tests

    • Added regression coverage for empty blockquote rendering and safe image-generation logging.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/6172 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 9/13/2026 **Status:** ✅ Merged **Merged:** 9/13/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/image-debug-review-followup` --- ### 📝 Commits (3) - [`cf15e67`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cf15e67e794bd0d1a3776680ad7e430fd022bc3f) fix: redact image debug payloads and clean up failed browser fixtures - [`73be95d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/73be95da98e271852bf676dac2e89bb6c09b61b0) Merge remote-tracking branch 'origin/staging' into fix/image-debug-review-followup - [`8bb1c27`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8bb1c27442603f0fff2af54f47d72d8d6fef7010) fix: keep prose after empty Markdown quotes outside the quote ### 📊 Changes **7 files changed** (+159 additions, -70 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `e2e/chat-sweep.e2e.ts` (+14 -10) 📝 `e2e/core-flows.e2e.ts` (+33 -33) 📝 `packages/client/src/lib/markdown.tsx` (+1 -1) 📝 `packages/server/src/services/image/image-generation.ts` (+42 -22) 📝 `scripts/regressions/assigned-issue-sweep.regression.ts` (+10 -0) 📝 `scripts/regressions/image-custom-parameters.regression.ts` (+57 -4) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Refs #6167 and #6170. Addresses the remaining valid review findings from #6168 and #6171. ## Why this change Image debug mode could write embedded image data and custom credential fields into logs. In mixed HTML messages, a bare Markdown quote line could absorb the following ordinary text. Browser fixtures could also remain in the test database when setup or an earlier cleanup request failed. ## What changed - Reuse the existing image MIME detector in one log-only payload formatter. Redact credentials, image data, and uploaded files, including nested serialized form/workflow values, while retaining prompts and token settings. Provider requests remain unchanged. - Allow an empty quote capture in the existing mixed-HTML formatter, keeping following prose and adjacent rules outside that quote. - Start fixture cleanup scopes before fallible setup and attempt chat/character cleanup independently. - Keep the existing per-entry lorebook race guard. Its timing results depend on the same override snapshot, so the proposed review change would install stale timing after a newer user toggle; the actual scan/toggle/persist regression passes. No new dependency, migration, UI copy, or version change. Changelog updated. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Automated validation - Image logging regression fails before the fix and passes afterward. Captured logs exclude image bytes and credentials across eight JSON providers, serialized NanoGPT payloads, and multipart uploads. Actual HTTP request fields, authorization headers, and uploaded image bytes remain unchanged; prompts and token-limit/count diagnostics remain visible. - Server typecheck, E2E typecheck, formatting, and diff checks pass. - The existing assigned-issue regression fails before the empty-quote correction and passes afterward, covering following prose and adjacent empty quotes/rules. - The existing lorebook scan/toggle/persist regression passes and confirms why the requested guard removal is unsafe. - Full local `pnpm check` passes on final commit `8bb1c27442603f0fff2af54f47d72d8d6fef7010`, including TypeScript, ESLint, localization validation, and the production build. Hosted CI passed: 268/268 Node regression files and 874 browser tests across all ten desktop Chromium, mobile Chromium, and mobile WebKit shards. Container, Windows, validation, and CodeQL checks passed. CodeRabbit completed; the one non-actionable cleanup suggestion was checked and explained in its resolved review thread. ### Manual verification needed - [ ] Manually inspect an image-generation debug log and confirm prompts/settings remain useful while credentials and reference-image data are hidden. Provider proof uses local HTTP fixtures, without paid generation. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened - [ ] Version/release files updated <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed mixed HTML and Markdown rendering so empty blockquotes remain separate and don’t absorb following text. * Improved image-generation debug logs by redacting credentials, image data, and other sensitive content while retaining useful prompts and request settings. * **Tests** * Added regression coverage for empty blockquote rendering and safe image-generation logging. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:16:20 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7078
No description provided.