hermes-agent/tests/agent
Teknium 481caa66f2
feat(display): friendly human-phrased tool labels for built-in tools (#55166)
* feat(display): friendly human-phrased tool labels for built-in tools

Built-in tools now render ChatGPT-style status verbs ('Searching the web
for ...', 'Reading <file>', 'Browsing <url>') on the CLI spinner and
gateway/desktop tool-progress instead of the raw tool name.

- agent/display.py: _TOOL_VERBS map + build_tool_label() + set/get
  friendly-labels flag (default on). Custom/plugin/MCP tools fall back to
  the raw preview; verbose gateway mode left untouched (debug surface).
- tool_executor.py / tui_gateway / gateway: route the three spinner sites,
  the TUI _tool_ctx, and the gateway all/new progress line through the label.
- config: display.friendly_tool_labels (default True, per-platform aware).

Zero new core tool / schema footprint — pure display layer.

* docs: add PR infographic for friendly tool labels

* fix(display): preserve arg preview in gateway friendly labels + update tests

The first gateway pass re-derived the label from the callback's `args`, which
is empty ({}) at the gateway tool.started callsite — the command/query lives in
the `preview` string, so terminal rendered as a bare '💻 Running' and dedup
collapsed consecutive commands. Now the gateway prefixes the verb onto the
already-computed preview via get_tool_verb/tool_verb_connector/verb_drops_preview,
preserving the command/url/query. CLI spinner path (real args) keeps build_tool_label.

Tests: update test_run_progress_topics exact-format assertions to the friendly
form ('💻 Running pwd'), add a format-agnostic preview extractor for the
truncation tests (works for both quoted-legacy and verb-prefixed output).

* test(tui): update resume-display context to friendly tool label

_tool_ctx now uses build_tool_label, so the desktop resume-view context for a
search_files turn reads 'Searching files for resume' instead of the bare
'resume' preview — consistent with live tool-progress. Update the assertion.

* test(tui): harden no-race worker test against sibling shard leakage

test_session_create_no_race_keeps_worker_alive flaked under -j 8: a daemon
build thread leaked from a prior session.create test in the same shard process
fires close/unregister against its own (foreign) session_key after this test
patches the global approval hooks, polluting the captured lists. Scope the
assertions to this session's own session_key so the regression intent
(this session's worker/notify must survive) is preserved while the test
becomes immune to shard composition. Not related to friendly-tool-labels.
2026-06-29 20:31:17 -07:00
..
lsp
transports
__init__.py
test_anthropic_adapter.py
test_anthropic_keychain.py
test_anthropic_kwargs_sanitize.py
test_anthropic_mcp_prefix_strip.py
test_anthropic_oauth_pkce.py
test_anthropic_output_field_leak.py
test_anthropic_thinking_block_order.py
test_arcee_trinity_overrides.py
test_async_utils.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_xai_oauth_recovery.py
test_auxiliary_config_bridge.py
test_auxiliary_main_first.py
test_auxiliary_named_custom_providers.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
test_billing_view.py
test_cascading_interrupt_6600.py
test_chat_completion_helpers_provider_sort.py
test_close_interrupted_tool_sequence.py
test_codex_cloudflare_headers.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_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_context_breakdown.py
test_context_compressor.py
test_context_compressor_cross_session_guard.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_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_local_stream_timeout.py
test_markdown_tables.py
test_memory_async_sync.py
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_model_metadata.py
test_model_metadata_local_ctx.py
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_overrides.py
test_plugin_llm.py
test_portal_tags.py
test_preflight_compression_gate.py
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
test_ssl_ca_guard.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_summary_prefix_semantics.py
test_system_prompt.py
test_system_prompt_restore.py
test_think_scrubber.py
test_thinking_timeout_guidance.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_transcription_registry.py
test_tts_registry.py
test_turn_context.py
test_turn_finalizer_cleanup_guard.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_video_gen_registry.py
test_vision_resolved_args.py
test_vision_routing_31179.py