hermes-agent/tests/cli
Teknium 2ae96939f5 fix(cli): self-heal cooked-mode termios drift that freezes CLI input
When a prompt_toolkit run_in_terminal cooked->raw restore is lost (cancelled
coroutine, racing chained cross-thread windows from background-review
summaries / process-notification prints), the tty stays in cooked mode while
the Application still expects raw. The kernel line-buffers keystrokes and the
CLI appears to stop taking input even though the event loop is healthy.

Observed live 2026-08-13: interactive session left in 'icanon echo' after a
background skill-review fork + notify_on_complete turn; only an external
stty rescue restored input.

Fix: _heal_cooked_mode_drift() re-applies prompt_toolkit's own raw-mode flag
surgery when stdin's lflag has drifted cooked, and process_loop's idle branch
runs a rate-limited _check_termios_drift() watchdog that skips legitimate
cooked windows (app._running_in_terminal), agent-running phases, non-tty
stdin, and Windows.
2026-08-13 14:22:14 -07:00
..
__init__.py
conftest.py
test_bang_shell_mode.py feat(cli): ! shell mode — run a command without spending a model turn 2026-07-31 21:21:20 -07:00
test_bracketed_paste_timeout.py
test_branch_command.py fix(state,cli,tui-gateway): keep reasoning fields intact across forks and branches 2026-08-08 17:37:26 -07:00
test_busy_input_mode_command.py
test_chat_q_exit_clear.py
test_cli_active_agent_ref_wiring.py
test_cli_approval_ui.py
test_cli_async_delegation_delivery.py
test_cli_background_busy_path.py fix(cli): dispatch /background inline instead of queuing it behind the turn 2026-07-31 22:35:12 -07:00
test_cli_background_status_indicator.py
test_cli_background_tui_refresh.py
test_cli_bracketed_paste_sanitizer.py
test_cli_browser_connect.py
test_cli_cmd_backspace.py
test_cli_codex_context_reference.py
test_cli_context_warning.py
test_cli_copy_command.py
test_cli_delegate_background_notice.py
test_cli_extension_hooks.py
test_cli_external_editor.py
test_cli_file_drop.py test: run os-specific tests on their real host, not a faked one 2026-08-09 22:09:49 -04:00
test_cli_first_run_setup.py fix(cli): route keyless first run into provider onboarding instead of a broken chat 2026-08-01 15:34:16 -07:00
test_cli_force_redraw.py
test_cli_goal_interrupt.py
test_cli_image_command.py
test_cli_init.py test: run os-specific tests on their real host, not a faked one 2026-08-09 22:09:49 -04:00
test_cli_insights_command.py
test_cli_interrupt_ack_race.py
test_cli_interrupt_drain_regression.py
test_cli_interrupt_subagent.py
test_cli_light_mode.py fix(cli): fence OSC 11 background query with DA1 so late replies can't leak into the prompt 2026-08-08 19:22:53 -07:00
test_cli_loading_indicator.py
test_cli_markdown_rendering.py
test_cli_mcp_config_watch.py
test_cli_new_session.py
test_cli_pet_pane.py
test_cli_prefix_matching.py
test_cli_preloaded_skills.py perf(cli): sub-400ms warm startup — probe-mode check_fns, lazy MCP SDK, banner snapshot, parallel worktree add 2026-08-10 10:40:19 -07:00
test_cli_provider_resolution.py
test_cli_queue_paste.py
test_cli_reload_skills.py
test_cli_resume_command.py
test_cli_retry.py
test_cli_save_config_value.py
test_cli_secret_capture.py
test_cli_shift_enter_newline.py
test_cli_shutdown_memory_messages.py
test_cli_skin_integration.py
test_cli_status_bar.py feat(cli): show session titles in status bars 2026-08-08 17:02:55 -07:00
test_cli_status_bar_goal.py
test_cli_status_command.py
test_cli_steer_busy_path.py
test_cli_terminal_response_sanitizer.py
test_cli_terminal_shortcuts.py
test_cli_tools_command.py
test_cli_user_message_preview.py
test_cli_yolo_resume_persistence.py fix(cli): persist YOLO mode across --resume 2026-08-02 20:30:06 -07:00
test_cli_yolo_toggle.py
test_compress_flags.py
test_compress_focus.py
test_compress_here.py
test_compress_type_ahead.py
test_cpr_local_leak.py test: run os-specific tests on their real host, not a faked one 2026-08-09 22:09:49 -04:00
test_cprint_bg_thread.py
test_ctrl_enter_newline.py test: run os-specific tests on their real host, not a faked one 2026-08-09 22:09:49 -04:00
test_cwd_env_respect.py
test_destructive_slash_confirm.py
test_destructive_slash_inline_skip_e2e.py
test_exit_delete_session.py
test_exit_summary_resume_hint.py
test_exit_watchdog_signal_arm.py
test_fast_command.py fix(xai): preserve Grok 4.6 wire capabilities 2026-08-13 11:07:37 -07:00
test_focus_view.py
test_indicator_command.py fix(cli): dispatch /indicator to set the busy-indicator style (#50618) 2026-07-31 22:33:16 -07:00
test_manual_compress.py
test_moa_command.py
test_partial_compress.py
test_personality_none.py fix(personality): single-owner personality state + one-time reset migration 2026-08-09 10:33:58 -07:00
test_prefill_config.py
test_prepend_note_to_message.py
test_prompt_stash.py
test_prompt_stash_cli.py test(stash): drop source-text keybinding assertions (banned antipattern) 2026-07-31 21:21:16 -07:00
test_prompt_text_input_thread_safety.py
test_quick_commands.py
test_reasoning_command.py
test_resume_display.py fix(sessions): stabilize legacy reset lineage on resume 2026-08-13 23:45:21 +05:30
test_resume_model_restore.py fix: delete stale top-level route keys on /model persist 2026-08-14 02:15:22 +05:30
test_resume_quiet_stderr.py
test_save_conversation_location.py
test_session_boundary_hooks.py
test_single_query_session_finalize.py
test_slash_command_interrupt.py
test_slash_confirm_windows.py test: convert the last host-OS fakes and guard double markers 2026-08-09 22:09:49 -04:00
test_steer_inline_repaint_34569.py
test_stream_delta_think_tag.py
test_stream_flush_left.py
test_stream_partial_line_flush.py
test_surrogate_sanitization.py
test_terminal_interrupt_recovery.py
test_termios_drift_heal.py fix(cli): self-heal cooked-mode termios drift that freezes CLI input 2026-08-13 14:22:14 -07:00
test_tool_progress_scrollback.py
test_transformed_stream_output.py fix: handle replacement transforms after CLI streaming 2026-08-08 14:06:30 +05:30
test_tui_terminal_reset_on_exit.py
test_update_command.py
test_version_command.py
test_worktree.py
test_worktree_security.py
test_worktree_sync_base.py