Commit Graph

2133 Commits

Author SHA1 Message Date
can1357 7b22a2309c fix(tui): handled CPU-throttled loop stalls 2026-08-16 02:13:40 +02:00
can1357 62965c03a5 Merge PR #8442: fix(tui): classify a long loop block by CPU time instead of duration (@Mustaqeem66) 2026-08-16 02:13:39 +02:00
can1357 a7e810c6cc Merge PR #8444: fix(tui): keep btw panels out of scrollback (@Ant39140) 2026-08-16 02:13:38 +02:00
Ant39140 9f8eb090cb Merge remote-tracking branch 'upstream/main' into fix/btw-scrollback 2026-08-15 22:31:03 +08:00
chan1103 dc0e2ebeed fix(utils): stop indented code interrupting paragraphs in marked lexer 2026-08-14 22:48:39 +09:00
can1357 ffd53ff92a chore: bump version to 17.3.4 2026-08-14 14:38:16 +02:00
can1357 db6460c6c5 test(tui): restored process stream descriptors in issue-8542 repro teardown
- Replaced Reflect.deleteProperty teardown with the descriptor-preserving restoreProperty pattern used by the other ProcessTerminal suites, so real isTTY/setRawMode/columns/rows own-properties survive on TTY hosts and later test files are not poisoned.
2026-08-14 14:16:38 +02:00
roboomp 3f5cb91068 fix(tui): swallow late DA responses for the whole session
The private-CSI reassembly gate and the DA1 swallow were both guarded by
`#da1SentinelOwners.length > 0`, so a Device-Attributes reply that arrived
after the startup capability-probe sentinel FIFO drained fell through to the
input handler and leaked into the composer as literal text (e.g.
`1;22;...;52c`). The extra latency of an SSH/zmx PTY chain makes the race
observable.

`CSI ? ... c` and split private-CSI responses are terminal->host reports,
never keystrokes, so they are now consumed regardless of whether a sentinel
is still outstanding.

Fixes #8542
2026-08-14 10:57:37 +00:00
can1357 039728ad80 chore: bump version to 17.3.3 2026-08-14 05:44:05 +02:00
usr-bin-roygbiv ed108dec8b test(gemini): keep retry assertion behavioral 2026-08-14 02:54:25 +00:00
usr-bin-roygbiv fe33232298 fix(gemini): preserve retry and rendering boundaries 2026-08-14 02:48:18 +00:00
usr-bin-roygbiv bdbea3f7f3 fix(tui): recover reports after orphan fences 2026-08-14 02:15:22 +00:00
can1357 ae2d3d6ea1 chore: bump version to 17.3.2 2026-08-14 00:28:43 +02:00
can1357 0bc2c342f4 chore: bump version to 17.3.1 2026-08-13 19:39:21 +02:00
can1357 b279db1790 test: refactored test suites to eliminate time-based sleeps and polling loops
- Replaced time-based sleeps and polling loops with event-driven promise resolvers and fake timers across agent and tool tests.
- Migrated test suites to share in-memory auth storage and fixtures using lifecycle hooks.
- Updated catalog model definitions, metadata, and configurations.
2026-08-13 19:32:22 +02:00
can1357 2b02b1fbf0 test(tui): clear PI_TUI_RESIZE_IN_PLACE in stress env patch
The deterministic replay oracle only models in-place resize for tmux and
direct HerdR, but an inherited PI_TUI_RESIZE_IN_PLACE=1 makes the runtime
treat every scenario as in-place and desyncs the oracle. Add the key to
the stress env patch so a developer's override cannot leak into replay.
2026-08-13 18:44:18 +02:00
can1357 23aff5ae3f test(tui): model direct HerdR in-place resize in stress oracle
The HerdR flicker fix routed direct HerdR panes onto the in-place
multiplexer resize path, but the randomized render-stress oracle still
modeled them as ED3 replaying direct terminals. The width-epoch ledger
now applies to any in-place-resize scenario (multiplexer + direct HerdR)
via a dedicated resizeRepaintsInPlace trait, keeping HerdR's direct
scrollback semantics intact. Adds a deterministic replay regression
(seed 0xcafed00d, 24 iterations) that fails without the oracle update.
2026-08-13 18:39:29 +02:00
Ant39140 45b023cd83 fix(tui): keep btw panels out of scrollback 2026-08-14 00:09:56 +08:00
can1357 0b21036f66 chore: update changelogs 2026-08-13 18:09:56 +02:00
Muhammad Mustaqeem 3d05d9ae2f fix(tui): classify a long loop block by CPU time instead of duration
The watchdog discarded every overshoot longer than `sleepMs` (60s) as
system sleep, on the rationale that "the process could not have run JS
during the missed interval". That is true for a suspended process and
false for a CPU-bound wedge, which is exactly the case where JS ran the
whole interval at 100% CPU.

