Skip to content

fix(tui): 21 remaining Build & Test failures from TUI refactors #135

Open

Description

@KooshaPari

Background

The CI Build & Test check on master has been failing with 25 unit-test
failures in jcode-tui. Of those 25:

Categories

A. fork_command session splitting (3 tests)

tui::app::tests::test_btw_command_forks_session_with_question
tui::app::tests::test_fork_command_with_prompt_forks_session
tui::app::tests::test_fork_command_without_prompt_forks_idle_session

The tests assert the fork commands emit a session-split hint. The
implementation no longer appends the /resume <new-id> hint. Either
the implementation needs to emit the hint, or the tests need to be
updated to reflect the current behavior. Recommend: implementation
fix
because the tests are recent (post-TUI-refactor).

B. session_picker preview/scroll rendering (8 tests)

tui::session_picker::tests::preview_render_cache_is_reused_across_scroll_and_rebuilt_on_selection_change
tui::session_picker::tests::preview_visible_slice_matches_scroll_position
tui::session_picker::tests::preview_without_search_has_no_highlight_and_scrolls_to_bottom
tui::session_picker::tests::search_highlights_match_in_preview_and_scrolls_to_it
tui::session_picker::tests::test_preview_pane_shows_scrollbar_when_overflowing
tui::session_picker::tests::test_preview_sticky_prompt_header_appears_after_scrolling
tui::session_picker::tests::test_preview_sticky_prompt_header_survives_async_preview_load
tui::session_picker::tests::test_session_list_shows_scrollbar_when_overflowing

The session_picker preview pane and session list lost scrollbar and
sticky-prompt rendering after the recent TUI refactor. Likely root
cause: scrollbar widget or sticky-header logic not applied to the
new layout. Could be one root cause or several.

C. terminal_mode ANSI drift (3 tests)

tui::terminal_mode_tests::focus_reapply_preserves_other_modes_without_rearming_focus_reporting
tui::terminal_mode_tests::outside_tmux_keyboard_lifecycle_keeps_kitty_protocol_only
tui::terminal_mode_tests::tmux_keyboard_lifecycle_requests_and_resets_extended_keys

The actual byte sequence is ESC[>1u (protocol push flag 1, the
basic kitty keyboard CSI u). The tests expect ESC[>7u (flag 7,
which adds reporting-all-keys-as-escape-codes to the push).

Note the enable_keyboard_enhancement() doc comment deliberately
excludes REPORT_ALL_KEYS_AS_ESCAPE_CODES ("Avoids REPORT_ALL_KEYS_AS_ESCAPE_CODES:
with it, kitty/Alacritty/Warp report printable keys as base key plus
modifiers instead of the text the active layout produces"). So either:

  1. The doc comment is right and the tests are wrong (tests were
    updated prematurely for a planned behavior change that never landed)
  2. The doc comment is stale and the tests reflect the intended
    final behavior

Recommend: implementation fix if enable_keyboard_enhancement()
needs to also enable REPORT_EVENT_TYPES and REPORT_ALTERNATE_KEYS to
match the test expectations — but verify the herdr/conpty panes story
first.

D. overscroll_line rendering (3 tests)

tui::ui::tests::swarm_buffer::overscroll_line_compacts_before_dropping_and_always_keeps_dir_model_context
tui::ui::tests::swarm_buffer::overscroll_line_orders_dir_git_context_then_model_on_the_right
tui::ui::tests::swarm_buffer::overscroll_model_is_pink

The overscroll_line in the swarm buffer UI doesn't render the expected
dir-git-context + model-on-the-right layout, and the model column
isn't pink. Likely a single regression in the overscroll layout code.

E. Visual regressions (3 tests)

tui::app::tests::status_line_is_always_pinned_with_pink_model_on_real_app
tui::app::tests::test_handle_remote_disconnect_flushes_streaming_text_and_sets_reconnect_state
tui::ui::messages::tests::render_system_message_uses_connection_card_for_reconnect_status
  • status_line_is_always_pinned_with_pink_model_on_real_app — the
    pink model indicator is missing from the real-app status line.
  • test_handle_remote_disconnect_* — the disconnect handler no
    longer flushes streaming text or sets reconnect state.
  • render_system_message_uses_connection_card_for_reconnect_status —
    the assertion plain.contains(\"kcode --resume koala\") fails,
    suggesting the reconnect card doesn't reference the resumed session.

F. kitty notification identifier leftover (1 test — overlapping with #131)

tui::app::turn_notify::tests::kitty_notification_is_one_completed_clickable_message

Covered by #132 (decollision leftovers). Will clear once #132 merges.

Next steps

Each category is a candidate for a focused PR. The smallest first
target is probably A (3 tests, single command-emit fix) or F as
an immediate CI improvement via #132. D is also small (single
overscroll layout fix). The bigger buckets are B and C.

Status

Reference

Build & Test (ubuntu-latest) failure log:
https://github.com/KooshaPari/KCode/actions/runs/39213427119/job/117931722514
(2489 passed; 25 failed)

Activity

  1. added
    kilo-triaged
    kilo-duplicate
    on Oct 19, 2026
  2. kilo-code-bot commented on Oct 19, 2026

    @kilo-code-bot

    This issue appears to be a duplicate of #131.

    fix(tui): 3 leftover kcode/jcode decollision test mismatches in helpers + turn_notify (#131)

    Similarity score: 90%

    This comment was generated by Kilo Auto-Triage.

  3. KooshaPari commented on Oct 21, 2026

    @KooshaPari
    OwnerAuthor

    Status re-check against current master (2aea04dd8) — 2026-10-20

    This issue was written against an older master. Verifying each of the 21 against current master:

    cargo test -p jcode-tui --lib <name> on master @ 2aea04dd8:

    Already fixed upstream (18/21) — no action needed

    B (8/8) session_picker — all 8 pass. The compact-layout gate is session_picker.rs:2200 (height < 20); the tests now use h = 24 (session_picker_tests.rs:1982-83, 2038-39, 2102-03, 2166-67, 2533-34), i.e. non-compact.

    C (3/3) terminal_mode — all 3 pass. tui/mod.rs:272-292 now asserts \\x1b[>1u / \\x1b[=1u, and keyboard_enhancement_flags() returns DISAMBIGUATE_ESCAPE_CODES only. #124 additionally added tui/keyboard_protocol.rs for the Windows/native-console path, which the plain [>1u expectations alone would not have covered.

    D (3/3) overscroll — all 3 pass. Production ui.rs:3042 gates the compact status bar on chat_area.width >= 80; the layout places overscroll (chunks[8]) immediately above it, so the overscroll row is height-2 at width >= 80 and height-1 below that. overscroll_model_is_pink uses TestBackend::new(200, 18), so unguarded height-2 is correct there.

    E (3/3) visual — all 3 pass. commands_review.rs:768 emits kcode --resume {}; remote/reconnect.rs:117 emits ⚡ Connection lost - retrying.

    F (1/1) — passes.

    Still failing (3/21) — category A

    tui::app::tests::test_btw_command_forks_session_with_question
    tui::app::tests::test_fork_command_with_prompt_forks_session
    tui::app::tests::test_fork_command_without_prompt_forks_idle_session
    
    assertion `left == right` failed
      left: "error"
     right: "system"
    at crates/jcode-tui/src/tui/app/tests/commands_accounts_01/part_01.rs:1206
    

    fork_session_with_prompt_local (commands.rs:1357) calls launch_forked_session_local; on Err it pushes DisplayMessage::error("Failed to fork session: {}"), but the tests expect the system message carrying kcode --resume <id>. So the fork path is erroring before it reaches the hint, and the missing hint is a symptom, not the cause.

    Per the Recommend: implementation fix note above, these need an implementation fix — but they need a decision first: why launch_forked_session_local is returning Err under KCODE_HOME pointed at a tempdir. The Err payload is not currently asserted anywhere, so the next step is to surface it.

    Note on a stale duplicate branch

    Branch fix/tui-refactor-regressions (0f4afc872) exists from earlier work on this issue. It is based on b9886143c, predates #124/#134, and must not be merged — merging it would delete tui/keyboard_protocol.rs and revert #124's Windows keyboard work. It is also not fmt-clean (stale kv_cache_problem re-export block). All of its content is already on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kilo-duplicatekilo-triaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions