Expanded tool-call group still crashes with React #185 after the 1px slack fix #47591
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/web
Steps to reproduce#
Open a thread whose timeline has an expanded tool-call group (here, a linked thread drawn by ReadOnlyThreadTimeline). The crash comes and goes with the group's size and the window's height and zoom.
This is the same crash as #45997, #47106 and #47121. #47145 added 1px of slack to the check, and this build already has it (the bundle reads _(t<=(g?1:47))), but it still crashes.
Expected behavior#
The thread renders.
Actual behavior#
The error screen shows Minified React error #185 (Maximum update depth exceeded). The minified frames t / F in ReadOnlyThreadTimeline-*.js map to the useLayoutEffect in ExpandedWorkGroupEntries (apps/web/src/components/chat/TimelineWorkGroupRows.tsx), at setFitsWithAllowance(...).
Why the 1px slack is not enough#
The effect decides fitsWithAllowance from scrollHeight - clientHeight, and fitsWithAllowance adds 48px to the box's maxHeight. So the value it measures moves with the value it sets. The thresholds (1 / 47) only settle when the box grows by exactly 48px and the content height stays the same. It doesn't when:
- an ancestor caps the box between its limit with and without the allowance (box grows by less than 48px),
- zoom rounding takes more than 1px,
- the virtualized list measures more rows once the taller box shows them.
Each case flips the flag on every layout pass until React throws #185.
Repro in a browser test: cap the group's clientHeight at 300px (between 288 and 336) with 13 tool rows. On current main it throws "Maximum update depth exceeded".
Impact#
Major degradation or frequent failure
Version or commit#
T3 Code (Nightly) 0.1.14-nightly.20261202.5611
Environment#
T3 Code desktop app, macOS arm64
Logs or stack traces#
Error: Minified React error #185; visit https://react.dev/errors/185 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at Hi (t3code://app/assets/client-D9ULarYk.js:8:28288)
at zi (t3code://app/assets/client-D9ULarYk.js:8:27813)
at _c (t3code://app/assets/client-D9ULarYk.js:8:60299)
at gc (t3code://app/assets/client-D9ULarYk.js:8:59921)
at t (t3code://app/assets/ReadOnlyThreadTimeline-BkgwQhi8.js:17:29402)
at F (t3code://app/assets/ReadOnlyThreadTimeline-BkgwQhi8.js:17:29422)
at Dl (t3code://app/assets/client-D9ULarYk.js:8:94923)
at yu (t3code://app/assets/client-D9ULarYk.js:8:104381)
at Ru (t3code://app/assets/client-D9ULarYk.js:8:115603)
at yu (t3code://app/assets/client-D9ULarYk.js:8:104368)
Workaround#
Reload, or collapse the tool-call group.
tanstack-source added labelsbug
pablonification(GitHub profile, opens in a new tab) linked this to #47594
juliusmarminge closed this
Follow-up after #47594 (closing it: I couldn't reproduce this on
mainin the real app, so the capped-box case it fixes isn't proven to be what crashes here).What the logs show for the crash in this report. The desktop trace shows the renderer crashing, reloading, and crashing again about 4s after each reload (15:42:11, 15:42:19.8 = the reported error, then a reload at 15:42:31 UTC). Work-group expansion isn't kept across a reload, so a group was likely re-opened right after each reload. The thread was in the normal thread view (the
ReadOnlyThreadTimeline-*.jschunk name is only where the bundler put the shared code). A browser preview tab was open in the right panel and the reporter was using it just before the crash. A Claude turn was streaming at the time.Ruled out on
main(real app, Replay plus a custom many-tools agent, and a copy of the reporter's database with the same thread):- groups of 13–40 tools, with individually expanded rows, including about 884px screenshot rows
- CSS zoom 0.67–1.25, window-height sweeps in 3px steps across the allowance edge, several window sizes at DPR 2
- collapse/reopen with a saved scroll position, scrolled to the end, streaming 40 tools into an open group
- the linked-thread read-only view
None of these crashed. No ancestor caps the list's height, and the content height (outside expanded rows) stayed at 24px × rows.
Remaining leads:
- LegendList appends a one-frame spacer when maintaining position past the end, so
scrollHeightcan differ between the two allowance states. The current1 : 47thresholds tolerate up to 2px of that; anything larger flips. - React 19 keeps the nested-update counter while sync/default work stays pending, so a flip per frame during a streaming turn could add up to 50 across frames. Not confirmed.
- The preview panel: it resizes the timeline's width, and that path wasn't tested with an open group while the panel was used.
Sign in to join this conversation.
I tried to reproduce this on the current build and could not.
Commit dff224df1d (origin/main). I did not reproduce it in the running desktop or web app, because the crash depends on the window's size and zoom and the reporter's thread. Instead I added a Vitest browser test (real Chromium) to apps/web/src/components/chat/MessagesTimeline.browser.test.tsx. The test renders the real MessagesTimeline with 13 completed tool rows, expands the work group, and caps the group's clientHeight (the [data-tool-group-scroll] element) at 300px. That is between its limit without the allowance (288px) and with it (336px), which is what an ancestor capping the box does. Run with
vp test run src/components/chat/MessagesTimeline.browser.test.tsx -t "overflow allowance|1px above"in apps/web. The new test fails with 'Error: Maximum update depth exceeded', the same message as the reporter's minified React #185. The existing #47145 test (scrollHeight 1px over) still passes. The failing test is pushed as factory/repro-47591 (466b9f58ac). An open pull request, #47594, already proposes a fix.Closing as not planned. If it still happens for you, reply with the exact steps and the version you are on and it will be looked at again.