Files
hermes-agent/apps
Teknium bb2362878b test(desktop): settle the render-count test past the code-plugin swap
stream-settled-renders asserts zero re-renders of settled rows across ten
streamed chunks. Every markdown surface loads @streamdown/code (all of
shiki) through a one-shot async import in useCodePlugin and re-renders once
when it lands. The settle loop only waited for the mounted-row COUNT to stop
changing, which a re-render of an already mounted row never moves, so on a
cold, loaded runner the import resolved inside the chunk window and every
settled text part rendered once more: "expected 0.3 to be +0" at :202 (one
extra text render for each of a0/a1/a2, zero root renders), seen on PR
#133068's first CI run and green on rerun.

Repro: mock @streamdown/code to hold its import until the window opens
(scratch-only injection). Base fails 10/10 with the CI's exact 0.3; this
fix passes 10/10 under the same injection. Without the beforeAll, the
injected fixed copy fails again (0.1), so both halves are load-bearing.

Fix, test-only: preload @streamdown/code in beforeAll so the hook's own
import is warm, and settle on the total render count rather than the
mounted-row count, so a one-shot re-render of a mounted row that lands
while settling extends the settle instead of slipping past it. The
assertion is unchanged.
2026-10-05 15:38:51 -07:00
..