fix(desktop): recover root error boundary from transient render races (salvage #41787) - #52704
Merged
Merged
Conversation
…aces A stale-index render race in assistant-ui (a just-shrunk thread rendered at an old message index during a session switch / teardown) throws errors like "tapClientLookup: Index N out of bounds", "Cannot read properties of undefined (reading 'type')", or "Tried to unmount a fiber that is already unmounted". These bubble to the root ErrorBoundary and latch the WHOLE desktop app on the "Reload window" fallback even though the next render against fresh state would be fine. Teach the root boundary to treat that small set of known-transient renderer errors as recoverable: log them and schedule a next-tick reset() so React re-renders against current state instead of stranding the user on the fallback. Auto-recovery is BOUNDED -- at most MAX_RECOVERIES (3) attempts within a 5s window -- so a genuinely persistent error can't spin the boundary in a reset -> throw -> reset loop; after the budget is spent the fallback is left up for the user. Manual retry (the button) resets the budget. Only the root boundary auto-recovers; scoped boundaries keep their own fallbacks, and unrecognized errors are never swallowed. Tests: transient race recovers (fallback never sticks), a persistent recoverable error stops at the cap and surfaces the fallback (proving the loop is bounded), and neither a non-root boundary nor an unrecognized root error auto-recovers. Closes #41693. Supersedes #41787 by @izumi0uu, reimplemented with a bounded recovery budget so a non-transient error can't loop forever. Co-authored-by: izumi0uu <izumi0uu@gmail.com>
14 tasks
OutThisLife
enabled auto-merge
June 25, 2026 21:16
Open
1 task
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
…ot-boundary-recover fix(desktop): recover root error boundary from transient render races (salvage NousResearch#41787)
habarmc1223-sudo
pushed a commit
to habarmc1223-sudo/hermes-agent-fluxmem
that referenced
this pull request
Jul 8, 2026
…ot-boundary-recover fix(desktop): recover root error boundary from transient render races (salvage NousResearch#41787)
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
…ot-boundary-recover fix(desktop): recover root error boundary from transient render races (salvage NousResearch#41787)
19 tasks
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
…ot-boundary-recover fix(desktop): recover root error boundary from transient render races (salvage NousResearch#41787)
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
…ot-boundary-recover fix(desktop): recover root error boundary from transient render races (salvage NousResearch#41787)
Merged
19 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Hermes Desktop could get stuck on the root "Reload window" screen after a transient assistant-ui render race. A just-shrunk thread rendered at a stale message index during a session switch / teardown throws errors like
tapClientLookup: Index N out of bounds,Cannot read properties of undefined (reading 'type'), orTried to unmount a fiber that is already unmounted. These bubble to the rootErrorBoundaryand latch the whole app on the fallback even though the next render against fresh state would be fine.Fix
The root boundary now treats that small set of known-transient renderer errors as recoverable: it logs them and schedules a next-tick
reset()so React re-renders against current state instead of stranding the user.Auto-recovery is bounded — at most
MAX_RECOVERIES(3) attempts within a 5s window — so a genuinely persistent error can't spin the boundary in areset -> throw -> resetloop; after the budget is spent the fallback is left up for the user. Manual retry (the button) resets the budget. Only the root boundary auto-recovers; scoped boundaries keep their own fallbacks, and unrecognized errors are never swallowed.Tests
error-boundary.test.tsx:tsc --noEmitclean, eslint clean, 4 tests green.Credit
Closes #41693. Supersedes #41787 by @izumi0uu (credited via
Co-authored-by), reimplemented with a bounded recovery budget so a non-transient error can't loop forever — addressing the symptom-only concern raised on the original PR.