Skip to content

fix(settings): stop React #185 in Voice speech-model dropdown (crashes 7f93d89c, 362b566d) - #10028

Merged
nwparker merged 2 commits into
mainfrom
nwparker/fix-voice-speech-model-loop
Jul 23, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/fix-voice-speech-model-loop

Conversation

@nwparker

@nwparker nwparker commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes a renderer crash on Settings → Voice. Opening the Speech Model dropdown could trigger React error #185, “Maximum update depth exceeded,” and take down the settings error boundary.

When persisted settings did not yet contain settings.voice, VoicePane called getDefaultVoiceSettings() during every render. The fresh object changed updateVoiceSettings on every render, which re-armed the speech-data effect; that effect performs store writes and IPC that render the pane again. With the Radix dropdown open, the unbounded churn reached React’s update-depth guard.

Crash reports: 7f93d89c (macOS, 1.4.148) and 362b566d (Windows, 1.4.150).

Fix

  • Initialize a per-pane fallback once with lazy React state, giving it stable identity across renders without sharing the nested userModels array between pane instances.
  • Add the regression to the existing VoicePane suite and assert that catalog/model-state fetches remain single-shot across parent re-renders when voice settings are absent.
  • Remove the standalone 117-line test and its implementation-detail assertion about the default factory’s allocation strategy.
  • Rebuild the branch directly on current main.
  • Deterministically refresh the release-derived skill registries required by CI after newer remote release tags made main’s generated copies stale.

Fix evidence

Without the fix, the focused regression fails deterministically:

AssertionError: expected "vi.fn()" to be called 1 times, but got 6 times

With the fix:

Focused VoicePane/model tests: 10 passed
Full Vitest suite:            34,467 passed, 59 skipped
Full node/CLI/web typecheck:  passed
oxlint + React Doctor:        passed
Skill manifest verification: passed against the exact remote tag set

ELI5

For users without saved voice preferences, the page kept building a new “default preferences” box every time it redrew. React treated that new box as a change, fetched voice data again, redrew again, and repeated until it crashed. The page now creates one private default box per mounted pane and reuses it.

Risk and compatibility

  • No visual or persisted-data behavior changes; only fallback identity changes.
  • Existing settings.voice objects are still used unchanged.
  • The fallback is scoped to one component instance, so nested mutable defaults are not shared globally.
  • Renderer fix is platform-neutral; no macOS, Linux, Windows, Git, provider, local/SSH, or IPC contract changes.
  • The additional skill-registry changes are generated release metadata only.

Made with Orca 🐋

@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

VoicePane now creates its default voice settings once per component instance and reuses them when voice settings are absent. Tests cover absent voice settings, a typed empty speech catalog, exposed model-state refresh calls, and single invocation across repeated re-renders. Skill release revisions and release mappings were updated, while malformed snapshot registry continuations were corrected.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description is detailed, but it does not follow the required template and omits Screenshots, Testing checkboxes, AI Review Report, Security Audit, and Notes. Reformat the PR description to the repo template and add the missing Screenshots, Testing checklist, AI Review Report, Security Audit, and Notes sections.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly matches the main change: fixing the Voice settings React update-depth crash.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/renderer/src/components/settings/VoicePane.react185.test.tsx (1)

92-94: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Avoid pinning the helper’s allocation strategy.

The effect-stability test already catches the actual regression. This assertion would fail if getDefaultVoiceSettings() were later optimized to return a shared immutable value, even though VoicePane remains correct.

Suggested simplification
-  it('getDefaultVoiceSettings allocates a fresh object each call (root-cause guard)', () => {
-    expect(getDefaultVoiceSettings()).not.toBe(getDefaultVoiceSettings())
-  })

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0f54fb26-7cc1-4ecc-9046-611837c3e306

📥 Commits

Reviewing files that changed from the base of the PR and between bc301de and 6bd55b825bb5a17259656226020f6872862f5c0a.

📒 Files selected for processing (2)
  • src/renderer/src/components/settings/VoicePane.react185.test.tsx
  • src/renderer/src/components/settings/VoicePane.tsx

VoicePane created a fresh fallback on every render when settings.voice was absent, changing effect dependencies and repeatedly issuing speech IPC and model-state refreshes. Keep a per-pane lazy default with stable identity and cover the behavior in the existing VoicePane suite.

Fixes crash reports 7f93d89c (macOS) and 362b566d (Windows).
@nwparker
nwparker force-pushed the nwparker/fix-voice-speech-model-loop branch from 6bd55b8 to a1e4344 Compare July 23, 2026 01:15
Regenerate skill bundle registries against the current remote release tag set so the PR freshness gate matches a clean CI checkout.
@nwparker
nwparker merged commit 7a42271 into main Jul 23, 2026
14 checks passed
@nwparker
nwparker deleted the nwparker/fix-voice-speech-model-loop branch July 23, 2026 01:37
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant