mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
After context compression (manual /compress or auto), run_agent's _compress_context ends the current session and creates a new continuation child session, mutating agent.session_id. The classic CLI held its own self.session_id that never resynced, so /status showed the ended parent, the exit-summary --resume hint pointed at a closed row, and any later end_session() call (from /resume <other> or /branch) targeted the wrong row AND overwrote the parent's 'compression' end_reason. This only affected the classic prompt_toolkit CLI. The gateway path was already fixed in PR #1160 (March 2026); --tui and ACP use different session plumbing and were unaffected. Changes: - cli.py::_manual_compress — sync self.session_id from self.agent.session_id after _compress_context, clear _pending_title - cli.py chat loop — same sync post-run_conversation for auto-compression - cli.py hermes -q single-query mode — same sync so stderr session_id output points at the continuation - hermes_state.py::end_session — guard UPDATE with 'ended_at IS NULL' so the first end_reason wins; reopen_session() remains the explicit escape hatch for re-ending a closed row Tests: - 3 new in tests/cli/test_manual_compress.py (split sync, no-op guard, pending_title behavior) - 2 new in tests/test_hermes_state.py (preserve compression end_reason on double-end; reopen-then-re-end still works) Closes #12483. Credits @steve5636 for the same-day bug report and @dieutx for PR #3529 which proposed the CLI sync approach. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_branch_command.py | ||
| test_cli_approval_ui.py | ||
| test_cli_background_tui_refresh.py | ||
| test_cli_browser_connect.py | ||
| test_cli_context_warning.py | ||
| test_cli_copy_command.py | ||
| test_cli_extension_hooks.py | ||
| test_cli_file_drop.py | ||
| test_cli_image_command.py | ||
| test_cli_init.py | ||
| test_cli_interrupt_subagent.py | ||
| test_cli_loading_indicator.py | ||
| test_cli_mcp_config_watch.py | ||
| test_cli_new_session.py | ||
| test_cli_plan_command.py | ||
| test_cli_prefix_matching.py | ||
| test_cli_preloaded_skills.py | ||
| test_cli_provider_resolution.py | ||
| test_cli_retry.py | ||
| test_cli_save_config_value.py | ||
| test_cli_secret_capture.py | ||
| test_cli_skin_integration.py | ||
| test_cli_status_bar.py | ||
| test_cli_status_command.py | ||
| test_cli_tools_command.py | ||
| test_compress_focus.py | ||
| test_cwd_env_respect.py | ||
| test_fast_command.py | ||
| test_gquota_command.py | ||
| test_manual_compress.py | ||
| test_personality_none.py | ||
| test_quick_commands.py | ||
| test_reasoning_command.py | ||
| test_resume_display.py | ||
| test_session_boundary_hooks.py | ||
| test_stream_delta_think_tag.py | ||
| test_surrogate_sanitization.py | ||
| test_tool_progress_scrollback.py | ||
| test_worktree.py | ||
| test_worktree_security.py | ||