[PR #1678] [MERGED] Fix Echo Chamber reload crash fallout #5206

Closed
opened 2026-10-22 04:14:14 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1678
Author: @cha1latte
Created: 5/30/2026
Status: ✅ Merged
Merged: 5/30/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/issue-1667-echo-reload


📝 Commits (3)

  • fc711f4 Fix Echo reload crash fallout
  • fac5d80 Merge remote-tracking branch 'upstream/refactor' into fix/issue-1667-echo-reload
  • fd5d433 Address error boundary review feedback

📊 Changes

7 files changed (+235 additions, -60 deletions)

View changed files

➕ docs/evidence/issue-1667/root-error-boundary-fallback.png (+0 -0)
➕ src/app/AppErrorBoundary.test.tsx (+39 -0)
➕ src/app/AppErrorBoundary.tsx (+72 -0)
📝 src/app/main.tsx (+6 -3)
📝 src/features/modes/shared/chat-ui/components/EchoChamberPanel.tsx (+5 -57)
➕ src/features/modes/shared/chat-ui/lib/echo-chamber-messages.test.ts (+61 -0)
➕ src/features/modes/shared/chat-ui/lib/echo-chamber-messages.ts (+52 -0)

📄 Description

Linked issue

Closes #1667

Why this change

  • Persisted Echo Chamber rows can come from nested agent-runs.resultData.reactions[] data, and future malformed rows should not be able to crash the visible chat UI.
  • The refactor branch already had the nested Echo row normalizer before this PR; this change makes that parser a tested helper and adds the missing root-level recovery UI so a future render error does not blank the entire frameless window.

What changed

  • Extracted Echo Chamber persisted-row parsing into echo-chamber-messages.ts.
  • Added coverage for nested resultData.reactions[], stringified result data, the legacy flat shape, and malformed should-not-match rows.
  • Added AppErrorBoundary above QueryClientProvider/App so root render failures show a reloadable fallback instead of emptying #root.
  • Added root boundary coverage and committed a scoped fallback screenshot for reviewer-visible UI evidence.

Refactor impact

Primary owner:

app shell and shared mode chat UI

Impact areas reviewed:

  • Echo Chamber reload parsing
  • Echo Chamber visible message sanitization
  • React root bootstrapping
  • Root render-error recovery

Boundary notes:

  • Feature/UI-only change. No engine imports from React, no raw Tauri or remote-runtime fetches, no Rust/storage/schema changes.

Pressure points touched:

  • src/app/main.tsx root bootstrap
  • shared mode UI EchoChamberPanel

Validation

  • pnpm check passes locally
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Playwright, screenshot, or recording evidence added for UI changes
  • Remote runtime smoke checked when relevant

Manual verification notes

  • Codex ran pnpm exec vitest run src/features/modes/shared/chat-ui/lib/echo-chamber-messages.test.ts src/app/AppErrorBoundary.test.tsx: 4 tests passed.
  • Codex ran pnpm typecheck: passed.
  • Codex ran pnpm build: passed.
  • Codex ran pnpm check: passed.
  • Codex ran node scratch\issue-1667-app-smoke.mjs: real Vite app mounted a non-empty #root.
  • Codex ran node scratch\issue-1667-boundary-proof.mjs: synthetic throwing child rendered the real AppErrorBoundary fallback.
  • Codex ran node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch/bugfix-verification.json: passed.
  • Limitation: the original Echo deserialization crash could not be reproduced on current upstream/refactor because the nested-row normalizer was already present before this PR. This PR adds direct parser proof and the missing root fallback.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

Root error boundary fallback

Summary by CodeRabbit

  • New Features

    • Added error handling that displays a user-friendly fallback message when the app encounters critical rendering errors, with an option to reload the application.
  • Tests

    • Added test coverage for error handling and message processing functionality.

Review Change Stack


🔄 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/1678 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/30/2026 **Status:** ✅ Merged **Merged:** 5/30/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-1667-echo-reload` --- ### 📝 Commits (3) - [`fc711f4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/fc711f436c17630c8a6ec234dfca63529266cc8f) Fix Echo reload crash fallout - [`fac5d80`](https://github.com/Pasta-Devs/Marinara-Engine/commit/fac5d8013a6c8811377a8ecb576e942ddc2aad7c) Merge remote-tracking branch 'upstream/refactor' into fix/issue-1667-echo-reload - [`fd5d433`](https://github.com/Pasta-Devs/Marinara-Engine/commit/fd5d4332c8447df0e0db5606d31fcca661874f9a) Address error boundary review feedback ### 📊 Changes **7 files changed** (+235 additions, -60 deletions) <details> <summary>View changed files</summary> ➕ `docs/evidence/issue-1667/root-error-boundary-fallback.png` (+0 -0) ➕ `src/app/AppErrorBoundary.test.tsx` (+39 -0) ➕ `src/app/AppErrorBoundary.tsx` (+72 -0) 📝 `src/app/main.tsx` (+6 -3) 📝 `src/features/modes/shared/chat-ui/components/EchoChamberPanel.tsx` (+5 -57) ➕ `src/features/modes/shared/chat-ui/lib/echo-chamber-messages.test.ts` (+61 -0) ➕ `src/features/modes/shared/chat-ui/lib/echo-chamber-messages.ts` (+52 -0) </details> ### 📄 Description ## Linked issue Closes #1667 ## Why this change - Persisted Echo Chamber rows can come from nested `agent-runs.resultData.reactions[]` data, and future malformed rows should not be able to crash the visible chat UI. - The refactor branch already had the nested Echo row normalizer before this PR; this change makes that parser a tested helper and adds the missing root-level recovery UI so a future render error does not blank the entire frameless window. ## What changed - Extracted Echo Chamber persisted-row parsing into `echo-chamber-messages.ts`. - Added coverage for nested `resultData.reactions[]`, stringified result data, the legacy flat shape, and malformed should-not-match rows. - Added `AppErrorBoundary` above `QueryClientProvider`/`App` so root render failures show a reloadable fallback instead of emptying `#root`. - Added root boundary coverage and committed a scoped fallback screenshot for reviewer-visible UI evidence. ## Refactor impact Primary owner: app shell and shared mode chat UI Impact areas reviewed: - Echo Chamber reload parsing - Echo Chamber visible message sanitization - React root bootstrapping - Root render-error recovery Boundary notes: - Feature/UI-only change. No engine imports from React, no raw Tauri or remote-runtime fetches, no Rust/storage/schema changes. Pressure points touched: - `src/app/main.tsx` root bootstrap - shared mode UI `EchoChamberPanel` ## Validation - [ ] `pnpm check` passes locally - [ ] `pnpm typecheck` passes locally - [ ] `pnpm build` passes locally - [ ] `pnpm check:architecture` passes locally - [ ] `pnpm check:docs` passes locally - [ ] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Playwright, screenshot, or recording evidence added for UI changes - [ ] Remote runtime smoke checked when relevant ### Manual verification notes - Codex ran `pnpm exec vitest run src/features/modes/shared/chat-ui/lib/echo-chamber-messages.test.ts src/app/AppErrorBoundary.test.tsx`: 4 tests passed. - Codex ran `pnpm typecheck`: passed. - Codex ran `pnpm build`: passed. - Codex ran `pnpm check`: passed. - Codex ran `node scratch\issue-1667-app-smoke.mjs`: real Vite app mounted a non-empty `#root`. - Codex ran `node scratch\issue-1667-boundary-proof.mjs`: synthetic throwing child rendered the real `AppErrorBoundary` fallback. - Codex ran `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch/bugfix-verification.json`: passed. - Limitation: the original Echo deserialization crash could not be reproduced on current `upstream/refactor` because the nested-row normalizer was already present before this PR. This PR adds direct parser proof and the missing root fallback. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence ![Root error boundary fallback](https://raw.githubusercontent.com/cha1latte/Marinara-Engine/fix/issue-1667-echo-reload/docs/evidence/issue-1667/root-error-boundary-fallback.png) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added error handling that displays a user-friendly fallback message when the app encounters critical rendering errors, with an option to reload the application. * **Tests** * Added test coverage for error handling and message processing functionality. <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/1678?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- 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-22 04:14:14 +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#5206
No description provided.