hermes-agent/tests/agent
Teknium d0cc6a14d7
fix: Anthropic 'sensitive' stop reason handling + WhatsApp echo loop prevention
Two fixes inspired by OpenClaw v2026.3.28:

1. Anthropic content policy (sensitive stop_reason):
   When Anthropic blocks a response with stop_reason='sensitive', the
   adapter now maps it to finish_reason='content_filter' and injects a
   user-facing message instead of crashing on empty content.

2. WhatsApp echo loop:
   The WhatsApp bridge now sends fromMe flag on message events, and the
   Python adapter filters out self-sent messages. Prevents an infinite
   loop where the bot processes its own outbound replies as new inbound.

9 new tests (6 anthropic + 3 whatsapp).
2026-03-30 01:16:38 -07:00
..
__init__.py test: add unit tests for 8 modules (batch 2) 2026-02-26 13:54:20 +03:00
test_anthropic_sensitive.py fix: Anthropic 'sensitive' stop reason handling + WhatsApp echo loop prevention 2026-03-30 01:16:38 -07:00
test_auxiliary_client.py fix: auxiliary client uses placeholder key for local servers without auth (#3842) 2026-03-29 21:05:36 -07:00
test_context_compressor.py fix(compression): restore sane defaults and cap summary at 12K tokens 2026-03-24 18:48:47 -07:00
test_display_emoji.py feat(tools): centralize tool emoji metadata in registry + skin integration 2026-03-15 20:21:21 -07:00
test_external_skills.py feat(skills): support external skill directories via config (#3678) 2026-03-29 00:33:30 -07:00
test_model_metadata.py feat: overhaul context length detection with models.dev and provider-aware resolution (#2158) 2026-03-20 06:04:33 -07:00
test_models_dev.py feat: overhaul context length detection with models.dev and provider-aware resolution (#2158) 2026-03-20 06:04:33 -07:00
test_prompt_builder.py fix(tests): align skill/setup and platform mocks with current behavior (#3721) 2026-03-29 07:51:43 -07:00
test_prompt_caching.py fix(prompt-caching): skip top-level cache_control on role:tool for OpenRouter 2026-03-21 16:54:43 -07:00
test_redact.py fix(tests): resolve all consistently failing tests 2026-03-22 05:58:26 -07:00
test_skill_commands.py fix(tests): align skill/setup and platform mocks with current behavior (#3721) 2026-03-29 07:51:43 -07:00
test_smart_model_routing.py fix: hermes update causes dual gateways on macOS (launchd) (#1567) 2026-03-16 12:36:29 -07:00
test_subagent_progress.py fix(display): fix subagent progress tree-view visual nits 2026-02-28 23:29:49 -08:00
test_title_generator.py feat: auto-generate session titles after first exchange 2026-03-17 04:14:40 -07:00
test_usage_pricing.py feat: use endpoint metadata for custom model context and pricing (#1906) 2026-03-18 03:04:07 -07:00