Ran test.sh to identify failing tests.
ReproduceAnalyzed failures in AI package tests related to tool stream support.
Understandrun test.sh, figure out the failing tests
Running tests concisely
I need to follow the user's instructions clearly since they've given a specific task about running test.sh. Alright, I think I should run it from the root of the repository using bash. It's essential not to use npm tests since the user has explicitly asked for this script to be executed. So, I’m getting prepared to run it now and aim to keep things concise as I do so.
>./test.sh✓ test/suite/agent-session-compaction.test.ts (11 tests) 26ms
✓ test/path-utils.test.ts (10 tests) 5ms
✓ test/truncate-to-width.test.ts (6 tests) 17ms
From /var/folders/49/l4171l3n219_xwq30fmyzr8w0000gn/T/git-update-test-1775233502040-h3gz11ogi9m/remote
+ 7c99b7b...590967a main -> origin/main (forced update)
✓ test/suite/regressions/2023-queued-slash-command-followup.test.ts (1 test) 21ms
HEAD is now at 590967a New commit replacing A and B
✓ test/agent-session-runtime-events.test.ts (3 tests) 21ms
Installing ./packages/local-package...
✓ test/tree-selector.test.ts (15 tests) 14ms
stdout | test/package-command-paths.test.ts > package commands > should persist global relative local package paths relative to settings.json
Installed ./packages/local-package
Installing /var/folders/49/l4171l3n219_xwq30fmyzr8w0000gn/T/pi-package-commands-1775233503258-hez05hk4u3q/local-package/...
stdout | test/package-command-paths.test.ts > package commands > should remove local packages using a path with a trailing slash
Installed /var/folders/49/l4171l3n219_xwq30fmyzr8w0000gn/T/pi-package-commands-1775233503258-hez05hk4u3q/local-package/
Removing /var/folders/49/l4171l3n219_xwq30fmyzr8w0000gn/T/pi-package-commands-1775233503258-hez05hk4u3q/local-package/...
stdout | test/package-command-paths.test.ts > package commands > should remove local packages using a path with a trailing slash
Removed /var/folders/49/l4171l3n219_xwq30fmyzr8w0000gn/T/pi-package-commands-1775233503258-hez05hk4u3q/local-package/
✓ test/package-command-paths.test.ts (6 tests) 20ms
✓ test/session-selector-rename.test.ts (3 tests) 11ms
✓ test/agent-session-auto-compaction-queue.test.ts (6 tests) 17ms
✓ test/plan-mode-utils.test.ts (33 tests) 7ms
✓ test/edit-tool-legacy-input.test.ts (6 tests) 31ms
From /var/folders/49/l4171l3n219_xwq30fmyzr8w0000gn/T/git-update-test-1775233503158-a2i0jjko7x/remote
e0e6639..2cae08c main -> origin/main
✓ test/settings-manager-bug.test.ts (4 tests) 13ms
✓ test/agent-session-dynamic-tools.test.ts (3 tests) 16ms
HEAD is now at 2cae08c v3
✓ test/agent-session-dynamic-provider.test.ts (3 tests) 18ms
✓ test/session-selector-path-delete.test.ts (5 tests) 18ms
From /var/folders/49/l4171l3n219_xwq30fmyzr8w0000gn/T/git-update-test-1775233503158-a2i0jjko7x/remote
+ 2cae08c...9f94e63 main -> origin/main (forced update)
✓ test/bash-execution-width.test.ts (2 tests) 8ms
✓ test/interactive-mode-suspend.test.ts (2 tests) 6ms
✓ test/suite/regressions/2753-reload-stale-resource-settings.test.ts (1 test) 17ms
HEAD is now at 9f94e63 Rewrite B
✓ test/session-manager/tree-traversal.test.ts (30 tests) 11ms
✓ test/sdk-session-manager.test.ts (2 tests) 14ms
✓ test/image-resize-callers.test.ts (2 tests) 15ms
✓ test/package-manager-ssh.test.ts (8 tests) 9ms
✓ test/frontmatter.test.ts (8 tests) 9ms
✓ test/initial-message.test.ts (3 tests) 2ms
✓ test/session-manager/custom-session-id.test.ts (4 tests) 3ms
done
✓ test/print-mode.test.ts (3 tests) 6ms
✓ test/session-manager/labels.test.ts (8 tests) 4ms
✓ test/interactive-mode-status.test.ts (6 tests) 8ms
✓ test/prompt-templates.test.ts (73 tests) 6ms
✓ test/session-selector-search.test.ts (9 tests) 4ms
✓ test/keybindings-migration.test.ts (3 tests) 5ms
✓ test/rpc-jsonl.test.ts (4 tests) 4ms
✓ test/model-resolver.test.ts (31 tests) 9ms
✓ test/theme-export.test.ts (2 tests) 4ms
✓ test/session-manager/build-context.test.ts (14 tests) 4ms
✓ test/args.test.ts (49 tests) 6ms
✓ test/git-ssh-url.test.ts (9 tests) 4ms
✓ test/agent-session-stats.test.ts (3 tests) 5ms
✓ test/footer-width.test.ts (2 tests) 4ms
✓ test/session-manager/save-entry.test.ts (1 test) 3ms
✓ test/system-prompt.test.ts (7 tests) 3ms
✓ test/session-manager/migration.test.ts (2 tests) 2ms
From /var/folders/49/l4171l3n219_xwq30fmyzr8w0000gn/T/git-update-test-1775233504915-oidmha752jd/remote
d643a9c..b0d46b7 main -> origin/main
✓ test/trigger-compact-extension.test.ts (1 test) 3ms
HEAD is now at b0d46b7 Second commit
✓ test/compaction-serialization.test.ts (3 tests) 2ms
✓ test/compaction-summary-reasoning.test.ts (2 tests) 3ms
✓ test/git-update.test.ts (11 tests) 6816ms
✓ DefaultPackageManager git update > normal updates (no force-push) > should skip reset, clean, and install when already up to date 340ms
✓ DefaultPackageManager git update > normal updates (no force-push) > should update to latest commit when remote has new commits 429ms
✓ DefaultPackageManager git update > normal updates (no force-push) > should handle multiple commits ahead 682ms
✓ DefaultPackageManager git update > normal updates (no force-push) > should update even when local checkout has no upstream 715ms
✓ DefaultPackageManager git update > force-push scenarios > should recover when remote history is rewritten 1030ms
✓ DefaultPackageManager git update > force-push scenarios > should recover when local commit no longer exists in remote 1119ms
✓ DefaultPackageManager git update > force-push scenarios > should handle complete history rewrite 1212ms
✓ DefaultPackageManager git update > pinned sources > should not update pinned git sources (with @ref) 539ms
✓ DefaultPackageManager git update > scope-aware update > should not install locally when source is only registered globally 742ms
✓ test/compaction-extensions-example.test.ts (2 tests) 1ms
✓ test/agent-session-model-switch-thinking.test.ts (1 test) 5ms
↓ test/rpc.test.ts (14 tests | 14 skipped)
✓ test/interactive-mode-compaction.test.ts (1 test) 4ms
↓ test/bash-close-hang-windows.test.ts (2 tests | 2 skipped)
↓ test/agent-session-branching.test.ts (3 tests | 3 skipped)
↓ test/agent-session-tree-navigation.test.ts (10 tests | 10 skipped)
↓ test/agent-session-compaction.test.ts (5 tests | 5 skipped)
↓ test/compaction-extensions.test.ts (8 tests | 8 skipped)
↓ test/compaction-thinking-model.test.ts (3 tests | 3 skipped)
Test Files 81 passed | 7 skipped (88)
Tests 935 passed | 47 skipped (982)
Start at 18:24:58
Duration 8.17s (transform 1.96s, setup 0ms, collect 32.65s, tests 17.57s, environment 10ms, prepare 4.33s)
> @mariozechner/pi-tui@0.64.0 test
> node --test --import tsx test/*.test.ts
Result: {
items: [ { value: '/Applications/', label: 'Applications/' } ],
prefix: '/A'
}
Result: null
Result: {
items: [
{ value: '/.nofollow/', label: '.nofollow/' },
{ value: '/.resolve/', label: '.resolve/' },
{ value: '/.vol/', label: '.vol/' },
{ value: '/Applications/', label: 'Applications/' },
{ value: '/bin/', label: 'bin/' },
{ value: '/cores/', label: 'cores/' },
{ value: '/dev/', label: 'dev/' },
{ value: '/etc/', label: 'etc/' },
{ value: '/home/', label: 'home/' },
{ value: '/Library/', label: 'Library/' },
{ value: '/opt/', label: 'opt/' },
{ value: '/private/', label: 'private/' },
{ value: '/sbin/', label: 'sbin/' },
{ value: '/System/', label: 'System/' },
{ value: '/tmp/', label: 'tmp/' },
{ value: '/Users/', label: 'Users/' },
{ value: '/usr/', label: 'usr/' },
{ value: '/var/', label: 'var/' },
{ value: '/Volumes/', label: 'Volumes/' },
{ value: '/.file', label: '.file' },
{ value: '/.VolumeIcon.icns', label: '.VolumeIcon.icns' }
],
prefix: '/'
}
▶ CombinedAutocompleteProvider
▶ extractPathPrefix
✔ extracts / from 'hey /' when forced (9.539583ms)
✔ extracts /A from '/A' when forced (1.459875ms)
✔ does not trigger for slash commands (0.179458ms)
✔ triggers for absolute paths after slash command argument (0.514958ms)
✔ extractPathPrefix (12.111542ms)
▶ fd @ file suggestions
✔ returns all files and folders for empty @ query (33.193333ms)
✔ matches file with extension in query (11.713208ms)
✔ filters are case insensitive (12.307ms)
✔ ranks directories before files (13.050958ms)
✔ returns nested file paths (15.385125ms)
✔ matches deeply nested paths (12.333875ms)
✔ matches directory in middle of path with --full-path (11.866583ms)
✔ scopes fuzzy search to relative directories and searches recursively (25.163541ms)
✔ quotes paths with spaces for @ suggestions (17.825125ms)
✔ includes hidden paths but excludes .git (11.267375ms)
✔ continues autocomplete inside quoted @ paths (13.518292ms)
✔ applies quoted @ completion without duplicating closing quote (13.719083ms)
✔ fd @ file suggestions (191.929041ms)
▶ dot-slash path completion
✔ preserves ./ prefix when completing paths (0.821083ms)
✔ preserves ./ prefix for directory completions (0.613875ms)
✔ dot-slash path completion (1.491208ms)
▶ quoted path completion
✔ quotes paths with spaces for direct completion (0.655875ms)
✔ continues completion inside quoted paths (0.691334ms)
✔ applies quoted completion without duplicating closing quote (0.662917ms)
✔ quoted path completion (2.060541ms)
✔ CombinedAutocompleteProvider (207.973125ms)
▶ Bug regression: isImageLine() crash with image escape sequences
▶ Bug scenario: Terminal without image support
✔ old implementation would return false, causing crash (0.556541ms)
✔ new implementation returns true correctly (2.488875ms)
✔ new implementation detects Kitty sequences in any position (0.547958ms)
✔ new implementation detects iTerm2 sequences in any position (0.375166ms)
✔ Bug scenario: Terminal without image support (4.410625ms)
▶ Integration: Tool execution scenario
✔ detects image sequences in read tool output (0.430708ms)
✔ detects Kitty sequences from Image component (0.479708ms)
✔ handles ANSI codes before image sequences (0.360333ms)
✔ Integration: Tool execution scenario (1.411084ms)
▶ Crash scenario simulation
✔ does NOT crash on very long lines with image sequences (0.748209ms)
✔ handles lines exactly matching crash log dimensions (0.620291ms)
✔ Crash scenario simulation (1.477709ms)
▶ Negative cases: Don't false positive
✔ does not detect images in regular long text (0.55375ms)
✔ does not detect images in lines with file paths (0.319167ms)
✔ Negative cases: Don't false positive (0.931667ms)
✔ Bug regression: isImageLine() crash with image escape sequences (8.582125ms)
▶ Editor component
▶ Prompt history navigation
✔ does nothing on Up arrow when history is empty (12.661334ms)
✔ shows most recent history entry on Up arrow when editor is empty (8.52125ms)
✔ cycles through history entries on repeated Up arrow (2.277291ms)
✔ returns to empty editor on Down arrow after browsing history (0.521292ms)
✔ navigates forward through history with Down arrow (0.644042ms)
✔ exits history mode when typing a character (0.577708ms)
✔ exits history mode on setText (0.443167ms)
✔ does not add empty strings to history (0.340208ms)
✔ does not add consecutive duplicates to history (0.362583ms)
✔ allows non-consecutive duplicates in history (0.473291ms)
✔ uses cursor movement instead of history when editor has content (0.638125ms)
✔ limits history to 100 entries (1.976125ms)
✔ allows cursor movement within multi-line history entry with Down (0.431917ms)
✔ allows cursor movement within multi-line history entry with Up (0.345083ms)
✔ navigates from multi-line entry back to newer via Down after cursor movement (0.3565ms)
✔ Prompt history navigation (31.276833ms)
▶ public state accessors
✔ returns cursor position (1.109291ms)
✔ returns lines as a defensive copy (0.282042ms)
✔ public state accessors (1.460666ms)
▶ Backslash+Enter newline workaround
✔ inserts backslash immediately (no buffering) (0.2735ms)
✔ converts standalone backslash to newline on Enter (0.359042ms)
✔ inserts backslash normally when followed by other characters (0.273ms)
✔ does not trigger newline when backslash is not immediately before cursor (0.362292ms)
✔ only removes one backslash when multiple are present (0.314375ms)
✔ Backslash+Enter newline workaround (1.6575ms)
▶ Kitty CSI-u handling
✔ ignores printable CSI-u sequences with unsupported modifiers (0.355666ms)
✔ Kitty CSI-u handling (0.387583ms)
▶ Unicode text editing behavior
✔ inserts mixed ASCII, umlauts, and emojis as literal text (0.633959ms)
✔ deletes single-code-unit unicode characters (umlauts) with Backspace (0.294083ms)
✔ deletes multi-code-unit emojis with single Backspace (2.84675ms)
✔ inserts characters at the correct position after cursor movement over umlauts (1.0155ms)
✔ moves cursor across multi-code-unit emojis with single arrow key (13.938084ms)
✔ preserves umlauts across line breaks (0.454334ms)
✔ replaces the entire document with unicode text via setText (paste simulation) (0.240375ms)
✔ moves cursor to document start on Ctrl+A and inserts at the beginning (0.338875ms)
✔ deletes words correctly with Ctrl+W and Alt+Backspace (0.556291ms)
✔ navigates words correctly with Ctrl+Left/Right (0.537458ms)
✔ Unicode text editing behavior (21.023125ms)
▶ Grapheme-aware text wrapping
✔ wraps lines correctly when text contains wide emojis (0.718625ms)
✔ wraps long text with emojis at correct positions (0.359958ms)
✔ wraps CJK characters correctly (each is 2 columns wide) (0.682667ms)
✔ handles mixed ASCII and wide characters in wrapping (0.282833ms)
✔ renders cursor correctly on wide characters (0.280541ms)
✔ does not exceed terminal width with emoji at wrap boundary (0.257833ms)
✔ shows cursor at end of line before wrap, wraps on next char (0.815542ms)
✔ Grapheme-aware text wrapping (3.510916ms)
▶ Word wrapping
✔ wraps at word boundaries instead of mid-word (0.464667ms)
✔ does not start lines with leading whitespace after word wrap (2.833958ms)
✔ breaks long words (URLs) at character level (0.350792ms)
✔ preserves multiple spaces within words on same line (0.225834ms)
✔ handles empty string (0.217667ms)
✔ handles single word that fits exactly (0.209916ms)
✔ wraps word to next line when it ends exactly at terminal width (0.05225ms)
✔ keeps whitespace at terminal width boundary on same line (0.039083ms)
✔ handles unbreakable word filling width exactly followed by space (0.039167ms)
✔ wraps word to next line when it fits width but not remaining space (0.051875ms)
✔ keeps word with multi-space and following word together when they fit (0.044459ms)
✔ keeps word with multi-space and following word when they fill width exactly (0.051833ms)
✔ splits when word plus multi-space plus word exceeds width (0.046583ms)
✔ breaks long whitespace at line boundary (0.050875ms)
✔ breaks long whitespace at line boundary 2 (0.047958ms)
✔ breaks whitespace spanning full lines (0.051833ms)
✔ force-breaks when wide char after word boundary wrap still overflows (0.196458ms)
✔ splits oversized atomic segment across multiple chunks (0.148042ms)
✔ splits oversized atomic segment at start of line (0.124583ms)
✔ splits oversized atomic segment at end of line (0.062292ms)
✔ splits consecutive oversized atomic segments (0.065584ms)
✔ wraps normally after oversized atomic segment (0.078667ms)
✔ Word wrapping (5.676583ms)
▶ Kill ring
✔ Ctrl+W saves deleted text to kill ring and Ctrl+Y yanks it (0.466834ms)
✔ Ctrl+U saves deleted text to kill ring (0.391208ms)
✔ Ctrl+K saves deleted text to kill ring (0.240125ms)
✔ Ctrl+Y does nothing when kill ring is empty (0.189834ms)
✔ Alt+Y cycles through kill ring after Ctrl+Y (0.336083ms)
✔ Alt+Y does nothing if not preceded by yank (0.22175ms)
✔ Alt+Y does nothing if kill ring has ≤1 entry (0.290417ms)
✔ consecutive Ctrl+W accumulates into one kill ring entry (0.32725ms)
✔ Ctrl+U accumulates multiline deletes including newlines (0.334625ms)
✔ backward deletions prepend, forward deletions append during accumulation (0.388625ms)
✔ non-delete actions break kill accumulation (0.283ms)
✔ non-yank actions break Alt+Y chain (0.248583ms)
✔ kill ring rotation persists after cycling (0.265167ms)
✔ consecutive deletions across lines coalesce into one entry (0.26925ms)
✔ Ctrl+K at line end deletes newline and coalesces (0.341958ms)
✔ handles yank in middle of text (0.307417ms)
✔ handles yank-pop in middle of text (0.33675ms)
✔ multiline yank and yank-pop in middle of text (0.382375ms)
✔ Alt+D deletes word forward and saves to kill ring (0.297042ms)
✔ Alt+D at end of line deletes newline (0.2325ms)
✔ Kill ring (6.401833ms)
▶ Undo
✔ does nothing when undo stack is empty (0.3275ms)
✔ coalesces consecutive word characters into one undo unit (0.354833ms)
✔ undoes spaces one at a time (0.306459ms)
✔ undoes newlines and signals next word to capture state (0.370666ms)
✔ undoes backspace (0.279541ms)
✔ undoes forward delete (0.38725ms)
✔ undoes Ctrl+W (delete word backward) (0.381792ms)
✔ undoes Ctrl+K (delete to line end) (0.566709ms)
✔ undoes Ctrl+U (delete to line start) (0.481792ms)
✔ undoes yank (5.42925ms)
✔ undoes single-line paste atomically (0.580208ms)
✔ does not trigger autocomplete during single-line paste (9.2195ms)
✔ undoes multi-line paste atomically (0.50275ms)
✔ undoes insertTextAtCursor atomically (0.380125ms)
✔ insertTextAtCursor handles multiline text (0.366875ms)
✔ insertTextAtCursor normalizes CRLF and CR line endings (0.219208ms)
✔ undoes setText to empty string (0.372917ms)
✔ clears undo stack on submit (0.306542ms)
✔ exits history browsing mode on undo (9.554625ms)
✔ undo restores to pre-history state even after multiple history navigations (0.492292ms)
✔ cursor movement starts new undo unit (0.490375ms)
✔ no-op delete operations do not push undo snapshots (0.858541ms)
✔ undoes autocomplete (23.482ms)
✔ Undo (56.181542ms)
▶ Autocomplete
✔ auto-applies single force-file suggestion without showing menu (1.430625ms)
✔ shows menu when force-file has multiple suggestions (0.943167ms)
✔ keeps suggestions open when typing in force mode (Tab-triggered) (5.246875ms)
✔ debounces @ autocomplete while typing (82.183958ms)
✔ aborts active @ autocomplete when typing continues (303.119166ms)
✔ hides autocomplete when backspacing slash command to empty (0.7645ms)
✔ applies exact typed slash-argument value on Enter even when first item is highlighted (0.799417ms)
✔ selects first prefix match on Enter when typed arg is not exact match (1.250208ms)
✔ highlights unique prefix match as user types (before full exact match) (0.717083ms)
✔ selects first prefix match when multiple items match (0.631375ms)
✔ works for built-in-style command argument completion path (model-like) (0.931375ms)
✔ awaits async slash command argument completions (0.697292ms)
✔ ignores invalid slash command argument completion results (0.436125ms)
✔ does not show argument completions when command has no argument completer (0.64175ms)
✔ Autocomplete (401.13525ms)
▶ Character jump (Ctrl+])
✔ jumps forward to first occurrence of character on same line (0.296666ms)
✔ jumps forward to next occurrence after cursor (0.261459ms)
✔ jumps forward across multiple lines (0.235042ms)
✔ jumps backward to first occurrence before cursor on same line (0.176167ms)
✔ jumps backward across multiple lines (0.164333ms)
✔ does nothing when character is not found (forward) (0.168875ms)
✔ does nothing when character is not found (backward) (0.165625ms)
✔ is case-sensitive (0.176042ms)
✔ cancels jump mode when Ctrl+] is pressed again (0.17675ms)
✔ cancels jump mode on Escape and processes the Escape (0.186417ms)
✔ cancels backward jump mode when Ctrl+Alt+] is pressed again (0.292041ms)
✔ searches for special characters (0.178416ms)
✔ handles empty text gracefully (0.25675ms)
✔ resets lastAction when jumping (0.275458ms)
✔ Character jump (Ctrl+]) (3.142583ms)
▶ Sticky column
✔ preserves target column when moving up through a shorter line (0.466292ms)
✔ preserves target column when moving down through a shorter line (0.371708ms)
✔ resets sticky column on horizontal movement (left arrow) (0.292792ms)
✔ resets sticky column on horizontal movement (right arrow) (0.301542ms)
✔ resets sticky column on typing (0.312959ms)
✔ resets sticky column on backspace (0.325583ms)
✔ resets sticky column on Ctrl+A (move to line start) (0.268209ms)
✔ resets sticky column on Ctrl+E (move to line end) (0.310708ms)
✔ resets sticky column on word movement (Ctrl+Left) (0.318ms)
✔ resets sticky column on word movement (Ctrl+Right) (0.503125ms)
✔ resets sticky column on undo (0.512167ms)
✔ handles multiple consecutive up/down movements (0.378792ms)
✔ moves correctly through wrapped visual lines without getting stuck (0.327042ms)
✔ handles setText resetting sticky column (0.307958ms)
✔ sets preferredVisualCol when pressing right at end of prompt (last line) (0.284042ms)
✔ handles editor resizes when preferredVisualCol is on the same line (0.492208ms)
✔ handles editor resizes when preferredVisualCol is on a different line (0.397083ms)
✔ Sticky column (6.373167ms)
▶ Paste marker atomic behavior
✔ creates a paste marker for large pastes (1.93225ms)
✔ treats paste marker as single unit for right arrow (0.536416ms)
✔ treats paste marker as single unit for left arrow (0.297917ms)
✔ treats paste marker as single unit for backspace (0.384875ms)
✔ treats paste marker as single unit for forward delete (0.346792ms)
✔ treats paste marker as single unit for word movement (0.329542ms)
✔ undo restores marker after backspace deletion (0.286834ms)
✔ handles multiple paste markers in same line (1.146541ms)
✔ does not treat manually typed marker-like text as atomic (no valid paste ID) (0.562375ms)
✔ does not crash when paste marker is wider than terminal width (0.346791ms)
✔ does not crash when text + paste marker exceeds terminal width with cursor on marker (0.841291ms)
✔ wordWrapLine re-checks overflow after backtracking to wrap opportunity (0.685459ms)
✔ expands large pasted content literally in getExpandedText (0.295167ms)
✔ submits large pasted content literally (0.247208ms)
✔ Paste marker atomic behavior (8.4365ms)
✔ Editor component (547.229375ms)
▶ fuzzyMatch
✔ empty query matches everything with score 0 (0.648584ms)
✔ query longer than text does not match (0.099291ms)
✔ exact match has good score (0.124375ms)
✔ characters must appear in order (0.096125ms)
✔ case insensitive matching (0.065417ms)
✔ consecutive matches score better than scattered matches (0.072875ms)
✔ word boundary matches score better (0.055584ms)
✔ matches swapped alpha numeric tokens (0.064625ms)
✔ fuzzyMatch (1.830875ms)
▶ fuzzyFilter
✔ empty query returns all items unchanged (0.664ms)
✔ filters out non-matching items (0.141542ms)
✔ sorts results by match quality (0.115167ms)
✔ works with custom getText function (0.082916ms)
✔ fuzzyFilter (1.12425ms)
▶ Input component
✔ submits value including backslash on Enter (1.808167ms)
✔ inserts backslash as regular character (0.158125ms)
▶ render
✔ does not overflow with wide CJK and fullwidth text (5.658167ms)
✔ keeps the cursor visible when horizontally scrolling wide text (0.2285ms)
✔ render (5.982417ms)
▶ Kill ring
✔ Ctrl+W saves deleted text to kill ring and Ctrl+Y yanks it (0.439584ms)
✔ Ctrl+U saves deleted text to kill ring (0.185ms)
✔ Ctrl+K saves deleted text to kill ring (0.110333ms)
✔ Ctrl+Y does nothing when kill ring is empty (0.07225ms)
✔ Alt+Y cycles through kill ring after Ctrl+Y (0.257ms)
✔ Alt+Y does nothing if not preceded by yank (0.163875ms)
✔ Alt+Y does nothing if kill ring has one entry (0.1245ms)
✔ consecutive Ctrl+W accumulates into one kill ring entry (0.105958ms)
✔ non-delete actions break kill accumulation (0.143125ms)
✔ non-yank actions break Alt+Y chain (0.12225ms)
✔ kill ring rotation persists after cycling (0.170834ms)
✔ backward deletions prepend, forward deletions append during accumulation (0.1375ms)
✔ Alt+D deletes word forward and saves to kill ring (0.142959ms)
✔ handles yank in middle of text (0.138959ms)
✔ handles yank-pop in middle of text (0.180167ms)
✔ Kill ring (3.759417ms)
▶ Undo
✔ does nothing when undo stack is empty (0.130917ms)
✔ coalesces consecutive word characters into one undo unit (0.217916ms)
✔ undoes spaces one at a time (0.159875ms)
✔ undoes backspace (0.139083ms)
✔ undoes forward delete (0.179958ms)
✔ undoes Ctrl+W (delete word backward) (0.211625ms)
✔ undoes Ctrl+K (delete to line end) (0.289458ms)
✔ undoes Ctrl+U (delete to line start) (0.28975ms)
✔ undoes yank (0.179334ms)
✔ undoes paste atomically (0.150167ms)
✔ undoes Alt+D (delete word forward) (0.064667ms)
✔ cursor movement starts new undo unit (0.1415ms)
✔ Undo (2.290917ms)
✔ Input component (14.62075ms)
▶ KeybindingsManager
✔ does not evict selector confirm when input submit is rebound (1.377708ms)
✔ does not evict cursor bindings when another action reuses the same key (0.1875ms)
✔ still reports direct user binding conflicts without evicting defaults (0.137167ms)
✔ KeybindingsManager (2.260708ms)
▶ matchesKey
▶ Kitty protocol with alternate keys (non-Latin layouts)
✔ should match Ctrl+c when pressing Ctrl+С (Cyrillic) with base layout key (1.118708ms)
✔ should match Ctrl+d when pressing Ctrl+В (Cyrillic) with base layout key (0.1535ms)
✔ should match Ctrl+z when pressing Ctrl+Я (Cyrillic) with base layout key (0.075708ms)
✔ should match Ctrl+Shift+p with base layout key (0.066583ms)
✔ should still match direct codepoint when no base layout key (0.080125ms)
✔ should match digit bindings via Kitty CSI-u (0.341ms)
✔ should normalize Kitty keypad functional keys to logical digits, symbols, and navigation (0.1535ms)
✔ should handle shifted key in format (0.060458ms)
✔ should handle event type in format (0.065042ms)
✔ should handle full format with shifted key, base key, and event type (0.101167ms)
✔ should prefer codepoint for Latin letters even when base layout differs (0.095ms)
✔ should prefer codepoint for symbol keys even when base layout differs (0.048875ms)
✔ should not match wrong key even with base layout (0.044125ms)
✔ should not match wrong modifiers even with base layout (0.04225ms)
✔ Kitty protocol with alternate keys (non-Latin layouts) (3.115875ms)
▶ modifyOtherKeys matching
✔ should match xterm modifyOtherKeys Ctrl+c (0.249459ms)
✔ should match xterm modifyOtherKeys Ctrl+d (0.044583ms)
✔ should match xterm modifyOtherKeys Ctrl+z (0.037042ms)
✔ should match xterm modifyOtherKeys Enter variants (0.074333ms)
✔ should match xterm modifyOtherKeys Tab variants (0.050208ms)
✔ should match xterm modifyOtherKeys Backspace variants (0.058125ms)
✔ should match xterm modifyOtherKeys Escape (0.04175ms)
✔ should match xterm modifyOtherKeys Space variants (0.048209ms)
✔ should match xterm modifyOtherKeys symbol combos (0.038667ms)
✔ should match xterm modifyOtherKeys digit combos (0.0545ms)
✔ modifyOtherKeys matching (0.842459ms)
▶ Legacy key matching
✔ should match legacy Ctrl+c (1.635584ms)
✔ should match legacy Ctrl+d (0.064291ms)
✔ should match escape key (0.034417ms)
✔ should match legacy linefeed as enter (0.044584ms)
✔ should treat linefeed as shift+enter when kitty active (0.085834ms)
✔ should parse ctrl+space (0.044291ms)
✔ should match legacy Ctrl+symbol (0.050167ms)
✔ should match legacy Ctrl+Alt+symbol (0.058167ms)
✔ should treat raw 0x08 as plain backspace outside Windows Terminal (0.09625ms)
✔ should treat raw 0x08 as ctrl+backspace in Windows Terminal (0.05425ms)
✔ should parse legacy alt-prefixed sequences when kitty inactive (0.117ms)
✔ should match arrow keys (0.044166ms)
✔ should match SS3 arrows and home/end (0.041917ms)
✔ should match legacy function keys and clear (0.033625ms)
✔ should match alt+arrows (0.030125ms)
✔ should match rxvt modifier sequences (0.049667ms)
✔ Legacy key matching (2.884667ms)
✔ matchesKey (7.144959ms)
▶ decodeKittyPrintable
✔ should decode Kitty keypad functional keys to printable characters (0.097542ms)
✔ decodeKittyPrintable (0.132709ms)
▶ parseKey
▶ Kitty protocol with alternate keys
✔ should return Latin key name when base layout key is present (0.067333ms)
✔ should prefer codepoint for Latin letters when base layout differs (0.043041ms)
✔ should prefer codepoint for symbol keys when base layout differs (0.039083ms)
✔ should return key name from codepoint when no base layout (0.03675ms)
✔ should ignore Kitty CSI-u with unsupported modifiers (0.041917ms)
✔ Kitty protocol with alternate keys (0.307584ms)
▶ Legacy key parsing
✔ should parse legacy Ctrl+letter (0.130459ms)
✔ should parse special keys (0.075875ms)
✔ should parse arrow keys (0.039667ms)
✔ should parse SS3 arrows and home/end (0.038042ms)
✔ should parse legacy function and modifier sequences (0.053833ms)
✔ should parse double bracket pageUp (0.029291ms)
✔ Legacy key parsing (0.466375ms)
✔ parseKey (0.829875ms)
▶ Markdown component
▶ Nested lists
✔ should render simple nested list (10.14175ms)
✔ should render deeply nested list (0.418042ms)
✔ should render ordered nested list (0.640541ms)
✔ should render mixed ordered and unordered nested lists (0.278875ms)
✔ should maintain numbering when code blocks are not indented (LLM output) (2.4775ms)
✔ Nested lists (14.39875ms)
▶ Tables
✔ should render simple table (1.469125ms)
✔ should render row dividers between data rows (0.254959ms)
✔ should keep column width at least the longest word (0.587292ms)
✔ should render table with alignment (0.446375ms)
✔ should handle tables with varying column widths (0.5055ms)
✔ should wrap table cells when table exceeds available width (0.498458ms)
✔ should wrap long cell content to multiple lines (0.265541ms)
✔ should wrap long unbroken tokens inside table cells (not only at line start) (0.662459ms)
✔ should wrap styled inline code inside table cells without breaking borders (0.279667ms)
✔ should handle extremely narrow width gracefully (0.167166ms)
✔ should render table correctly when it fits naturally (0.159208ms)
✔ should respect paddingX when calculating table width (0.238792ms)
✔ should not add a trailing blank line when table is the last rendered block (0.14775ms)
✔ Tables (5.952791ms)
▶ Combined features
✔ should render lists and tables together (0.355209ms)
✔ Combined features (0.390667ms)
▶ Pre-styled text (thinking traces)
✔ should preserve gray italic styling after inline code (7.254292ms)
✔ should preserve gray italic styling after bold text (8.765166ms)
✔ should not leak styles into following lines when rendered in TUI (12.329083ms)
✔ Pre-styled text (thinking traces) (28.4685ms)
▶ Spacing after code blocks
✔ should have only one blank line between code block and following paragraph (0.228959ms)
✔ should normalize paragraph and code block spacing to one blank line (0.908209ms)
✔ should not add a trailing blank line when code block is the last rendered block (0.13275ms)
✔ Spacing after code blocks (1.330167ms)
▶ Spacing after dividers
✔ should have only one blank line between divider and following paragraph (0.186ms)
✔ should not add a trailing blank line when divider is the last rendered block (0.059583ms)
✔ Spacing after dividers (0.278541ms)
▶ Spacing after headings
✔ should have only one blank line between heading and following paragraph (0.149333ms)
✔ should not add a trailing blank line when heading is the last rendered block (0.064167ms)
✔ Spacing after headings (0.242709ms)
▶ Spacing after blockquotes
✔ should have only one blank line between blockquote and following paragraph (0.284291ms)
✔ should not add a trailing blank line when blockquote is the last rendered block (0.096292ms)
✔ Spacing after blockquotes (0.409292ms)
▶ Blockquotes with multiline content
✔ should apply consistent styling to all lines in lazy continuation blockquote (0.207042ms)
✔ should apply consistent styling to explicit multiline blockquote (0.111125ms)
✔ should render list content inside blockquotes (0.175417ms)
✔ should wrap long blockquote lines and add border to each wrapped line (0.21925ms)
✔ should properly indent wrapped blockquote lines with styling (0.162917ms)
✔ should render inline formatting inside blockquotes and reapply quote styling after (0.16175ms)
✔ Blockquotes with multiline content (1.115375ms)
▶ Heading with inline code
✔ should preserve heading styling after inline code (0.139792ms)
✔ should preserve heading styling after inline code for h1 (0.086375ms)
✔ should not leak h1 underline into padding when inline code is the last token (5.120792ms)
✔ should preserve heading styling after bold text (0.16275ms)
✔ Heading with inline code (5.59675ms)
▶ Links
✔ should not duplicate URL for autolinked emails (0.127166ms)
✔ should not duplicate URL for bare URLs (0.15725ms)
✔ should show URL for explicit markdown links with different text (0.203875ms)
✔ should show URL for explicit mailto links with different text (0.091333ms)
✔ Links (0.63525ms)
▶ HTML-like tags in text
✔ should render content with HTML-like tags as text (0.167083ms)
✔ should render HTML tags in code blocks correctly (0.0765ms)
✔ HTML-like tags in text (0.273083ms)
✔ Markdown component (59.600209ms)
▶ TUI overlay non-capturing
▶ focus management
✔ non-capturing overlay preserves focus on creation (8.821166ms)
✔ focus() transfers focus to the overlay (4.402958ms)
✔ unfocus() restores previous focus (1.811417ms)
✔ setHidden(false) on non-capturing overlay does not auto-focus (1.716083ms)
✔ hide() when overlay is not focused does not change focus (1.138041ms)
✔ hide() when focused restores focus correctly (0.816834ms)
✔ capturing overlay removed with non-capturing below restores focus to editor (0.910209ms)
✔ sub-overlay cleanup then hideOverlay restores focus and input to editor (2.653292ms)
✔ microtask-deferred sub-overlay pattern (showExtensionCustom simulation) restores focus (70.500917ms)
✔ handleInput redirection skips non-capturing overlays when focused overlay becomes invisible (1.889208ms)
✔ hideOverlay() does not reassign focus when topmost overlay is non-capturing (1.360541ms)
✔ multiple capturing and non-capturing overlays restore focus through removals (3.458833ms)
✔ capturing overlay unfocus() on topmost capturing overlay falls back to preFocus (1.387958ms)
✔ focus management (101.854791ms)
▶ no-op guards
✔ focus() on hidden overlay is a no-op (4.752958ms)
✔ focus() after hide() is a no-op (3.343083ms)
✔ unfocus() when overlay does not have focus is a no-op (2.204292ms)
✔ unfocus() with null preFocus clears focus and does not route input back to overlay (3.5405ms)
✔ no-op guards (14.068916ms)
▶ focus cycle prevention
✔ toggle focus between non-capturing overlays then unfocus returns to editor (4.383583ms)
✔ focus cycle prevention (4.47125ms)
▶ rendering order
✔ focus() on already-focused overlay bumps visual order (5.01225ms)
✔ default rendering order for overlapping overlays follows creation order (2.471667ms)
✔ focus() on lower overlay renders it on top (3.246625ms)
✔ focusing middle overlay places it on top while preserving others relative order (10.005875ms)
✔ capturing overlay hidden and shown again renders on top after unhide (6.548166ms)
✔ unfocus() does not change visual order until another overlay is focused (7.12825ms)
✔ rendering order (34.740209ms)
✔ TUI overlay non-capturing (155.516542ms)
▶ TUI overlay options
▶ width overflow protection
✔ should truncate overlay lines that exceed declared width (9.235292ms)
✔ should handle overlay with complex ANSI sequences without crashing (12.009458ms)
✔ should handle overlay composited on styled base content (2.183541ms)
✔ should handle wide characters at overlay boundary (14.965041ms)
✔ should handle overlay positioned at terminal edge (1.434375ms)
✔ should handle overlay on base content with OSC sequences (1.109625ms)
✔ width overflow protection (41.523625ms)
▶ width percentage
✔ should render overlay at percentage of terminal width (1.14825ms)
✔ should respect minWidth when widthPercent results in smaller width (13.329084ms)
✔ width percentage (14.638458ms)
▶ anchor positioning
✔ should position overlay at top-left (4.697958ms)
✔ should position overlay at bottom-right (3.8295ms)
✔ should position overlay at top-center (5.526708ms)
✔ anchor positioning (14.245167ms)
▶ margin
✔ should clamp negative margins to zero (5.116792ms)
✔ should respect margin as number (2.63925ms)
✔ should respect margin object (2.424333ms)
✔ margin (12.212167ms)
▶ offset
✔ should apply offsetX and offsetY from anchor position (1.650542ms)
✔ offset (1.736417ms)
▶ percentage positioning
✔ should position with rowPercent and colPercent (1.229541ms)
✔ rowPercent 0 should position at top (2.856ms)
✔ rowPercent 100 should position at bottom (1.141375ms)
✔ percentage positioning (5.34825ms)
▶ maxHeight
✔ should truncate overlay to maxHeight (5.02825ms)
✔ should truncate overlay to maxHeightPercent (3.988333ms)
✔ maxHeight (9.171334ms)
▶ absolute positioning
✔ row and col should override anchor (2.769292ms)
✔ absolute positioning (2.849208ms)
▶ stacked overlays
✔ should render multiple overlays with later ones on top (2.195458ms)
✔ should handle overlays at different positions without interference (2.61075ms)
✔ should properly hide overlays in stack order (1.968958ms)
✔ stacked overlays (6.923292ms)
✔ TUI overlay options (109.144708ms)
Terminal rows: 24
Content lines: 3
Overlay visible: true
▶ TUI overlay with short content
✔ should render overlay when content is shorter than terminal height (8.585584ms)
✔ TUI overlay with short content (9.149875ms)
▶ regional indicator width regression
✔ treats partial flag grapheme as full-width to avoid streaming render drift (17.212708ms)
✔ wraps intermediate partial-flag list line before overflow (0.277834ms)
✔ treats all regional-indicator singleton graphemes as width 2 (0.167708ms)
✔ keeps full flag pairs at width 2 (0.08175ms)
✔ keeps common streaming emoji intermediates at stable width (0.116916ms)
✔ regional indicator width regression (18.495334ms)
▶ SelectList
✔ normalizes multiline descriptions to single line (1.885708ms)
✔ keeps descriptions aligned when the primary text is truncated (0.8245ms)
✔ uses the configured minimum primary column width (0.084583ms)
✔ uses the configured maximum primary column width (0.137834ms)
✔ allows overriding primary truncation while preserving description alignment (0.132042ms)
✔ SelectList (3.644375ms)
▶ StdinBuffer
▶ Regular Characters
✔ should pass through regular characters immediately (1.573917ms)
✔ should pass through multiple regular characters (0.153875ms)
✔ should handle unicode characters (0.108ms)
✔ Regular Characters (2.257209ms)
▶ Complete Escape Sequences
✔ should pass through complete mouse SGR sequences (0.227459ms)
✔ should pass through complete arrow key sequences (0.120958ms)
✔ should pass through complete function key sequences (0.101791ms)
✔ should pass through meta key sequences (0.090584ms)
✔ should pass through SS3 sequences (0.076416ms)
✔ Complete Escape Sequences (0.775167ms)
▶ Partial Escape Sequences
✔ should buffer incomplete mouse SGR sequence (0.497667ms)
✔ should buffer incomplete CSI sequence (0.120458ms)
✔ should buffer split across many chunks (0.160584ms)
✔ should flush incomplete sequence after timeout (15.572959ms)
✔ Partial Escape Sequences (17.143541ms)
▶ Mixed Content
✔ should handle characters followed by escape sequence (0.127ms)
✔ should handle escape sequence followed by characters (0.055ms)
✔ should handle multiple complete sequences (0.048958ms)
✔ should handle partial sequence with preceding characters (0.071208ms)
✔ Mixed Content (0.374ms)
▶ Kitty Keyboard Protocol
✔ should handle Kitty CSI u press events (0.085416ms)
✔ should handle Kitty CSI u release events (0.049416ms)
✔ should handle batched Kitty press and release (0.05675ms)
✔ should handle multiple batched Kitty events (0.051458ms)
✔ should handle Kitty arrow keys with event type (0.042333ms)
✔ should handle Kitty functional keys with event type (0.054667ms)
✔ should handle plain characters mixed with Kitty sequences (0.041583ms)
✔ should handle Kitty sequence followed by plain characters (0.044833ms)
✔ should handle rapid typing simulation with Kitty protocol (0.06375ms)
✔ Kitty Keyboard Protocol (0.593167ms)
▶ Mouse Events
✔ should handle mouse press event (1.924375ms)
✔ should handle mouse release event (0.081959ms)
✔ should handle mouse move event (0.055542ms)
✔ should handle split mouse events (0.071916ms)
✔ should handle multiple mouse events (0.056209ms)
✔ should handle old-style mouse sequence (ESC[M + 3 bytes) (0.061625ms)
✔ should buffer incomplete old-style mouse sequence (0.058125ms)
✔ Mouse Events (2.400458ms)
▶ Edge Cases
✔ should handle empty input (0.087292ms)
✔ should handle lone escape character with timeout (16.584458ms)
✔ should handle lone escape character with explicit flush (0.145916ms)
✔ should handle buffer input (0.066209ms)
✔ should handle very long sequences (0.082333ms)
✔ Edge Cases (17.056334ms)
▶ Flush
✔ should flush incomplete sequences (0.0685ms)
✔ should return empty array if nothing to flush (0.041541ms)
✔ should emit flushed data via timeout (16.500875ms)
✔ Flush (16.838209ms)
▶ Clear
✔ should clear buffered content without emitting (0.354583ms)
✔ Clear (0.457792ms)
▶ Bracketed Paste
✔ should emit paste event for complete bracketed paste (2.462959ms)
✔ should handle paste arriving in chunks (0.101292ms)
✔ should handle paste with input before and after (0.088708ms)
✔ should handle paste with newlines (0.055125ms)
✔ should handle paste with unicode (0.055125ms)
✔ Bracketed Paste (2.871ms)
▶ Destroy
✔ should clear buffer on destroy (0.075416ms)
✔ should clear pending timeouts on destroy (15.879958ms)
✔ Destroy (16.045209ms)
✔ StdinBuffer (77.982333ms)
▶ isImageLine
▶ iTerm2 image protocol
✔ should detect iTerm2 image escape sequence at start of line (1.500958ms)
✔ should detect iTerm2 image escape sequence with text before it (0.167041ms)
✔ should detect iTerm2 image escape sequence in middle of long line (0.155625ms)
✔ should detect iTerm2 image escape sequence at end of line (0.137542ms)
✔ should detect minimal iTerm2 image escape sequence (0.189458ms)
✔ iTerm2 image protocol (3.370625ms)
▶ Kitty image protocol
✔ should detect Kitty image escape sequence at start of line (0.106375ms)
✔ should detect Kitty image escape sequence with text before it (0.064375ms)
✔ should detect Kitty image escape sequence with padding (2.697708ms)
✔ Kitty image protocol (3.007792ms)
▶ Bug regression tests
✔ should detect image sequences in very long lines (304k+ chars) (0.181ms)
✔ should detect image sequences when terminal doesn't support images (0.081084ms)
✔ should detect image sequences with ANSI codes before them (0.059375ms)
✔ should detect image sequences with ANSI codes after them (0.041416ms)
✔ Bug regression tests (0.449ms)
▶ Negative cases - lines without images
✔ should not detect images in plain text lines (0.082542ms)
✔ should not detect images in lines with only ANSI codes (0.03675ms)
✔ should not detect images in lines with cursor movement codes (0.04575ms)
✔ should not detect images in lines with partial iTerm2 sequences (4.01075ms)
✔ should not detect images in lines with partial Kitty sequences (0.084375ms)
✔ should not detect images in empty lines (0.04475ms)
✔ should not detect images in lines with newlines only (0.036583ms)
✔ Negative cases - lines without images (16.879292ms)
▶ Mixed content scenarios
✔ should detect images when line has both Kitty and iTerm2 sequences (0.054417ms)
✔ should detect image in line with multiple text and image segments (0.032041ms)
✔ should not falsely detect image in line with file path containing keywords (0.036958ms)
✔ Mixed content scenarios (5.490708ms)
✔ isImageLine (29.65125ms)
▶ truncateToWidth
✔ keeps output within width for very large unicode input (20.128125ms)
✔ preserves ANSI styling for kept text and resets before and after ellipsis (0.830792ms)
✔ handles malformed ANSI escape prefixes without hanging (0.243833ms)
✔ clips wide ellipsis safely and brackets it with resets (0.174292ms)
✔ returns the original text when it already fits even if ellipsis is too wide (0.0685ms)
✔ pads truncated output to requested width (0.075542ms)
✔ adds a trailing reset when truncating without an ellipsis (0.112667ms)
✔ keeps a contiguous prefix instead of skipping a wide grapheme and resuming later (0.063083ms)
✔ truncateToWidth (22.3405ms)
▶ visibleWidth
✔ counts tabs inline and skips ANSI inline (0.084584ms)
✔ visibleWidth (0.164125ms)
▶ TruncatedText component
✔ pads output lines to exactly match width (0.813208ms)
✔ pads output with vertical padding lines to width (0.0865ms)
✔ truncates long text and pads to width (0.873541ms)
✔ preserves ANSI codes in output and pads correctly (0.264125ms)
✔ truncates styled text and adds reset code before ellipsis (0.116542ms)
✔ handles text that fits exactly (0.071208ms)
✔ handles empty text (0.053708ms)
✔ stops at newline and only shows first line (0.062291ms)
✔ truncates first line even with newlines in text (0.096584ms)
✔ TruncatedText component (3.108041ms)
▶ TUI cell size responses
✔ forwards bare escape even when a cell size query was sent at startup (4.714333ms)
✔ consumes cell size responses and still forwards later user input (0.877542ms)
✔ TUI cell size responses (6.133667ms)
▶ TUI overlay compositing
✔ should not leak styles when a trailing reset sits beyond the last visible column (no overlay) (7.487583ms)
✔ should not leak styles when overlay slicing drops trailing SGR resets (3.916792ms)
✔ TUI overlay compositing (12.006208ms)
▶ TUI resize handling
✔ triggers full re-render when terminal height changes (8.91025ms)
✔ skips full re-render on height changes in Termux (8.285666ms)
✔ triggers full re-render when terminal width changes (4.11525ms)
✔ TUI resize handling (22.013416ms)
▶ TUI content shrinkage
✔ clears empty rows when content shrinks significantly (2.549458ms)
✔ handles shrink to single line (3.308583ms)
✔ handles shrink to empty (1.835708ms)
✔ TUI content shrinkage (7.894166ms)
▶ TUI differential rendering
✔ tracks cursor correctly when content shrinks with unchanged remaining lines (3.148375ms)
✔ renders correctly when only a middle line changes (spinner case) (7.014417ms)
✔ resets styles after each rendered line (0.839875ms)
✔ renders correctly when first line changes but rest stays same (3.057416ms)
✔ renders correctly when last line changes but rest stays same (2.887167ms)
✔ renders correctly when multiple non-adjacent lines change (1.772334ms)
✔ handles transition from content to empty and back to content (4.033708ms)
✔ full re-renders when deleted lines move the viewport upward (3.8235ms)
✔ appends after a shrink without another full redraw once the viewport is reset (4.159916ms)
✔ clears stale content when maxLinesRendered was inflated by a transient component (5.615959ms)
✔ TUI differential rendering (36.716709ms)
▶ wrapTextWithAnsi
▶ underline styling
✔ should not apply underline style before the styled text (1.828ms)
✔ should not have whitespace before underline reset code (0.145958ms)
✔ should not bleed underline to padding - each line should end with reset for underline only (0.235167ms)
✔ underline styling (2.5885ms)
▶ background color preservation
✔ should preserve background color across wrapped lines without full reset (0.170166ms)
✔ should reset underline but preserve background when wrapping underlined text inside background (0.186291ms)
✔ background color preservation (0.43125ms)
▶ basic wrapping
✔ should wrap plain text correctly (0.1225ms)
✔ should ignore OSC 133 semantic markers in visible width (0.069625ms)
✔ should ignore OSC sequences terminated with ST in visible width (0.077458ms)
✔ should treat isolated regional indicators as width 2 (13.837041ms)
✔ should truncate trailing whitespace that exceeds width (0.10975ms)
✔ should preserve color codes across wraps (0.173ms)
✔ basic wrapping (14.554209ms)
✔ wrapTextWithAnsi (17.885125ms)
ℹ tests 519
ℹ suites 100
ℹ pass 519
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 1422.703292
Restored auth.json
[Showing lines 245-1107 of 1107 (50.0KB limit). Full output: /var/folders/49/l4171l3n219_xwq30fmyzr8w0000gn/T/pi-bash-e2a2043da7af462e.log]
Command exited with code 1Inspecting test outputs
I’m trying to understand why there are no failing tests, but the script still exited with 1. I think I need to check the full output near the end because there might be a hidden failure due to truncation. It’s possible that the important part got cut off, and reading the temporary file's full output might help clarify things. Let’s see what that reveals!
Identifying failing tests
I need to summarize the failing tests and focus on the file, package, and cause. It looks like the rest passed, but the script exits with 1 because the workspace for AI has failed. I might want to look for the relevant code. The user wants to figure out the failing tests, so I'll mention that the z.ai model might have some compatibility issues with missing or renamed metadata. I could inspect the tests or model data for more insights.
>rg -n "zaiToolStream|tool_stream|glm-5|glm-4\.7" packages/aipackages/ai/src/models.generated.ts:1419: "zai.glm-4.7": {
packages/ai/src/models.generated.ts:1420: id: "zai.glm-4.7",
packages/ai/src/models.generated.ts:1436: "zai.glm-4.7-flash": {
packages/ai/src/models.generated.ts:1437: id: "zai.glm-4.7-flash",
packages/ai/src/models.generated.ts:1453: "zai.glm-5": {
packages/ai/src/models.generated.ts:1454: id: "zai.glm-5",
packages/ai/src/models.generated.ts:2615: "zai-glm-4.7": {
packages/ai/src/models.generated.ts:2616: id: "zai-glm-4.7",
packages/ai/src/models.generated.ts:6211: "glm-5": {
packages/ai/src/models.generated.ts:6212: id: "glm-5",
packages/ai/src/models.generated.ts:6570: "glm-5": {
packages/ai/src/models.generated.ts:6571: id: "glm-5",
packages/ai/src/models.generated.ts:10737: "z-ai/glm-4.7": {
packages/ai/src/models.generated.ts:10738: id: "z-ai/glm-4.7",
packages/ai/src/models.generated.ts:10754: "z-ai/glm-4.7-flash": {
packages/ai/src/models.generated.ts:10755: id: "z-ai/glm-4.7-flash",
packages/ai/src/models.generated.ts:10771: "z-ai/glm-5": {
packages/ai/src/models.generated.ts:10772: id: "z-ai/glm-5",
packages/ai/src/models.generated.ts:10788: "z-ai/glm-5-turbo": {
packages/ai/src/models.generated.ts:10789: id: "z-ai/glm-5-turbo",
packages/ai/src/models.generated.ts:13306: "zai/glm-4.7": {
packages/ai/src/models.generated.ts:13307: id: "zai/glm-4.7",
packages/ai/src/models.generated.ts:13323: "zai/glm-4.7-flash": {
packages/ai/src/models.generated.ts:13324: id: "zai/glm-4.7-flash",
packages/ai/src/models.generated.ts:13340: "zai/glm-4.7-flashx": {
packages/ai/src/models.generated.ts:13341: id: "zai/glm-4.7-flashx",
packages/ai/src/models.generated.ts:13357: "zai/glm-5": {
packages/ai/src/models.generated.ts:13358: id: "zai/glm-5",
packages/ai/src/models.generated.ts:13374: "zai/glm-5-turbo": {
packages/ai/src/models.generated.ts:13375: id: "zai/glm-5-turbo",
packages/ai/src/models.generated.ts:13911: "glm-4.7": {
packages/ai/src/models.generated.ts:13912: id: "glm-4.7",
packages/ai/src/models.generated.ts:13929: "glm-4.7-flash": {
packages/ai/src/models.generated.ts:13930: id: "glm-4.7-flash",
packages/ai/src/models.generated.ts:13947: "glm-4.7-flashx": {
packages/ai/src/models.generated.ts:13948: id: "glm-4.7-flashx",
packages/ai/src/models.generated.ts:13965: "glm-5": {
packages/ai/src/models.generated.ts:13966: id: "glm-5",
packages/ai/src/models.generated.ts:13983: "glm-5-turbo": {
packages/ai/src/models.generated.ts:13984: id: "glm-5-turbo",
packages/ai/src/types.ts:280: /** Whether z.ai supports top-level `tool_stream: true` for streaming tool call deltas. Default: false. */
packages/ai/src/types.ts:281: zaiToolStream?: boolean;
packages/ai/scripts/generate-models.ts:402: ...(!ZAI_TOOL_STREAM_UNSUPPORTED_MODELS.has(modelId) ? { zaiToolStream: true } : {}),
packages/ai/scripts/generate-models.ts:712: if (candidate.provider === "openrouter" && candidate.id === "z-ai/glm-5") {
packages/ai/test/openai-completions-tool-choice.test.ts:203: it("enables tool_stream for supported z.ai models with tools", async () => {
packages/ai/test/openai-completions-tool-choice.test.ts:204: const model = getModel("zai", "glm-5")!;
packages/ai/test/openai-completions-tool-choice.test.ts:236: const params = (payload ?? mockState.lastParams) as { tool_stream?: boolean };
packages/ai/test/openai-completions-tool-choice.test.ts:237: expect(params.tool_stream).toBe(true);
packages/ai/test/openai-completions-tool-choice.test.ts:240: it("stores z.ai tool_stream support in model compat metadata", () => {
packages/ai/test/openai-completions-tool-choice.test.ts:241: expect(getModel("zai", "glm-5")?.compat?.zaiToolStream).toBe(true);
packages/ai/test/openai-completions-tool-choice.test.ts:242: expect(getModel("zai", "glm-4.7")?.compat?.zaiToolStream).toBe(true);
packages/ai/test/openai-completions-tool-choice.test.ts:243: expect(getModel("zai", "glm-4.7-flash")?.compat?.zaiToolStream).toBe(true);
packages/ai/test/openai-completions-tool-choice.test.ts:244: expect(getModel("zai", "glm-4.6v")?.compat?.zaiToolStream).toBe(true);
packages/ai/test/openai-completions-tool-choice.test.ts:245: expect(getModel("zai", "glm-4.5-air")?.compat?.zaiToolStream).toBeUndefined();
packages/ai/test/openai-completions-tool-choice.test.ts:248: it("omits tool_stream for unsupported z.ai models", async () => {
packages/ai/test/openai-completions-tool-choice.test.ts:281: const params = (payload ?? mockState.lastParams) as { tool_stream?: boolean };
packages/ai/test/openai-completions-tool-choice.test.ts:282: expect(params.tool_stream).toBeUndefined();
packages/ai/test/openai-completions-tool-choice.test.ts:285: it("respects explicit z.ai tool_stream compat override", async () => {
packages/ai/test/openai-completions-tool-choice.test.ts:291: zaiToolStream: true,
packages/ai/test/openai-completions-tool-choice.test.ts:325: const params = (payload ?? mockState.lastParams) as { tool_stream?: boolean };
packages/ai/test/openai-completions-tool-choice.test.ts:326: expect(params.tool_stream).toBe(true);
packages/ai/test/openai-completions-tool-choice.test.ts:329: it("omits tool_stream when no tools are provided", async () => {
packages/ai/test/openai-completions-tool-choice.test.ts:330: const model = getModel("zai", "glm-5")!;
packages/ai/test/openai-completions-tool-choice.test.ts:352: const params = (payload ?? mockState.lastParams) as { tool_stream?: boolean };
packages/ai/test/openai-completions-tool-choice.test.ts:353: expect(params.tool_stream).toBeUndefined();
packages/ai/test/openai-completions-tool-choice.test.ts:372: const model = getModel("zai", "glm-5")!;
packages/ai/src/providers/openai-completions.ts:398: if (compat.zaiToolStream) {
packages/ai/src/providers/openai-completions.ts:399: (params as any).tool_stream = true;
packages/ai/src/providers/openai-completions.ts:841: zaiToolStream: false,
packages/ai/src/providers/openai-completions.ts:868: zaiToolStream: model.compat.zaiToolStream ?? detected.zaiToolStream,
packages/ai/test/openai-completions-tool-result-images.test.ts:35: zaiToolStream: false,
packages/ai/test/stream.test.ts:725: describe.skipIf(!process.env.ZAI_API_KEY)("zAI Provider (glm-5 via OpenAI Completions)", () => {
packages/ai/test/stream.test.ts:726: const llm = getModel("zai", "glm-5");
packages/ai/test/cross-provider-handoff.test.ts:86: { provider: "cerebras", model: "zai-glm-4.7", label: "cerebras-zai-glm-4.7" },
packages/ai/test/cross-provider-handoff.test.ts:101: { provider: "opencode", model: "glm-4.7-free", label: "zen-glm-4.7-free" },Inspecting models for compatibility
I think I need to inspect the generated models to check for compatibility. It sounds like I might want to focus on reading specific relevant lines to help with that. I’m curious about what I might find there that could indicate potential issues or successes in compatibility. I'll take my time to ensure I’m thorough since this seems important.
Evaluating model generation issue
I need to mention a specific likely cause for the problem: it seems that the generated models lack compat.zaiToolStream. I could point out that the script for generate-models includes it, but the generated file doesn't, which could mean the generated file is stale or there's a logic mismatch. I should inspect the situation around glm-4.7 for further clarification. I'll keep considering these details as I go!
Checking implementation details
I think I need to check the implementation around line 398 to make sure everything’s working smoothly. If it's marked as "compat false" and "undefined," it might be alright since the explicit override in tests is passing. It seems like the issue is just with the metadata. I could mention the location too, but it might just be enough to keep it concise and avoid using an em dash. Let's finalize this!
./test.sh fails because packages/ai has 2 failing tests. Everything else passed.
Failing tests
packages/ai/test/openai-completions-tool-choice.test.ts:203
enables tool_stream for supported z.ai models with toolsparams.tool_stream === trueundefinedpackages/ai/test/openai-completions-tool-choice.test.ts:240
stores z.ai tool_stream support in model compat metadatagetModel("zai", "glm-5")?.compat?.zaiToolStream === trueundefinedWhat this points to
compat.zaiToolStream for supported models.packages/ai/src/providers/openai-completions.ts:398.packages/ai/src/models.generated.ts:13911 (glm-4.7)packages/ai/src/models.generated.ts:13929 (glm-4.7-flash)packages/ai/src/models.generated.ts:13965 (glm-5)compat: {"supportsDeveloperRole":false,"thinkingFormat":"zai"}zaiToolStream:trueLikely root cause
packages/ai/scripts/generate-models.ts:402 has logic to add zaiToolStream: true, but packages/ai/src/models.generated.ts looks stale or the generation path is not applying it for these models.High level result
1 failed | 24 passed | 19 skipped in packages/aitest.sh exits with code 1 because of that workspace failureIf you want, I can trace why the generated models missed zaiToolStream and fix it.