Skip to content

feat(config): support custom provider headers - #26505

Closed
aqilaziz wants to merge 2 commits into
NousResearch:mainfrom
aqilaziz:feat-custom-provider-headers
Closed

feat(config): support custom provider headers#26505
aqilaziz wants to merge 2 commits into
NousResearch:mainfrom
aqilaziz:feat-custom-provider-headers

Conversation

@aqilaziz

Copy link
Copy Markdown
Contributor

Summary

  • preserve headers in custom provider config and v11->v12 provider migration
  • apply configured custom provider headers to main agent, runtime switches, and auxiliary clients
  • document custom provider headers and add regression coverage

Fixes #9721

Tests

  • python -m pytest -o addopts='' tests/agent/test_auxiliary_named_custom_providers.py -q
  • python -m pytest -o addopts='' tests/hermes_cli/test_runtime_provider_resolution.py -q
  • python -m pytest -o addopts='' tests/hermes_cli/test_config.py::TestCustomProviderCompatibility tests/hermes_cli/test_config_env_refs.py -q
  • python -m pytest -o addopts='' tests/run_agent/test_provider_attribution_headers.py -q
  • python -m pytest -o addopts='' tests/e2e/test_discord_adapter.py -q
  • python -m pytest -o addopts='' tests/run_agent/test_provider_parity.py::TestDeveloperRoleSwap::test_developer_role_via_nous_portal tests/run_agent/test_provider_parity.py::TestBuildApiKwargsNousPortal::test_includes_nous_product_tags tests/run_agent/test_provider_parity.py::TestBuildApiKwargsNousPortal::test_uses_chat_completions_format -q
  • python -m py_compile hermes_cli/config.py hermes_cli/runtime_provider.py agent/auxiliary_client.py run_agent.py tests/hermes_cli/test_config.py tests/hermes_cli/test_runtime_provider_resolution.py tests/run_agent/test_provider_attribution_headers.py tests/agent/test_auxiliary_named_custom_providers.py tests/e2e/conftest.py tests/run_agent/test_provider_parity.py
  • python -m ruff check hermes_cli/config.py hermes_cli/runtime_provider.py agent/auxiliary_client.py run_agent.py tests/hermes_cli/test_config.py tests/hermes_cli/test_runtime_provider_resolution.py tests/run_agent/test_provider_attribution_headers.py tests/agent/test_auxiliary_named_custom_providers.py tests/e2e/conftest.py tests/run_agent/test_provider_parity.py
  • git diff --check

@alt-glitch alt-glitch added type/feature New feature or request P2 Medium — degraded but workaround exists area/config Config system, migrations, profiles comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard labels May 15, 2026
@aqilaziz
aqilaziz force-pushed the feat-custom-provider-headers branch from 2f4cd7a to 79fffdf Compare May 15, 2026 22:41
@kshitijk4poor

Copy link
Copy Markdown
Collaborator

Closing as superseded by #41096, which adds model.default_headers support for custom OpenAI-compatible providers across both the main and auxiliary client paths (overriding the OpenAI SDK's User-Agent/X-Stainless-* headers that some gateways/WAFs reject — #40033). Thanks for the contribution! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Cannot set custom HTTP headers for custom providers — Cloudflare 403

3 participants