Skip to content

fix(auxiliary_client): consult ProviderProfile.api_mode in resolver - #34299

Open
Kyzcreig wants to merge 1 commit into
NousResearch:mainfrom
ANG-Ventures:fix/aux-resolver-api-mode
Open

fix(auxiliary_client): consult ProviderProfile.api_mode in resolver#34299
Kyzcreig wants to merge 1 commit into
NousResearch:mainfrom
ANG-Ventures:fix/aux-resolver-api-mode

Conversation

@Kyzcreig

Copy link
Copy Markdown
Contributor

Plugin providers that declare api_mode='anthropic_messages' with a plain base_url (no /anthropic suffix) silently land on the OpenAI-wire transport and 404 from chat/completions, because _resolve_task_provider_model only returns the task-config api_mode and never consults the provider profile. _endpoint_speaks_anthropic_messages only catches /anthropic-suffixed URLs, missing plain-base-URL Anthropic endpoints (e.g. local proxies on 127.0.0.1:PORT). This falls back to profile.api_mode when no task override is set (task config still wins), wrapped in try/except. Includes a 3-case regression test (test_aux_resolver_api_mode.py).

Manual re-apply of c1d5f9e onto v0.15.1 (_resolve_task_provider_model
moved to ~4432). When an explicit provider is given with no task-config
api_mode override, fall back to the provider profile's declared api_mode so
plugin providers whose upstream speaks the Anthropic Messages API are wrapped
with the correct transport regardless of base-URL shape. Task config still
wins; wrapped in try/except. Adds a fresh regression test (original commit was
code-only) pinning profile fallback, task-config-wins, and None passthrough.

Original-commit: c1d5f9e
@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have duplicate This issue or pull request already exists labels May 29, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #24586 — same fix (consult ProviderProfile.api_mode in resolver), same author, same file. Resubmission of earlier PR.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused resolver fix. The premise remains valid on current main: agent/auxiliary_client.py:5913-5914 initializes the result from task config only, and the client router uses OpenAI wire unless it receives anthropic_messages or identifies an Anthropic URL (agent/auxiliary_client.py:1543-1551).

Problems

  • The added guard only reads the explicit provider argument. For the documented per-task route, auxiliary.<task>.provider is selected as cfg_provider at agent/auxiliary_client.py:5986; the proposed guard would not run, so a plain-base-URL profile with api_mode="anthropic_messages" remains unwrapped.
  • tests/agent/test_aux_resolver_api_mode.py covers the explicit-provider case and an explicit task override, but not the configured-provider fallback above.

Suggested changes

  • Apply the profile fallback to the effective selected provider (provider or cfg_provider) after config resolution, only when cfg_api_mode is empty.
  • Add a configured auxiliary.<task>.provider regression case with a profile-only anthropic_messages declaration.

This is an automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/plugins Plugin system and bundled plugins duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants