Commit 26f42d9
The residual intermittent divergence on relay 10.6.3 (codex resize-mid-stream)
is NOT byte loss and NOT predictive echo: the rendered cells match the broker
oracle exactly (differingCells=0; replaying the delivered bytes through a clean
emulator equals the broker). The failure is the viewport being stranded in
scrollback — at quiet it sits at [viewportY=0, baseY=100] with byte-correct
content, so the fidelity quiet gate (viewportAtBottom) never closes. (The
"[39,2] vs [40,3]" cursor signature is a 0-indexed xterm vs 1-indexed broker
reporting artifact — the stream's last CUP is literally ESC[40;3H — not
corruption.)
Root cause: "am I following the tail?" was inferred from the INSTANTANEOUS
viewportY === baseY. Two paths transiently scroll the viewport off the bottom:
a TUI's SIGWINCH full-screen redraw (a server write, off-bottom DURING xterm's
async parse) and a width/height reflow (fitAddon.fit -> term.resize). Once the
viewport is off by even one line, the instantaneous check reads false and every
later write AND fit stops re-pinning — the grid freezes in scrollback.
Fix: track a sticky `followBottom` intent, flipped ONLY by a real user wheel
scroll. Re-pin against that intent (a) in the echo-router's direct-route write
COMPLETION callback, so a chunk that scrolls during its own parse is corrected
after the parse, and (b) centrally in tryFit, so every reflow site
(ResizeObserver, reconciler onPersistentDimsMismatch, init, refreshOnShow) keeps
a following viewport at the tail. A deliberate wheel-up into scrollback clears
the intent and is left alone (scrollback workload safe). No bytes are dropped
and the reconciler confirm-twice / rate-limit / dims gates are untouched.
Verified: 12/12 clean codex resize-mid-stream matrix runs (from a ~1-in-2
baseline); 71 focused renderer tests green including new regression tests that
lock the post-parse write re-pin and the reflow/wheel intent behavior.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent a52d3a2 commit 26f42d9
4 files changed
Lines changed: 190 additions & 3 deletions
File tree
- src/renderer/src/lib
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
562 | 562 | | |
563 | 563 | | |
564 | 564 | | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
142 | 168 | | |
143 | 169 | | |
144 | 170 | | |
| |||
159 | 185 | | |
160 | 186 | | |
161 | 187 | | |
162 | | - | |
| 188 | + | |
163 | 189 | | |
164 | 190 | | |
165 | 191 | | |
166 | | - | |
| 192 | + | |
167 | 193 | | |
168 | 194 | | |
169 | 195 | | |
| |||
Lines changed: 56 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
298 | 321 | | |
299 | 322 | | |
300 | 323 | | |
| |||
351 | 374 | | |
352 | 375 | | |
353 | 376 | | |
354 | | - | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
355 | 383 | | |
356 | 384 | | |
357 | 385 | | |
| |||
462 | 490 | | |
463 | 491 | | |
464 | 492 | | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
465 | 501 | | |
466 | 502 | | |
467 | 503 | | |
| |||
0 commit comments