hermes-agent/tests/agent
Kshitij Kapoor f556edc10d fix(model_metadata): address Phase-2 review findings on probe caches
Structured review (2a/2b/2c) findings, all fixed:

- MAJOR: detect_local_server_type memo was process-lifetime with no
  invalidation, permanently pinning a URL's server type. Now a bounded
  1h TTL ((type, monotonic) tuples) so a backend swap on the same port
  is re-detected. Test covers ollama->lm-studio swap after expiry.

- MAJOR: legacy disk-row compat was one-way. get_cached_context_length
  and _invalidate_cached_context_length now consult the same key-shape
  set {canonical, literal, canonical+slash} in both directions, so an
  old slashed row is found (and cleared) when the runtime passes the
  normalized URL. Tests pin both migration directions.

- MINOR: _localhost_to_ipv4 did whole-string replacement, which could
  corrupt a proxy URL embedding http://localhost in its query. Now a
  scheme-anchored host-only regex; localhost.example.com and embedded
  substrings pass through. Tests added.

- MINOR: _invalidate_cached_context_length now also drops the
  in-memory TTL probe rows for the pair, so a resolution inside the
  TTL window can't re-persist the value just declared stale.

- Test gaps closed: detect-type cache hit + TTL-expiry re-detection,
  ollama-show TTL expiry re-probe, reverse legacy-row lookups.

- Attribution gate: added zhchl@hermes-agent.local -> 8294 (PR #50572
  author) to AUTHOR_MAP; the strict CI grep needs bare non-plus emails
  literal in release.py.