Duration cannot separate the two: both produce an arbitrarily large gap.
Keying the suppression on magnitude therefore dropped the most severe
stalls and kept only the mild ones, so the probe went quiet precisely
when it had something to report. Issue #5372 shows an 82,391ms block that
16.4.8 logged and current builds do not.

Classify by mechanism instead. `cpuNow()` reads process CPU time, and an
over-`sleepMs` gap is suppressed only when the process also burned less
than half of it on CPU. A resumed process shows a gap it did not spend
CPU on; a wedged one shows a gap it spent almost entirely on CPU. The
observed CPU time is included in the log line so a reader can tell which
kind of stall they are looking at.

Refs #5372, #7328, #6145
2026-08-13 20:57:00 +05:00
can1357 f4eb28e778 docs(tui): correct HerdR stress-scenario comment to match in-place resize policy
Direct HerdR panes no longer clear/replay via ED3 on resize; the
scenario description still claimed the old behavior. Aligns the comment
with PR #8433.
2026-08-13 17:13:14 +02:00
can1357 76457f82de refactor(tui): drop formatter churn from HerdR flicker fix
Revert the unrelated object-literal reflow bundled into the PR merge,
keeping only the direct-HerdR in-place resize routing, its tests, and
docs. PR #8433 (@roboomp).
2026-08-13 17:08:23 +02:00
roboomp 9b389d6006 fix(tui): preserved direct herdr clears
Scoped direct Herdr multiplexer behavior to resize repaint selection so explicit transcript replacements continue to clear and replay scrollback.

Added coverage for resize stability and resetDisplay ED3 behavior.
2026-08-13 14:45:03 +00:00
roboomp bb0314a5a1 fix(tui): stopped direct herdr pane flicker
Kept direct Herdr panes on the host-safe in-place resize path so streaming redraws no longer clear and replay pane scrollback.

Updated the resize regression, stress scenario, renderer docs, and changelog.

