hermes-agent/tests/tools
Teknium e3f9894caf
fix: send_animation metadata, MarkdownV2 inline code splitting, tirith cosign-free install (#1626)
* fix: Anthropic OAuth compatibility — Claude Code identity fingerprinting

Anthropic routes OAuth/subscription requests based on Claude Code's
identity markers. Without them, requests get intermittent 500 errors
(~25% failure rate observed). This matches what pi-ai (clawdbot) and
OpenCode both implement for OAuth compatibility.

Changes (OAuth tokens only — API key users unaffected):

1. Headers: user-agent 'claude-cli/2.1.2 (external, cli)' + x-app 'cli'
2. System prompt: prepend 'You are Claude Code, Anthropic's official CLI'
3. System prompt sanitization: replace Hermes/Nous references
4. Tool names: prefix with 'mcp_' (Claude Code convention for non-native tools)
5. Tool name stripping: remove 'mcp_' prefix from response tool calls

Before: 9/12 OK, 1 hard fail, 4 needed retries (~25% error rate)
After: 16/16 OK, 0 failures, 0 retries (0% error rate)

* fix: three gateway issues from user error logs

1. send_animation missing metadata kwarg (base.py)
   - Base class send_animation lacked the metadata parameter that the
     call site in base.py line 917 passes. Telegram's override accepted
     it, but any platform without an override (Discord, Slack, etc.)
     hit TypeError. Added metadata to base class signature.

2. MarkdownV2 split-inside-inline-code (base.py truncate_message)
   - truncate_message could split at a space inside an inline code span
     (e.g. `function(arg1, arg2)`), leaving an unpaired backtick and
     unescaped parentheses in the chunk. Telegram rejects with
     'character ( is reserved'. Added inline code awareness to the
     split-point finder — detects odd backtick counts and moves the
     split before the code span.

3. tirith auto-install without cosign (tirith_security.py)
   - Previously required cosign on PATH for auto-install, blocking
     install entirely with a warning if missing. Now proceeds with
     SHA-256 checksum verification only when cosign is unavailable.
     Cosign is still used for full supply chain verification when
     present. If cosign IS present but verification explicitly fails,
     install is still aborted (tampered release).
2026-03-16 23:39:41 -07:00
..
__init__.py
test_approval.py Merge pull request #1397 from NousResearch/hermes/hermes-629f8bde 2026-03-14 22:17:16 -07:00
test_browser_cleanup.py Fix browser cleanup consistency and screenshot recovery 2026-03-14 11:28:26 -07:00
test_browser_console.py
test_checkpoint_manager.py
test_clarify_tool.py
test_clipboard.py
test_code_execution.py test: cover repo-root imports in execute_code sandbox 2026-03-14 21:41:12 -07:00
test_command_guards.py
test_cron_prompt_injection.py
test_cronjob_tools.py fix: preserve thread context for cronjob deliver=origin 2026-03-15 06:57:00 -07:00
test_daytona_environment.py
test_debug_helpers.py
test_delegate.py feat: add direct endpoint overrides for auxiliary and delegation 2026-03-14 21:11:37 -07:00
test_docker_environment.py test: fake minisweagent for docker cwd mount regressions 2026-03-16 05:40:05 -07:00
test_docker_find.py
test_file_operations.py
test_file_tools_live.py
test_file_tools.py
test_force_dangerous_override.py fix(skills): honor policy table for dangerous verdicts 2026-03-14 11:27:02 -07:00
test_fuzzy_match.py
test_hidden_dir_filter.py
test_homeassistant_tool.py
test_honcho_tools.py fix(honcho): isolate session routing for multi-user gateway (#1500) 2026-03-16 00:23:47 -07:00
test_interrupt.py
test_local_env_blocklist.py feat: auto-detect provider when switching models via /model (#1506) 2026-03-16 04:34:45 -07:00
test_local_persistent.py simplify docstrings, fix some bugs 2026-03-15 01:20:42 +05:30
test_mcp_tool_issue_948.py
test_mcp_tool.py feat(mcp): make selective tool loading capability-aware 2026-03-14 06:22:02 -07:00
test_memory_tool.py fix: tighten memory and session recall guidance 2026-03-14 11:36:47 -07:00
test_mixture_of_agents_tool.py refactor: tighten MoA traceback logging scope (#1307) 2026-03-14 07:53:56 -07:00
test_modal_sandbox_fixes.py fix(docker): gate cwd workspace mount behind config 2026-03-16 05:20:56 -07:00
test_parse_env_var.py
test_patch_parser.py
test_process_registry.py fix(security): block gateway and tool env vars in subprocesses 2026-03-15 02:51:04 -07:00
test_read_loop_detection.py
test_registry.py feat(tools): centralize tool emoji metadata in registry + skin integration 2026-03-15 20:21:21 -07:00
test_rl_training_tool.py
test_send_message_tool.py fix: suppress duplicate cron sends to auto-delivery targets 2026-03-14 19:07:50 -07:00
test_session_search.py fix: tighten memory and session recall guidance 2026-03-14 11:36:47 -07:00
test_skill_manager_tool.py
test_skill_view_path_check.py
test_skill_view_traversal.py
test_skills_guard.py fix(skills): honor policy table for dangerous verdicts 2026-03-14 11:27:02 -07:00
test_skills_hub_clawhub.py fix: improve clawhub skill search matching 2026-03-14 23:15:04 -07:00
test_skills_hub.py test(skills): isolate well-known cache in adapter tests 2026-03-14 08:24:59 -07:00
test_skills_sync.py
test_skills_tool.py
test_ssh_environment.py merge: resolve conflicts with origin/main (SSH preflight check) 2026-03-15 21:13:40 -07:00
test_symlink_prefix_confusion.py
test_terminal_disk_usage.py
test_terminal_requirements.py
test_terminal_tool_requirements.py
test_tirith_security.py fix: send_animation metadata, MarkdownV2 inline code splitting, tirith cosign-free install (#1626) 2026-03-16 23:39:41 -07:00
test_todo_tool.py
test_transcription_tools.py fix: restore local STT fallback for gateway voice notes 2026-03-15 21:51:40 -07:00
test_transcription.py fix: propagate STT disable through shared transcription config 2026-03-14 22:09:59 -07:00
test_vision_tools.py refactor: unify vision backend gating 2026-03-14 20:22:13 -07:00
test_voice_cli_integration.py
test_voice_mode.py
test_web_tools_config.py
test_windows_compat.py
test_write_deny.py
test_yolo_mode.py