Gates: ruff clean; targeted suites 202 passed / 0 failed; full
tests/agent 5426 passed with 17 failures identical on clean
upstream/main (pre-existing env-dependent anthropic/bedrock/credpool
tests); mypy delta vs base: 0 new errors; live smoke 6/6 PASS.
2026-07-09 14:08:44 +05:30
..
lsp
transports
__init__.py
test_account_usage.py
test_anthropic_adapter.py
test_anthropic_billing_guidance.py
test_anthropic_keychain.py
test_anthropic_kwargs_sanitize.py
test_anthropic_mcp_prefix_strip.py
test_anthropic_oauth_pkce.py
test_anthropic_oauth_ua_prefix.py
test_anthropic_output_field_leak.py
test_anthropic_thinking_block_order.py
test_arcee_trinity_overrides.py
test_async_utils.py
test_auxiliary_anthropic_pool_fallback_regression.py
test_auxiliary_client.py
test_auxiliary_client_anthropic_custom.py
test_auxiliary_client_azure_foundry.py
test_auxiliary_client_base_url_host_validation_52608.py
test_auxiliary_client_proxy_env.py
test_auxiliary_client_resolve_dedup.py
test_auxiliary_client_ssl_verify.py
test_auxiliary_client_xai_oauth_recovery.py
test_auxiliary_compression_timeout_floor.py
test_auxiliary_config_bridge.py
test_auxiliary_main_first.py
test_auxiliary_named_custom_providers.py
test_auxiliary_transient_retry.py
test_auxiliary_transport_autodetect.py
test_auxiliary_user_default_headers.py
test_azure_identity_adapter.py
test_bedrock_1m_context.py
test_bedrock_adapter.py
test_bedrock_integration.py fix: normalize string stop + surface dropped stream/tool_choice in Converse shim 2026-07-08 01:51:05 +05:30
test_bedrock_interrupt_post_worker.py
test_billing_view.py
test_bounded_response.py
test_cascading_interrupt_6600.py
test_chat_completion_helpers_provider_sort.py
test_close_interrupted_tool_sequence.py
test_codex_app_server_persist.py
test_codex_cloudflare_headers.py
test_codex_gpt55_autoraise_notice.py
test_codex_responses_adapter.py
test_codex_ttfb_watchdog.py
test_coding_context.py
test_compress_focus.py
test_compressed_summary_metadata.py
test_compression_concurrent_fork.py
test_compression_count_warning_36908.py
test_compression_interrupt_protection.py
test_compression_logging_session_context.py
test_compression_progress.py
test_compression_rotation_state.py
test_compression_small_ctx_threshold_floor.py fix(compression): stop compaction thrash — 75% trigger floor under 512K, no summary output cap, reasoning-trace exclusion (#60989) 2026-07-08 11:56:17 -07:00
test_compressor_assistant_tail_anchor.py
test_compressor_historical_media.py
test_compressor_image_tokens.py
test_compressor_media_stripping.py
test_compressor_tool_call_budget.py
test_compressor_zero_user_guard.py
test_context_breakdown.py
test_context_compressor.py fix(compression): stop compaction thrash — 75% trigger floor under 512K, no summary output cap, reasoning-trace exclusion (#60989) 2026-07-08 11:56:17 -07:00
test_context_compressor_cross_session_guard.py
test_context_compressor_session_end_clears_state.py
test_context_compressor_summary_continuity.py
test_context_compressor_temporal_anchoring.py
test_context_engine.py
test_context_engine_host_contract.py
test_context_references.py
test_context_refs_concurrent.py
test_copilot_acp_client.py
test_copilot_acp_deprecation.py
test_credential_pool.py
test_credential_pool_oauth_writethrough.py
test_credential_pool_routing.py
test_credits_cold_start.py
test_credits_fixture_snapshot.py
test_credits_policy.py
test_credits_tracker.py
test_credits_view.py
test_crossloop_client_cache.py
test_curator.py
test_curator_activity.py
test_curator_backup.py
test_curator_classification.py
test_curator_reports.py
test_custom_pool_mismatch_guard.py
test_custom_provider_extra_body.py
test_custom_providers_vision.py
test_deepseek_anthropic_thinking.py
test_direct_provider_url_detection.py
test_display.py
test_display_emoji.py
test_display_todo_progress.py
test_display_tool_failure.py
test_empty_tool_name_loop_dampening.py
test_error_classifier.py
test_external_skills.py
test_external_skills_dirs_cache.py
test_failover_identity.py
test_file_safety.py
test_file_safety_container_mirror.py
test_file_safety_credentials.py
test_file_safety_cross_profile.py
test_file_safety_sandbox_mirror.py
test_gemini_fast_fallback.py
test_gemini_free_tier_gate.py
test_gemini_native_adapter.py
test_gemini_schema.py
test_i18n.py
test_image_gen_registry.py
test_image_routing.py
test_insights.py
test_intent_ack_continuation.py
test_jiter_preload.py
test_kimi_coding_anthropic_thinking.py
test_last_total_tokens.py
test_learn_prompt.py
test_learning_graph.py
test_learning_graph_render.py
test_learning_mutations.py
test_local_stream_timeout.py
test_markdown_tables.py
test_memory_async_sync.py
test_memory_boundary_commit.py fix: serialize /new end→switch boundary on the memory manager worker 2026-07-09 03:21:54 +05:30
test_memory_provider.py
test_memory_session_switch.py
test_memory_skill_scaffolding.py
test_memory_user_id.py
test_memory_write_bridge.py
test_message_content.py
test_minimax_auxiliary_url.py
test_minimax_provider.py
test_moa_aggregator_cache_control.py
test_moa_aggregator_cost_slot.py
test_moa_slot_api_mode.py
test_moa_switch_api_mode.py
test_moa_trace_streamed_capture.py
test_model_extra_type_guard.py
test_model_metadata.py fix(model_metadata): bound the tools-token estimate cache 2026-07-09 12:34:11 +05:30
test_model_metadata_local_ctx.py fix(model_metadata): widen localhost->IPv4 rewrite to all sibling probe sites 2026-07-09 14:08:44 +05:30
test_model_metadata_ssl.py
test_models_dev.py
test_moonshot_schema.py
test_non_stream_stale_timeout.py
test_nous_credits_gauge.py
test_nous_credits_snapshot.py
test_nous_oauth_401_guidance.py
test_nous_rate_guard.py
test_onboarding.py
test_oneshot.py
test_openrouter_response_cache.py
test_pet_engine.py
test_pet_generate.py
test_platform_hint_desktop.py fix(agent): tag desktop chat sessions as desktop 2026-07-08 06:18:18 -07:00
test_platform_hint_overrides.py
test_plugin_llm.py
test_portal_tags.py
test_preflight_compression_gate.py
test_probe_cache_followups.py fix(model_metadata): address Phase-2 review findings on probe caches 2026-07-09 14:08:44 +05:30
test_prompt_builder.py
test_prompt_caching.py
test_proxy_and_url_validation.py
test_rate_limit_tracker.py
test_reasoning_stale_timeout_floor.py
test_redact.py
test_replay_cleanup.py
test_restore_primary_pool_reselect.py
test_resume_stale_active_task.py
test_runtime_cwd.py
test_save_url_image.py
test_secret_scope.py
test_set_runtime_main_custom_provider.py
test_shell_hooks.py
test_shell_hooks_consent.py
test_skill_bundles.py
test_skill_commands.py
test_skill_commands_reload.py
test_skill_utils.py perf(skills): speed up snapshot prompt builds 2026-07-09 02:41:24 +05:30
test_ssl_ca_guard.py
test_ssl_verify.py
test_stream_read_timeout_floor.py
test_streaming_context_scrubber.py
test_subagent_progress.py
test_subagent_stop_hook.py
test_subdirectory_hints.py
test_subdirectory_hints_tilde.py
test_summary_prefix_semantics.py
test_system_prompt.py
test_system_prompt_restore.py
test_think_scrubber.py
test_thinking_timeout_guidance.py
test_thread_scoped_output.py
test_title_generator.py
test_tool_call_arg_no_redaction.py
test_tool_dispatch_helpers.py
test_tool_guardrails.py
test_tool_result_classification.py
test_trace_upload.py feat(sessions): trace export + HF upload via 'sessions export --format trace' (#60507) 2026-07-07 15:12:49 -07:00
test_transcription_registry.py
test_tts_registry.py
test_turn_context.py
test_turn_finalizer_cleanup_guard.py
test_turn_finalizer_final_response_persistence.py
test_turn_finalizer_interrupt_alternation.py
test_turn_retry_state.py
test_unsupported_parameter_retry.py
test_unsupported_temperature_retry.py
test_usage_pricing.py
test_verification_evidence.py
test_verification_stop.py
test_verification_stop_caching.py
test_verify_hooks.py
test_vertex_adapter.py
test_video_gen_registry.py
test_vision_resolved_args.py
test_vision_routing_31179.py