hermes-agent/tests/agent
kshitijk4poor ffe665277c fix(aux): honor model.default_headers on auxiliary client too (#40033)
The salvaged main-agent fix (sanidhyasin) applies model.default_headers
to the primary OpenAI client, but the auxiliary client (title generation,
context compression, vision routing) builds its own clients and did not
read the override. For a `provider: custom` endpoint behind a gateway/WAF
that rejects the OpenAI SDK's identifying headers, the main turn would
succeed while auxiliary calls to the same endpoint still failed with the
opaque 502/4xx from #40033.

Add agent.auxiliary_client._apply_user_default_headers() (user values win
over provider/SDK defaults; no-op when unconfigured) and apply it at every
OpenAI-wire client construction site:
- _try_custom_endpoint() — config-level `model.provider: custom`
- the named custom-provider branch (custom_providers/providers entries),
  including the anthropic-SDK-missing OpenAI-wire fallback
- the api-key-provider, async-conversion, and main resolve_provider_client
  fallback branches

To prevent the two clients ever drifting on precedence/value handling,
AIAgent._apply_user_default_headers (run_agent.py) now delegates the config
read + merge to this shared helper (run_agent already imports from
auxiliary_client). Native Anthropic/Bedrock branches are untouched (they
don't use the OpenAI wire).

8 new tests (helper semantics + config-level custom + named custom);
full aux + attribution header suites green (295).
2026-06-07 02:02:40 -07:00
..
lsp
…
transports
…
__init__.py
…
test_anthropic_adapter.py
…
test_anthropic_keychain.py
…
test_anthropic_mcp_prefix_strip.py
…
test_anthropic_oauth_pkce.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_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 fix(aux): honor model.default_headers on auxiliary client too (#40033) 2026-06-07 02:02:40 -07:00
test_azure_identity_adapter.py
…
test_bedrock_1m_context.py
…
test_bedrock_adapter.py
…
test_bedrock_integration.py
…
test_codex_cloudflare_headers.py
…
test_codex_responses_adapter.py
…
test_codex_ttfb_watchdog.py
…
test_compress_focus.py
…
test_compression_concurrent_fork.py
…
test_compressor_historical_media.py
…
test_compressor_image_tokens.py
…
test_context_compressor.py
…
test_context_compressor_summary_continuity.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_routing.py
…
test_credits_cold_start.py
…
test_credits_fixture_snapshot.py
…
test_credits_policy.py
…
test_credits_tracker.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_provider_extra_body.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_error_classifier.py
…
test_external_skills.py
…
test_external_skills_dirs_cache.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_cloudcode.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_jiter_preload.py
…
test_kimi_coding_anthropic_thinking.py
…
test_last_total_tokens.py
…
test_local_stream_timeout.py
…
test_markdown_tables.py
…
test_memory_provider.py
…
test_memory_session_switch.py
…
test_memory_user_id.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_openrouter_response_cache.py
…
test_plugin_llm.py
…
test_portal_tags.py
…
test_prompt_builder.py
…
test_prompt_caching.py
…
test_proxy_and_url_validation.py
…
test_rate_limit_tracker.py
…
test_redact.py
…
test_resume_stale_active_task.py
…
test_runtime_cwd.py
…
test_save_url_image.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_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_title_generator.py
…
test_tool_dispatch_helpers.py
…
test_tool_guardrails.py
…
test_tool_result_classification.py
…
test_transcription_registry.py
…
test_tts_registry.py
…
test_unsupported_parameter_retry.py
…
test_unsupported_temperature_retry.py
…
test_usage_pricing.py
…
test_video_gen_registry.py
…
test_vision_resolved_args.py
…
test_vision_routing_31179.py
…