Fixes #8431
2026-08-13 14:34:03 +00:00
can1357 8b0f400d3c chore: bump version to 17.3.0 2026-08-13 08:28:43 +02:00
can1357 6b4823181b test: cleaned test suites and documented filtering guidelines
- Remove redundant definedness, null, and type checks across test suites in multiple packages.
- Clean up unused assertions, metadata tests, and obsolete test cases.
- Add good versus bad test filter guidelines and requirements to project documentation.
2026-08-13 08:28:42 +02:00
can1357 fc1fd664b9 chore(changelog): rewritten 2026-08-13 05:51:01 +02:00
can1357 2e492a3076 test(tui): corrected stress oracles and bounded-context resize expectation
- The mux pane-growth oracle treated every physical scroll as a logical append, but immutable-history recovery can recommit a corrected suffix after an off-screen mutation without advancing the shadow tape; exempt only changed shared history prefixes.
- The frame-neutral oracle compared prepared rows only; at narrow widths distinct raw rows prepare identically, so the renderer's raw-prefix divergence recovery recommits legitimately. Snapshot raw frames and allow declared transient growth.
- OSC66 spacer preservation intentionally composes six bounded context rows above the resize viewport; assert that exact bound instead of zero above-fold rendering.
Both oracle false positives reproduce identically at the PR head that introduced the harness (4cc9725037); three full randomized stress passes green after the fix.
2026-08-13 02:19:28 +02:00
can1357 ea10cce8d8 style: applied biome formatting to merged pull request sources 2026-08-13 01:23:48 +02:00
can1357 1c62a51dfd fix(tui): preserve OSC 66 spacers at viewport top 2026-08-13 01:14:53 +02:00
can1357 a8897e7012 Merge PR #8320: fix(tui): keep scaled OSC 66 heading reserved rows intact on repaint (@roboomp) 2026-08-13 01:14:52 +02:00
Shawn Koh c948d7a289 fix(tui): preserve lazy border render contract
Amp-Thread-ID: https://ampcode.com/threads/T-019ff125-f53d-739b-8462-6027fe70f914
Co-authored-by: Amp <amp@ampcode.com>
2026-08-12 15:56:33 +08:00
Shawn Koh 92b544b342 fix(tui): track editor border visibility revisions
Amp-Thread-ID: https://ampcode.com/threads/T-019ff125-f53d-739b-8462-6027fe70f914
Co-authored-by: Amp <amp@ampcode.com>
2026-08-12 15:40:26 +08:00
Shawn Koh 3285e6cf5b fix(tui): track lazy editor border revisions
Amp-Thread-ID: https://ampcode.com/threads/T-019ff125-f53d-739b-8462-6027fe70f914
Co-authored-by: Amp <amp@ampcode.com>
2026-08-12 15:26:22 +08:00
Shawn Koh ab6d04f121 fix(tui): track editor cursor layout revisions
Amp-Thread-ID: https://ampcode.com/threads/T-019ff125-f53d-739b-8462-6027fe70f914
Co-authored-by: Amp <amp@ampcode.com>
2026-08-12 15:11:44 +08:00
Shawn Koh 1e8c811a7c fix(tui): preserve covered width epoch seams
Amp-Thread-ID: https://ampcode.com/threads/T-019ff125-f53d-739b-8462-6027fe70f914
Co-authored-by: Amp <amp@ampcode.com>
2026-08-12 14:58:37 +08:00
Shawn Koh dffa4fac03 fix(tui): replay unresolved width epochs
Amp-Thread-ID: https://ampcode.com/threads/T-019ff125-f53d-739b-8462-6027fe70f914
Co-authored-by: Amp <amp@ampcode.com>
2026-08-12 14:40:36 +08:00
roboomp 4af147cd42 fix(tui): preserve resize top spacer with frame context
The resize fast path composed only the visible window, so a blank first row
whose scaled OSC 66 heading had scrolled just above the fold could not be
recognized and was erased, clearing the glyph's lower half until the settle
repaint (a resize flicker into the invisible-placeholder state).

#composeResizeViewport now collects a bounded band of context rows above the
fold (up to the protocol's max reserved-row count) and returns the visible
window preceded by that context in frame order; #emitResizeViewport resolves
each spacer width against the framed array. Add a regression driving a width
drag with the heading one row above the viewport top.
2026-08-12 06:26:01 +00:00
roboomp af5554c9c8 fix(tui): preserve OSC 66 spacers across commit seam
The seam rewrite detected spacer rows in its window-local slice. When a
heading committed in the chunk loop and its reserved row became window[0],
that lookup could not see the heading at frame[windowTop - 1] and erased the
glyph's lower half.

Resolve window spacer widths against full-frame coordinates, matching the
full-paint path. Add a regression where a streamed heading crosses the commit
seam and its spacer is the first visible window row.
2026-08-12 06:14:58 +00:00
roboomp 82be395c22 fix(tui): clear stale cells right of an OSC 66 heading's reserved row
The reserved spacer row beneath a scaled heading previously emitted nothing,
so a row reflowing from wider text into that position left stale cells to the
right of the (shorter) glyph — the heading write only covers the glyph's own
columns. Preserve columns [0, glyphWidth) and erase to end of line from there:
the glyph's lower half survives while stale cells are cleared instead of
lingering or scrolling into history.

#isOsc66SpacerRow now returns the glyph width to preserve (#osc66SpacerGlyphWidth,
-1 when not a reserved row); #lineRewriteSequence emits reset + CUF(glyphWidth) +
erase-to-end for those rows.
2026-08-12 06:06:47 +00:00
roboomp dfb6ecfb18 fix(tui): keep scaled OSC 66 heading reserved rows intact on repaint
The "Large Headings" feature renders Markdown H1 at 2x via the Kitty OSC 66
text-sizing protocol; a scale-s heading is s rows tall, so the s-1 blank rows
beneath it hold the multicell glyph's lower half. The render engine gave Kitty
image lines a dedicated re-emit path but had no OSC 66 awareness, so every
repaint through #lineRewriteSequence (incremental diff, full replay, resize
viewport) rewrote those reserved rows as reset + erase-to-end-of-line, clearing
the glyph and leaving reserved-but-invisible space.

