[PR #6230] [MERGED] fix: resolve pre-release issues in chat, providers, and UI #7097

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

📋 Pull Request Information

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

Base: staging ← Head: fix/release-issue-sweep-6229


📝 Commits (5)

  • b0bdb08 chore: track pre-release issue sweep
  • 5160750 docs: describe Illustrator token estimates accurately
  • 711c461 fix: resolve scene, provider usage, and mobile UI issue sweep
  • b2b26e2 docs: clarify Illustrator instruction token estimate
  • 9aedb4c fix: validate scene choices and resolve browser review findings

📊 Changes

41 files changed (+1266 additions, -495 deletions)

View changed files

📝 .github/workflows/playwright.yml (+7 -7)
📝 CHANGELOG.md (+10 -0)
📝 DESIGN.md (+4 -4)
📝 docs/media/illustrator-agent.md (+1 -1)
📝 e2e/accent-pulse.e2e.ts (+90 -0)
📝 e2e/chat-sweep.e2e.ts (+104 -0)
📝 e2e/core-flows.e2e.ts (+68 -19)
📝 e2e/scene-tts-preferences.e2e.ts (+52 -70)
📝 packages/client/src/components/chat/ConversationMessage.tsx (+68 -69)
📝 packages/client/src/components/chat/ConversationMessageGrouped.tsx (+5 -1)
📝 packages/client/src/components/chat/HomeBrowserHub.tsx (+2 -2)
📝 packages/client/src/components/modals/ScenePromptPreferencesModal.tsx (+40 -9)
📝 packages/client/src/components/panels/SettingsPanel.tsx (+1 -1)
📝 packages/client/src/components/presets/ChoiceSelectionModal.tsx (+11 -6)
📝 packages/client/src/features/tracker-panel/components/character-card/CharacterThoughtBubbles.tsx (+2 -2)
📝 packages/client/src/features/tracker-panel/components/character-card/CharacterTrackerCard.tsx (+3 -3)
📝 packages/client/src/features/tracker-panel/components/character-card/CharacterTrackerField.tsx (+4 -4)
📝 packages/client/src/features/tracker-panel/components/character-card/FeaturedCharacterFields.tsx (+4 -4)
📝 packages/client/src/features/tracker-panel/components/controls/StatGauge.tsx (+2 -3)
📝 packages/client/src/features/tracker-panel/components/controls/TrackerPortraitStage.tsx (+2 -2)

...and 21 more files

📄 Description

Linked issue

Closes #6214
Closes #6217
Closes #6218
Closes #6219
Closes #6220
Closes #6221
Closes #6222
Closes #6223
Closes #6224
Closes #6229

Companion #6231 addresses #6227 on the required docs-i18n branch.

Why this change

Scene setup was sending its first request before asking for preset variables. Proxy caching and multi-request token accounting also produced misleading results, while mobile users encountered displaced reactions, borders that ignored their accent, and a WebKit crash when opening Tracker cards. This sweep addresses the open reports before the next release is prepared.

What changed

  • Reuse the existing preset-variable dialog before scene planning. Pass those choices through planning and chat creation, resolve preset text with the existing assembler, retain its JSON output contract, and log the final prompt through the existing debug path. Cancel makes no generation request; Skip retains defaults.
  • Honor the OpenRouter connection type when caching through a proxy and read Gemini cached-content usage. Keep OpenRouter automatic caching, which its current documentation supports.
  • Keep only leading Anthropic system instructions in the system prefix. Depth instructions stay in history, using system messages for supported models/positions and user context at the same position otherwise.
  • Reuse one usage accumulator for tool rounds, finalization, and dice follow-ups, preserving reasoning/audio/prediction counters. Store the latest request's context size separately from turn-wide billing totals, including native Anthropic cache counts without double-counting inclusive providers.
  • Simplify Tracker color construction to avoid WebKit native crashes on both default and custom paints. Reuse existing material/text tokens and apply brightness after mixing; nameplates retain their own readable ink. Decorative cross-tints are reduced, while paint, strength, brightness, glow, and contrast controls remain.
  • Position conversation reaction chips before revealable action rows, covering user, assistant, and grouped messages in both layouts.
  • Derive shared border/input/sidebar tokens and shell separators from the selected accent; the mobile Home bookmark uses that accent too. Explicit custom-theme overrides still work.
  • Validate scene selections against preset options before provider calls or writes, retaining defaults, explicit empty selections, and legacy Random Pick arrays.
  • Keep shared suggestion-chip border blends simple so opening Professor Mari does not crash WebKit when both tint and border are derived colors. Chip outlines are slightly subtler.
  • Correct the Illustrator guide's token-estimate wording and update all ten translated agent guides in #6231.

Validation

Completed local proof:

  • pnpm check — passes, including localization, formatting, lint, TypeScript, and the shared/server/client production build.

  • pnpm regression:prompt — all three prompt, attachment, and context-fit suites pass.

  • Focused Node regression fixtures pass for provider caching (4 cases, including empty tool-result pairing), provider compatibility, tool/final usage, dice follow-up usage, context budget, and scene planning/creation. HTTP fixtures capture actual outbound provider payloads. Before-controls reproduce the reported failures.

  • Scene browser cases: 15 passed across desktop Chromium, mobile Chromium, and mobile WebKit. Includes light/dark choices, cancellation, Skip/defaults, remembered/deleted presets, failed list retry, and None while loading.

  • Chroma browser cases: 6 passed across the same three projects and both themes. Changing blue to teal updates real Home, header, Settings category, Quick Access, mode-divider, and desktop shell-edge styles; mobile bookmark tap is covered.

  • Reaction browser cases: 3 passed across the same projects, covering user/assistant/grouped messages, classic/bubble layouts, and revealing the action toolbar.

  • Tracker browser cases: 3 passed across all three projects, covering default/reload, saved custom paints, partial strengths at minimum/maximum brightness, readable nameplate text, card/avatar rendering, and unchanged saved characters. The original WebKit crash and custom-paint crash were reproduced before correction; no timeouts were raised. An independent temporary probe also rendered all generated paints for 23 representative palettes.

  • The eight Professor Mari cases that failed in hosted WebKit now pass locally after reproducing the native border-color crash.

  • Conversation editing/actions/swipe fixtures and reactions: 11 applicable cases pass across the three browsers. Their original geometry assertions remain intact; selectors now follow the same message ownership boundary.

  • The unchanged desktop Roleplay history/page-size case passes at its original timeout. Chromium CI now uses four smaller shards per project after the prior run reached the 30-minute cap; all tests, workers, timeouts, and aggregate checks are retained.

  • The Noodle cleanup fixture now derives expiry from recorded timestamps, with before/after retention-boundary checks. The fixed calendar date had expired; production cleanup behavior is unchanged.

  • All ten translated packs validate against their 125 English source guides; the Hindi review correction was revalidated.

The focused browser cases and all local commands above pass. Required CI and CodeRabbit review remain merge gates.

  • 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

Manual verification notes

Manually verify paid-provider cache reporting and scene output with live connections, and the affected controls on physical iPhone/Android devices. Local HTTP fixtures establish transmitted payloads and accounting, not provider billing or a model's compliance. Playwright exercises browser engines with synthetic chats, not physical hardware.

New messages use per-request context metadata. Historical messages without that metadata keep the legacy estimate until another generation supplies it. A latest request without a usage report displays no inferred context total.

Docs and release impact

User-focused changes are recorded under [Unreleased]; the Illustrator guide and theme-token reference are aligned. Translated guides/manifests target docs-i18n in #6231. This PR does not bump the version or promote staging to main.

UI evidence

Before/after screenshot gallery. Download the self-contained HTML to view its original embedded PNGs. Captures cover scene setup, Home/settings Chroma colors, and reaction placement, Tracker default/custom brightness rendering, and the corrected Professor Mari window. The WebKit Home capture has the same unrelated raster artifact before and after; the equivalent Chromium capture is included.

Provider contracts checked against OpenRouter caching, Anthropic history-level system messages, and Gemini usage metadata.

Summary by CodeRabbit

  • Bug Fixes

    • Scene setup cancellation no longer creates unintended scenes, and preset choices are applied correctly.
    • Conversation reactions remain aligned when message actions appear.
    • Token-context usage and cached-token reporting are more accurate across providers.
    • Anthropic instructions and OpenRouter caching now behave consistently.
    • WebKit tracker rendering and tracker text, surfaces, and colors display more reliably.
  • Improvements

    • Borders and bookmark controls now follow the selected accent color in light and dark themes.
    • Scene planning supports validated preset choices and preserves them in scene metadata.
  • Documentation

    • Updated design guidance and multilingual Illustrator token-estimate documentation.

🔄 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/6230 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 9/15/2026 **Status:** ✅ Merged **Merged:** 9/15/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/release-issue-sweep-6229` --- ### 📝 Commits (5) - [`b0bdb08`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b0bdb081563371a4fa18c6905dbcfbacadbfa87c) chore: track pre-release issue sweep - [`5160750`](https://github.com/Pasta-Devs/Marinara-Engine/commit/51607508a4a7d1dc65ce30a23e4de0165e6efad6) docs: describe Illustrator token estimates accurately - [`711c461`](https://github.com/Pasta-Devs/Marinara-Engine/commit/711c461e09cbbf9433e110d7d27ab3f1a6b72711) fix: resolve scene, provider usage, and mobile UI issue sweep - [`b2b26e2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b2b26e25cb94fdd88594afe3b54a0f497692811d) docs: clarify Illustrator instruction token estimate - [`9aedb4c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9aedb4c2db746fcd2978c2faeec5ca749ea9aa07) fix: validate scene choices and resolve browser review findings ### 📊 Changes **41 files changed** (+1266 additions, -495 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/playwright.yml` (+7 -7) 📝 `CHANGELOG.md` (+10 -0) 📝 `DESIGN.md` (+4 -4) 📝 `docs/media/illustrator-agent.md` (+1 -1) 📝 `e2e/accent-pulse.e2e.ts` (+90 -0) 📝 `e2e/chat-sweep.e2e.ts` (+104 -0) 📝 `e2e/core-flows.e2e.ts` (+68 -19) 📝 `e2e/scene-tts-preferences.e2e.ts` (+52 -70) 📝 `packages/client/src/components/chat/ConversationMessage.tsx` (+68 -69) 📝 `packages/client/src/components/chat/ConversationMessageGrouped.tsx` (+5 -1) 📝 `packages/client/src/components/chat/HomeBrowserHub.tsx` (+2 -2) 📝 `packages/client/src/components/modals/ScenePromptPreferencesModal.tsx` (+40 -9) 📝 `packages/client/src/components/panels/SettingsPanel.tsx` (+1 -1) 📝 `packages/client/src/components/presets/ChoiceSelectionModal.tsx` (+11 -6) 📝 `packages/client/src/features/tracker-panel/components/character-card/CharacterThoughtBubbles.tsx` (+2 -2) 📝 `packages/client/src/features/tracker-panel/components/character-card/CharacterTrackerCard.tsx` (+3 -3) 📝 `packages/client/src/features/tracker-panel/components/character-card/CharacterTrackerField.tsx` (+4 -4) 📝 `packages/client/src/features/tracker-panel/components/character-card/FeaturedCharacterFields.tsx` (+4 -4) 📝 `packages/client/src/features/tracker-panel/components/controls/StatGauge.tsx` (+2 -3) 📝 `packages/client/src/features/tracker-panel/components/controls/TrackerPortraitStage.tsx` (+2 -2) _...and 21 more files_ </details> ### 📄 Description ## Linked issue Closes #6214 Closes #6217 Closes #6218 Closes #6219 Closes #6220 Closes #6221 Closes #6222 Closes #6223 Closes #6224 Closes #6229 Companion #6231 addresses #6227 on the required `docs-i18n` branch. ## Why this change Scene setup was sending its first request before asking for preset variables. Proxy caching and multi-request token accounting also produced misleading results, while mobile users encountered displaced reactions, borders that ignored their accent, and a WebKit crash when opening Tracker cards. This sweep addresses the open reports before the next release is prepared. ## What changed - Reuse the existing preset-variable dialog before scene planning. Pass those choices through planning and chat creation, resolve preset text with the existing assembler, retain its JSON output contract, and log the final prompt through the existing debug path. Cancel makes no generation request; Skip retains defaults. - Honor the OpenRouter connection type when caching through a proxy and read Gemini cached-content usage. Keep OpenRouter automatic caching, which its current documentation supports. - Keep only leading Anthropic system instructions in the system prefix. Depth instructions stay in history, using system messages for supported models/positions and user context at the same position otherwise. - Reuse one usage accumulator for tool rounds, finalization, and dice follow-ups, preserving reasoning/audio/prediction counters. Store the latest request's context size separately from turn-wide billing totals, including native Anthropic cache counts without double-counting inclusive providers. - Simplify Tracker color construction to avoid WebKit native crashes on both default and custom paints. Reuse existing material/text tokens and apply brightness after mixing; nameplates retain their own readable ink. Decorative cross-tints are reduced, while paint, strength, brightness, glow, and contrast controls remain. - Position conversation reaction chips before revealable action rows, covering user, assistant, and grouped messages in both layouts. - Derive shared border/input/sidebar tokens and shell separators from the selected accent; the mobile Home bookmark uses that accent too. Explicit custom-theme overrides still work. - Validate scene selections against preset options before provider calls or writes, retaining defaults, explicit empty selections, and legacy Random Pick arrays. - Keep shared suggestion-chip border blends simple so opening Professor Mari does not crash WebKit when both tint and border are derived colors. Chip outlines are slightly subtler. - Correct the Illustrator guide's token-estimate wording and update all ten translated agent guides in #6231. ## Validation Completed local proof: - `pnpm check` — passes, including localization, formatting, lint, TypeScript, and the shared/server/client production build. - `pnpm regression:prompt` — all three prompt, attachment, and context-fit suites pass. - Focused Node regression fixtures pass for provider caching (4 cases, including empty tool-result pairing), provider compatibility, tool/final usage, dice follow-up usage, context budget, and scene planning/creation. HTTP fixtures capture actual outbound provider payloads. Before-controls reproduce the reported failures. - Scene browser cases: 15 passed across desktop Chromium, mobile Chromium, and mobile WebKit. Includes light/dark choices, cancellation, Skip/defaults, remembered/deleted presets, failed list retry, and None while loading. - Chroma browser cases: 6 passed across the same three projects and both themes. Changing blue to teal updates real Home, header, Settings category, Quick Access, mode-divider, and desktop shell-edge styles; mobile bookmark tap is covered. - Reaction browser cases: 3 passed across the same projects, covering user/assistant/grouped messages, classic/bubble layouts, and revealing the action toolbar. - Tracker browser cases: 3 passed across all three projects, covering default/reload, saved custom paints, partial strengths at minimum/maximum brightness, readable nameplate text, card/avatar rendering, and unchanged saved characters. The original WebKit crash and custom-paint crash were reproduced before correction; no timeouts were raised. An independent temporary probe also rendered all generated paints for 23 representative palettes. - The eight Professor Mari cases that failed in hosted WebKit now pass locally after reproducing the native border-color crash. - Conversation editing/actions/swipe fixtures and reactions: 11 applicable cases pass across the three browsers. Their original geometry assertions remain intact; selectors now follow the same message ownership boundary. - The unchanged desktop Roleplay history/page-size case passes at its original timeout. Chromium CI now uses four smaller shards per project after the prior run reached the 30-minute cap; all tests, workers, timeouts, and aggregate checks are retained. - The Noodle cleanup fixture now derives expiry from recorded timestamps, with before/after retention-boundary checks. The fixed calendar date had expired; production cleanup behavior is unchanged. - All ten translated packs validate against their 125 English source guides; the Hindi review correction was revalidated. The focused browser cases and all local commands above pass. Required CI and CodeRabbit review remain merge gates. - [ ] `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` ### Manual verification notes Manually verify paid-provider cache reporting and scene output with live connections, and the affected controls on physical iPhone/Android devices. Local HTTP fixtures establish transmitted payloads and accounting, not provider billing or a model's compliance. Playwright exercises browser engines with synthetic chats, not physical hardware. New messages use per-request context metadata. Historical messages without that metadata keep the legacy estimate until another generation supplies it. A latest request without a usage report displays no inferred context total. ## Docs and release impact User-focused changes are recorded under `[Unreleased]`; the Illustrator guide and theme-token reference are aligned. Translated guides/manifests target `docs-i18n` in #6231. This PR does not bump the version or promote staging to main. ## UI evidence [Before/after screenshot gallery](https://gist.github.com/SpicyMarinara/0d9aed2ac64f36569d222575b0b6cf6f). Download the self-contained HTML to view its original embedded PNGs. Captures cover scene setup, Home/settings Chroma colors, and reaction placement, Tracker default/custom brightness rendering, and the corrected Professor Mari window. The WebKit Home capture has the same unrelated raster artifact before and after; the equivalent Chromium capture is included. Provider contracts checked against [OpenRouter caching](https://openrouter.ai/docs/guides/best-practices/prompt-caching), [Anthropic history-level system messages](https://platform.claude.com/docs/en/build-with-claude/mid-conversation-system-messages), and [Gemini usage metadata](https://ai.google.dev/api/generate-content#UsageMetadata). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Scene setup cancellation no longer creates unintended scenes, and preset choices are applied correctly. - Conversation reactions remain aligned when message actions appear. - Token-context usage and cached-token reporting are more accurate across providers. - Anthropic instructions and OpenRouter caching now behave consistently. - WebKit tracker rendering and tracker text, surfaces, and colors display more reliably. - **Improvements** - Borders and bookmark controls now follow the selected accent color in light and dark themes. - Scene planning supports validated preset choices and preserves them in scene metadata. - **Documentation** - Updated design guidance and multilingual Illustrator token-estimate documentation. <!-- 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:30 +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#7097
No description provided.