Skip to content

fix(acp): preserve explicit model providers - #59092

Open
BROCCOLO1D wants to merge 1 commit into
NousResearch:mainfrom
BROCCOLO1D:fix/59089-acp-explicit-model-provider
Open

fix(acp): preserve explicit model providers#59092
BROCCOLO1D wants to merge 1 commit into
NousResearch:mainfrom
BROCCOLO1D:fix/59089-acp-explicit-model-provider

Conversation

@BROCCOLO1D

Copy link
Copy Markdown
Contributor

Summary

Why

  • session/set_model could parse anthropic:claude-sonnet-5 correctly, then immediately re-run detect_provider_for_model because the parsed provider matched the current provider.
  • For new Anthropic model IDs that OpenRouter also indexes, that fallback can silently rewrite the provider to openrouter and fail sessions without OpenRouter credentials.

Changes

  • acp_adapter/server.py: track provider-qualified ACP model inputs and skip provider auto-detection for explicit provider selections; also normalize current-provider slash form like anthropic/claude-sonnet-5 for ACP callers.
  • tests/acp_adapter/test_acp_commands.py: cover explicit colon and current-provider slash selections, plus the unchanged bare-model auto-detection path.

Validation

  • python -m pytest tests/acp_adapter/test_acp_commands.py -q -o 'addopts=' (7 passed)
  • python -m py_compile acp_adapter/server.py
  • git diff --check

Scope

  • In scope: ACP session/set_model provider resolution for explicit provider-qualified model inputs.
  • Out of scope: broader /model slash-command/provider auto-detection behavior tracked by related issues.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused ACP fix. Current origin/main still parses the requested model and then re-runs provider detection when target_provider == current_provider (acp_adapter/server.py:654-658), so an explicit current-provider selection can be overwritten by the OpenRouter fallback (hermes_cli/models.py:2076-2091).

The PR guards that fallback only for recognized explicit provider prefixes, preserves bare-model autodetection, and updates the shared resolver used by both ACP session/set_model and /model (acp_adapter/server.py:1772-1780, 1999-2017).

This is an automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state 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 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/acp Agent Communication Protocol adapter P2 Medium — degraded but workaround exists 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 sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants