mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-05 02:31:47 +00:00
After a conversation gets compressed, run_agent's _compress_context ends the parent session and creates a continuation child with the same logical conversation. Every list affordance in the codebase (list_sessions_rich with its default include_children=False, plus the CLI/TUI/gateway/ACP surfaces on top of it) hid those children, and resume-by-ID on the old root landed on a dead parent with no messages. Fix: lineage-aware projection on the read path. - hermes_state.py::get_compression_tip(session_id) — walk the chain forward using parent.end_reason='compression' AND child.started_at >= parent.ended_at. The timing guard separates compression continuations from delegate subagents (which were created while the parent was still live) without needing a schema migration. - hermes_state.py::list_sessions_rich — new project_compression_tips flag (default True). For each compressed root in the result, replace surfaced fields (id, ended_at, end_reason, message_count, tool_call_count, title, last_active, preview, model, system_prompt) with the tip's values. Preserve the root's started_at so chronological ordering stays stable. Projected rows carry _lineage_root_id for downstream consumers. Pass False to get raw roots (admin/debug). - hermes_cli/main.py::_resolve_session_by_name_or_id — project forward after ID/title resolution, so users who remember an old root ID (from notes, or from exit summaries produced before the sibling Bug 1 fix) land on the live tip. All downstream callers of list_sessions_rich benefit automatically: - cli.py _list_recent_sessions (/resume, show_history affordance) - hermes_cli/main.py sessions list / sessions browse - tui_gateway session.list picker - gateway/run.py /resume titled session listing - tools/session_search_tool.py - acp_adapter/session.py Tests: 7 new in TestCompressionChainProjection covering full-chain walks, delegate-child exclusion, tip surfacing with lineage tracking, raw-root mode, chronological ordering, and broken-chain graceful fallback. Verified live: ran a real _compress_context on a live Gemini-backed session, confirmed the DB split, then verified - db.list_sessions_rich surfaces tip with _lineage_root_id set - hermes sessions list shows the tip, not the ended parent - _resolve_session_by_name_or_id(old_root_id) -> tip_id - _resolve_last_session -> tip_id Addresses #10373. |
||
|---|---|---|
| .. | ||
| acp | ||
| agent | ||
| cli | ||
| cron | ||
| e2e | ||
| environments/benchmarks | ||
| fakes | ||
| gateway | ||
| hermes_cli | ||
| honcho_plugin | ||
| integration | ||
| plugins | ||
| run_agent | ||
| skills | ||
| tools | ||
| tui_gateway | ||
| __init__.py | ||
| conftest.py | ||
| run_interrupt_test.py | ||
| test_batch_runner_checkpoint.py | ||
| test_cli_file_drop.py | ||
| test_cli_skin_integration.py | ||
| test_ctx_halving_fix.py | ||
| test_empty_model_fallback.py | ||
| test_evidence_store.py | ||
| test_hermes_constants.py | ||
| test_hermes_logging.py | ||
| test_hermes_state.py | ||
| test_honcho_client_config.py | ||
| test_ipv4_preference.py | ||
| test_mcp_serve.py | ||
| test_mini_swe_runner.py | ||
| test_minimax_model_validation.py | ||
| test_minisweagent_path.py | ||
| test_model_picker_scroll.py | ||
| test_model_tools.py | ||
| test_model_tools_async_bridge.py | ||
| test_ollama_num_ctx.py | ||
| test_packaging_metadata.py | ||
| test_plugin_skills.py | ||
| test_project_metadata.py | ||
| test_retry_utils.py | ||
| test_sql_injection.py | ||
| test_subprocess_home_isolation.py | ||
| test_timezone.py | ||
| test_toolset_distributions.py | ||
| test_toolsets.py | ||
| test_trajectory_compressor.py | ||
| test_trajectory_compressor_async.py | ||
| test_tui_gateway_server.py | ||
| test_utils_truthy_values.py | ||