Files
hermes-agent/tests/agent
teknium1 76cfc7b257 test: restore state.db / SessionDB regression guards dropped by #120071
Restored (each proven red against a sabotaged production path, green on main):

- tests/agent/test_overflow_overhead_aware_tokens.py::
  test_overflow_recovery_compresses_with_tool_overhead_counted[413,
  context_overflow, prompt_too_long, long_context_tier_429]
  Rewritten from the four estimator-to-compressor tests: the real estimator
  runs with a ~10k-token tool schema and the compressor must receive an
  approx_tokens that counts it (LCM issue 441). No helper-name pinning.
- tests/hermes_cli/test_web_server_sessiondb_eventloop.py::
  test_bulk_delete_sessiondb_work_runs_off_event_loop,
  test_session_read_handlers_run_sessiondb_work_off_event_loop[search,stats,detail]
  Real route handlers; every SessionDB open/call lands off the event-loop
  thread (#60747). AST/source tests stay deleted.
- tests/hermes_state/test_hermes_state.py::TestCompressionChainProjection::
  test_list_batches_tip_row_fetch_into_one_query
  list_sessions_rich resolves a page of compression tips in one batched
  query, not one per root (N+1 guard).
- tests/hermes_state/test_tail_rewind_semantics.py::TestCompressTagsCarriedTail::
  test_compress_marks_carried_forward_tail_dicts
  Repaired from a skip-on-exception body that asserted nothing: compress()
  tags exactly the verbatim carried tail so archive_and_compact gets an
  accurate tail_count (#86366).
- tests/hermes_state/test_wal_checkpoint_strategy.py::
  test_failed_checkpoint_never_raises_and_is_not_silent,
  test_failed_checkpoint_at_close_still_releases_the_handle
  Periodic PASSIVE checkpoint failure neither raises into the write path nor
  passes silently; a failing checkpoint at close() still releases the
  handle (#45383 strategy). Log-wording asserts dropped.
- tests/hermes_state/test_hermes_state_ux_messages.py::
  test_db_unavailable_details_line_carries_raw_cause_only_below_the_lead,
  test_db_unavailable_network_drive_cause_does_not_offer_doctor_fix
  CLI details=True keeps the raw SQLite cause on its own Details line only;
  a locking-protocol (network FS) cause never offers `doctor --fix`.
- tests/tools/test_code_execution.py::TestStubSchemaDrift::
  test_generated_module_accepts_all_params
  Replaces the syntax-only test_generated_module_compiles: executes the
  generated hermes_tools module (uds and file transports) and asserts every
  stub accepts all its params as kwargs and forwards each by name and value.
2026-09-23 10:34:54 -07:00
..