Detect reserved rows from the heading's s= scale (#isOsc66SpacerRow) and emit
them untouched across every repaint path, covering all s-1 rows for scale >= 3.
Consolidate isOsc66Line into pi-tui/utils alongside a new osc66MaxScale.

Fixes #8318
2026-08-12 05:56:59 +00:00
Shawn Koh 3c26443405 fix(tui): track editor height epochs
Amp-Thread-ID: https://ampcode.com/threads/T-019ff125-f53d-739b-8462-6027fe70f914
Co-authored-by: Amp <amp@ampcode.com>
2026-08-12 13:25:36 +08:00
Shawn Koh 68a4e04fe6 docs: restore unreleased changelog entries
Amp-Thread-ID: https://ampcode.com/threads/T-019ff125-f53d-739b-8462-6027fe70f914
Co-authored-by: Amp <amp@ampcode.com>
2026-08-12 13:10:21 +08:00
Shawn Koh 1f736aa439 fix(tui): retain hidden resize growth
Amp-Thread-ID: https://ampcode.com/threads/T-019ff125-f53d-739b-8462-6027fe70f914
Co-authored-by: Amp <amp@ampcode.com>
2026-08-12 12:50:05 +08:00
Shawn Koh c6cae4ff61 fix(tui): preserve settled width epochs
Amp-Thread-ID: https://ampcode.com/threads/T-019ff125-f53d-739b-8462-6027fe70f914
Co-authored-by: Amp <amp@ampcode.com>
2026-08-12 12:05:27 +08:00
Shawn Koh b42ca37335 fix(tui): preserve replaced width epoch tails
Amp-Thread-ID: https://ampcode.com/threads/T-019ff125-f53d-739b-8462-6027fe70f914
Co-authored-by: Amp <amp@ampcode.com>
2026-08-12 11:37:54 +08:00
Shawn Koh 759341dd98 fix(tui): audit width reset commits
Amp-Thread-ID: https://ampcode.com/threads/T-019ff125-f53d-739b-8462-6027fe70f914
Co-authored-by: Amp <amp@ampcode.com>
2026-08-12 11:05:59 +08:00
Shawn Koh c6b626bf80 fix(tui): preserve nested width epoch tails
Amp-Thread-ID: https://ampcode.com/threads/T-019ff125-f53d-739b-8462-6027fe70f914
Co-authored-by: Amp <amp@ampcode.com>
2026-08-12 10:14:43 +08:00
Shawn Koh 7ec85280ec fix(tui): backfill unresolved overlay growth
Amp-Thread-ID: https://ampcode.com/threads/T-019ff125-f53d-739b-8462-6027fe70f914
Co-authored-by: Amp <amp@ampcode.com>
2026-08-12 10:14:43 +08:00
Shawn Koh c9e8d3791e fix(tui): preserve Kitty placement epochs across widths
Amp-Thread-ID: https://ampcode.com/threads/T-019ff125-f53d-739b-8462-6027fe70f914
Co-authored-by: Amp <amp@ampcode.com>
2026-08-12 10:14:43 +08:00