hermes-agent/tests/run_agent
kshitijk4poor 20a4f79ed1 feat: provider modules — ProviderProfile ABC, 33 providers, fetch_models, transport single-path
Introduces providers/ package — single source of truth for every
inference provider. Adding a simple api-key provider now requires one
providers/<name>.py file with zero edits anywhere else.

What this PR ships:
- providers/ package (ProviderProfile ABC + 33 profiles across 4 api_modes)
- ProviderProfile declarative fields: name, api_mode, aliases, display_name,
  env_vars, base_url, models_url, auth_type, fallback_models, hostname,
  default_headers, fixed_temperature, default_max_tokens, default_aux_model
- 4 overridable hooks: prepare_messages, build_extra_body,
  build_api_kwargs_extras, fetch_models
- chat_completions.build_kwargs: profile path via _build_kwargs_from_profile,
  legacy flag path retained for lmstudio/tencent-tokenhub (which have
  session-aware reasoning probing that doesn't map cleanly to hooks yet)
- run_agent.py: profile path for all registered providers; legacy path
  variable scoping fixed (all flags defined before branching)
- Auto-wires: auth.PROVIDER_REGISTRY, models.CANONICAL_PROVIDERS,
  doctor health checks, config.OPTIONAL_ENV_VARS, model_metadata._URL_TO_PROVIDER
- GeminiProfile: thinking_config translation (native + openai-compat nested)
- New tests/providers/ (79 tests covering profile declarations, transport
  parity, hook overrides, e2e kwargs assembly)

Deltas vs original PR (salvaged onto current main):
- Added profiles: alibaba-coding-plan, azure-foundry, minimax-oauth
  (were added to main since original PR)
- Skipped profiles: lmstudio, tencent-tokenhub stay on legacy path (their
  reasoning_effort probing has no clean hook equivalent yet)
- Removed lmstudio alias from custom profile (it's a separate provider now)
- Skipped openrouter/custom from PROVIDER_REGISTRY auto-extension
  (resolve_provider special-cases them; adding breaks runtime resolution)
- runtime_provider: profile.api_mode only as fallback when URL detection
  finds nothing (was breaking minimax /v1 override)
- Preserved main's legacy-path improvements: deepseek reasoning_content
  preserve, gemini Gemma skip, OpenRouter response caching, Anthropic 1M
  beta recovery, etc.
- Kept agent/copilot_acp_client.py in place (rejected PR's relocation —
  main has 7 fixes landed since; relocation would revert them)
- _API_KEY_PROVIDER_AUX_MODELS alias kept for backward compat with existing
  test imports

Co-authored-by: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com>
Closes #14418
2026-05-05 13:40:01 -07:00
..
__init__.py
…
conftest.py
…
test_413_compression.py fix(agent): surface preflight compression status 2026-05-04 01:41:51 -07:00
test_860_dedup.py fix: lazy session creation — defer DB row until first message (#18370) 2026-05-01 18:39:12 +05:30
test_1630_context_overflow_loop.py
…
test_agent_guardrails.py fix(agent): include name field on every role:tool message for Gemini compatibility (#16478) 2026-05-04 05:06:33 -07:00
test_agent_loop.py
…
test_agent_loop_tool_calling.py
…
test_agent_loop_vllm.py
…
test_anthropic_error_handling.py
…
test_anthropic_prompt_cache_policy.py
…
test_anthropic_third_party_oauth_guard.py
…
test_anthropic_truncation_continuation.py
…
test_api_max_retries_config.py
…
test_async_httpx_del_neuter.py
…
test_background_review.py fix(cli): surface self-improvement review summaries from bg thread 2026-04-30 14:07:22 -07:00
test_background_review_summary.py
…
test_background_review_toolset_restriction.py
…
test_compress_focus_plugin_fallback.py
…
test_compression_boundary.py
…
test_compression_boundary_hook.py
…
test_compression_feasibility.py
…
test_compression_persistence.py
…
test_compression_trigger_excludes_reasoning.py
…
test_compressor_fallback_update.py
…
test_concurrent_interrupt.py
…
test_context_token_tracking.py
…
test_copilot_native_vision_headers.py
…
test_create_openai_client_kwargs_isolation.py
…
test_create_openai_client_proxy_env.py
…
test_create_openai_client_reuse.py
…
test_deepseek_reasoning_content_echo.py fix(deepseek): use non-empty reasoning_content placeholder for V4 Pro thinking mode 2026-04-30 23:04:23 -07:00
test_deepseek_v4_thinking_live.py
…
test_dict_tool_call_args.py
…
test_exit_cleanup_interrupt.py
…
test_fallback_model.py
…
test_image_shrink_recovery.py
…
test_init_fallback_on_exhausted_pool.py fix(agent): try fallback providers at init when primary credential pool is exhausted (#17929) 2026-05-02 02:09:46 -07:00
test_interactive_interrupt.py
…
test_interrupt_propagation.py
…
test_invalid_context_length_warning.py
…
test_iteration_budget_race.py fix(run_agent): acquire lock in IterationBudget.used property 2026-05-04 12:37:28 -07:00
test_jsondecodeerror_retryable.py
…
test_last_reasoning_per_turn.py test: pin per-turn reasoning extraction semantics 2026-05-05 05:00:05 -07:00
test_long_context_tier_429.py
…
test_memory_provider_init.py
…
test_memory_sync_interrupted.py
…
test_openai_client_lifecycle.py
…
test_percentage_clamp.py
…
test_plugin_context_engine_init.py
…
test_primary_runtime_restore.py
…
test_provider_attribution_headers.py fix(openrouter): use canonical X-Title attribution header 2026-05-05 10:13:34 -07:00
test_provider_fallback.py
…
test_provider_parity.py
…
test_real_interrupt_subagent.py
…
test_redirect_stdout_issue.py
…
test_repair_tool_call_arguments.py
…
test_repair_tool_call_name.py
…
test_review_prompt_class_first.py
…
test_run_agent.py feat: provider modules — ProviderProfile ABC, 33 providers, fetch_models, transport single-path 2026-05-05 13:40:01 -07:00
test_run_agent_codex_responses.py
…
test_run_agent_multimodal_prologue.py
…
test_sequential_chats_live.py
…
test_session_meta_filtering.py
…
test_session_reset_fix.py
…
test_steer.py
…
test_stream_interrupt_retry.py
…
test_streaming.py
…
test_streaming_tool_call_repair.py
…
test_strict_api_validation.py
…
test_strip_reasoning_tags_cli.py
…
test_switch_model_context.py
…
test_switch_model_fallback_prune.py
…
test_thinking_only_sanitizer.py
…
test_token_persistence_non_cli.py
…
test_tool_arg_coercion.py fix(tools): wrap bare scalars in single-element list for array-typed args 2026-05-04 05:00:37 -07:00
test_tool_call_args_sanitizer.py fix(agent): include name field on every role:tool message for Gemini compatibility (#16478) 2026-05-04 05:06:33 -07:00
test_tool_call_guardrail_runtime.py fix(agent): make tool loop guardrails warning-first 2026-04-30 20:43:15 -07:00
test_tool_executor_contextvar_propagation.py fix(agent): propagate ContextVars to concurrent tool worker threads (#18123) 2026-04-30 16:26:26 -07:00
test_unicode_ascii_codec.py
…
test_vision_aware_preprocessing.py
…