hermes-agent/tests/tools
teknium1 2317d115cd fix: clipboard image paste on WSL2, Wayland, and VSCode terminal
The original implementation only supported xclip (X11), which silently
fails on WSL2 (can't access Windows clipboard for images), Wayland
desktops (xclip is X11-only), and VSCode terminal on WSL2.

Clipboard backend changes (hermes_cli/clipboard.py):
- WSL2: detect via /proc/version, use powershell.exe with .NET
  System.Windows.Forms.Clipboard to extract images as base64 PNG
- Wayland: use wl-paste with MIME type detection, auto-convert BMP
  to PNG for WSLg environments (via Pillow or ImageMagick)
- Dispatch order: WSL → Wayland → X11 (xclip), with fallthrough
- New has_clipboard_image() for lightweight clipboard checks
- Cache WSL detection result per-process

CLI changes (cli.py):
- /paste command: explicit clipboard image check for terminals where
  BracketedPaste doesn't fire (image-only clipboard in VSCode/WinTerm)
- Ctrl+V keybinding: fallback for Linux terminals where Ctrl+V sends
  raw byte instead of triggering bracketed paste

Tests: 80 tests (up from 37) covering WSL, Wayland, X11 dispatch,
BMP conversion, has_clipboard_image, and /paste command.
2026-03-05 20:22:44 -08:00
..
__init__.py test: reorganize test structure and add missing unit tests 2026-02-26 03:20:08 +03:00
test_approval.py test: strengthen assertions across 3 more test files (batch 2) 2026-03-05 18:46:30 -08:00
test_clarify_tool.py test(tools): add unit tests for clarify_tool.py 2026-02-27 03:29:26 -05:00
test_clipboard.py fix: clipboard image paste on WSL2, Wayland, and VSCode terminal 2026-03-05 20:22:44 -08:00
test_code_execution.py test: reorganize test structure and add missing unit tests 2026-02-26 03:20:08 +03:00
test_cron_prompt_injection.py fix: cron prompt injection scanner bypass for multi-word variants 2026-02-26 13:55:54 +03:00
test_cronjob_tools.py test: add unit tests for 8 modules (batch 2) 2026-02-26 13:54:20 +03:00
test_debug_helpers.py fix(tests): isolate HERMES_HOME in tests and adjust log directory for debug session 2026-03-02 04:34:21 -08:00
test_delegate.py Merge remote-tracking branch 'origin/main' into codex/align-codex-provider-conventions-mainrepo 2026-02-26 10:56:29 -08:00
test_file_operations.py fix(tools): preserve empty content in ReadResult.to_dict() 2026-03-01 02:42:15 +03:00
test_file_tools.py test: enhance session source tests and add validation for chat types 2026-02-26 00:53:57 -08:00
test_file_tools_live.py fix: eliminate shell noise from terminal output with fence markers 2026-03-02 22:53:21 +03:00
test_force_dangerous_override.py fix: prevent --force from overriding dangerous verdict in should_allow_install 2026-03-04 18:10:18 +03:00
test_fuzzy_match.py test: reorganize test structure and add missing unit tests 2026-02-26 03:20:08 +03:00
test_hidden_dir_filter.py fix: use Path.parts for hidden directory filter in skill listing 2026-03-04 18:34:16 +03:00
test_homeassistant_tool.py fix: add service domain blocklist and entity_id validation to HA tools 2026-03-01 11:53:50 +03:00
test_interrupt.py test: reorganize test structure and add missing unit tests 2026-02-26 03:20:08 +03:00
test_mcp_tool.py feat(mcp): banner integration, /reload-mcp command, resources & prompts 2026-03-02 19:15:59 -08:00
test_memory_tool.py test: strengthen assertions in skill_manager + memory_tool (batch 3) 2026-03-05 18:51:43 -08:00
test_patch_parser.py test: reorganize test structure and add missing unit tests 2026-02-26 03:20:08 +03:00
test_process_registry.py test: add unit tests for 8 modules (batch 2) 2026-02-26 13:54:20 +03:00
test_registry.py fix: catch exceptions from check_fn in is_toolset_available() 2026-03-04 14:22:30 -08:00
test_session_search.py fix: exclude current session from session_search results 2026-03-04 06:06:40 -08:00
test_skill_manager_tool.py test: strengthen assertions in skill_manager + memory_tool (batch 3) 2026-03-05 18:51:43 -08:00
test_skill_view_path_check.py refactor: use Path.is_relative_to() for skill_view boundary check 2026-03-04 05:30:43 -08:00
test_skill_view_traversal.py fix(security): block path traversal in skill_view file_path (fixes #220) 2026-03-02 02:00:09 -08:00
test_skills_guard.py Merge PR #388: fix --force bypassing dangerous verdict in should_allow_install 2026-03-04 19:19:57 -08:00
test_skills_hub.py fix: skills hub dedup prefers higher trust levels + 43 tests 2026-02-28 21:25:55 +03:00
test_skills_hub_clawhub.py Fix ClawHub Skills Hub adapter for updated API 2026-03-02 16:11:49 +01:00
test_skills_sync.py test: add unit tests for 8 untested modules (batch 3) (#191) 2026-03-01 05:28:12 -08:00
test_skills_tool.py test: add unit tests for 5 security/logic-critical modules (batch 4) 2026-02-28 20:33:48 +03:00
test_symlink_prefix_confusion.py fix: use is_relative_to() for symlink boundary check in skills_guard 2026-03-04 17:23:23 +03:00
test_terminal_disk_usage.py fix: eliminate shell noise from terminal output with fence markers 2026-03-02 22:53:21 +03:00
test_todo_tool.py test: reorganize test structure and add missing unit tests 2026-02-26 03:20:08 +03:00
test_web_tools_config.py test: comprehensive tests for model metadata + firecrawl config 2026-03-05 18:22:39 -08:00
test_windows_compat.py fix: guard POSIX-only process functions for Windows compatibility 2026-03-01 01:54:27 +03:00
test_write_deny.py fix: resolve symlink bypass in write deny list on macOS 2026-02-26 13:30:55 +03:00