mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1667] Echo Chamber reload crashes entire app (blank/frozen window) — wrong deserialization shape + no root error boundary #832
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#832
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 @aeriondyseti on GitHub (May 30, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1667
Originally assigned to: @cha1latte on GitHub.
Summary
Reopening a chat that has persisted Echo Chamber results crashes the entire app
with an uncaught
TypeError. Because there is no root-level error boundary, thecrash unmounts the whole React tree, leaving an empty
#root— which on theframeless (
decorations: false) Tauri window presents as a solid-colour,frozen, un-draggable window with no visible error.
This is a deterministic data-contract bug, not environment- or state-specific.
Any user who has run the
echo-chamberagent and then reloads/reopens that chatwill hit it.
The error
Root cause
There are two independent defects that compound:
Bug A — reload path deserializes the wrong shape (the crash)
Echo runs are persisted as
agent-runsrows whose payload is nested:(Confirmed against real on-disk data: 26/26 echo rows use this nested shape.)
The live SSE path reads it correctly —
use-generate.ts:680-686flattensdata.reactions[]and callsaddEchoMessage(characterName, text).The reload path does NOT.
EchoChamberPanel.tsx:122asserts a flat shape:The row has no top-level
characterName(it's two levels down inresultData.reactions[]), so everymsg.characterNameisundefined, andnameColorMap'smsg.characterName.lengththrows.The
list<T>()generic is an unchecked cast, sotscvalidated a shape thatnever exists on disk. The crash only surfaces with real persisted data, which is
why it passes typecheck and a clean profile but dies on any profile with echo
history.
Bug B — no root error boundary (severity multiplier)
The only error boundary in
src/is insideEncounterModal. A single componentthrow therefore takes down the whole app silently. Turning a localized data bug
into "the entire window is dead and shows nothing" is the actual reason this was
so hard to diagnose.
Proposed fix
resultData.reactions[]exactly likeuse-generate.tsdoes, ideally extracting a single shared parser(
parseMaybeRecord/readStringalready exist) so the two readers can't driftagain. Correct the
list<T>()type to the real stored shape.Appthat renders the errorinstead of unmounting to a blank screen.
asserting shapes via generics, to kill this defect class.
Repro
echo_messagerows inagent-runs).Environment
Surfaced under
pnpm tauri dev(WebKitGTK). Not WebKitGTK-specific — it alsothrows in a plain browser when echo rows are present; the blank-window
presentation is specific to the frameless Tauri window.
@cha1latte commented on GitHub (May 30, 2026):
fixed in #1678