Core branched on the Copilot slug/host for four wire decisions. Replace them with
generic ProviderProfile hooks (providers/base.py L1 block) and move the Copilot
logic into plugins/model-providers/copilot/wire.py:
- api_mode_for_model(model, *, api_key=None): run_agent Responses routing, aux
CodexAuxiliaryClient wrap, model_switch.model_derived_api_mode (copilot rows
of _PROVIDER_API_MODE_OVERRIDES removed).
- client_headers(*, base_url, api_key, has_images): agent_init/_client_lifecycle
host tables, the client-kwargs chokepoint guard (_ensure_route_client_headers),
the image request-client header swap, both aux header branches.
- request_headers(*, base_url, model, user_initiated): first-call-of-a-user-turn
attribution in turn_api_request and MoA reference slots.
- max_tokens_param(*, base_url, model): run_agent._max_tokens_param and
auxiliary_max_tokens_param.
agent/provider_route_hooks.py asks the named provider's profile first, then any
registered profile overriding the hook, so custom routes at a provider's host
keep its quirks. Plugin absent = generic behaviour.
Port of #46542 by @MarkVLK onto current main:
- hermes_cli/runtime_provider.py: _copilot_runtime_api_mode must not veto
a stale configured codex_responses mode for chat-only Copilot models;
recompute from the live model capabilities.
- agent/transports/codex.py: request summary:"auto" on the GitHub
Responses API so reasoning summaries surface.
- agent/agent_init.py: recompute api_mode at init-time fallback so the
fallback provider/model gets its own mode (and the primary-runtime
snapshot reflects it).
- tests: regression tests for the stale-mode veto, the GitHub Responses
summary, and the init-time fallback recompute.
Conflicts resolved against main's refactored fallback ladder
(agent/chat_completion_helpers.py) and its expanded transport tests.
Co-authored-by: Mark Vlcek <markvlcek@gmail.com>
Fixes#46527