You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
preserve every recognized explicit provider:model choice in Hermes ACP
keep provider auto-detection for unqualified model text and supported slash, custom, aggregator, and variant forms
add deterministic resolver-collision coverage and a no-turn session/set_model persistence regression
Root cause
ACP parsed an explicit provider correctly, then ran bare-model detection when the parsed provider matched the current provider. A catalog collision could therefore replace the provider that the client selected.
This builds on #59092 and preserves @BROCCOLO1D's original commit authorship.
Impact
ACP clients can select a provider-qualified model without Hermes silently routing the model through another provider. Unqualified selections retain automatic provider detection.
Ready for maintainer review. This salvages #59092 with BROCCOLO1D's original commit and adds the real resolver-collision plus no-turn session/set_model regressions.
Duplicate of #59092: both PRs prevent ACP session/set_model from re-detecting a recognized explicit provider:model selection and replacing it after parsing. #59092 is the earlier open canonical PR.
AI code review — automated review for reference, author can ignore or act on any point.
PR: fix(acp): preserve explicit model providers
Slash vs colon asymmetry (acp_adapter/server.py, _resolve_model_selection): parse_model_input_details treats any recognized provider:model as explicit regardless of the current provider, but the new slash branch only treats provider/model as explicit when the provider equals the current one. google:model while on anthropic switches provider; google/model while on anthropic falls through to detect_provider_for_model. Same user intent, different outcome. Either apply the colon semantics to the slash form too, or document why the slash form is current-provider-only.
Slash support lands only in ACP, not the CLI (hermes_cli/models.py, parse_model_input): parse_model_input_details still only parses colons, so /model anthropic/model in the CLI won't get the slash handling the ACP resolver now has — two entry points, two syntaxes. If slash syntax is intended to be general, normalize it inside parse_model_input_details (a shared helper) so both callers get it and the duplicated slash logic in the ACP resolver disappears.
is_known_provider_name depends on _KNOWN_PROVIDER_NAMES staying lowercase (models.py): the set is built from _PROVIDER_LABELS.keys() + _PROVIDER_ALIASES.keys() + {"openrouter", "custom"}; the new helper lowercases the input before membership, so any future label/alias key added with uppercase silently breaks lookups. A frozenset(name.lower() for ...) at construction would make the invariant structural. (The old inline check had the same property, so this is hardening, not a regression.)
Good coverage: the collision fixture plus parametrized cases and the no-turn persistence test are exactly the regressions this needed. The openrouter_collision monkeypatch of a module-level function is clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
comp/acpAgent Communication Protocol adaptercomp/cliCLI entry point, hermes_cli/, setup wizardP2Medium — degraded but workaround existssweeper:risk-compatibilitySweeper risk: may break existing users, config, migrations, defaults, or upgradessweeper:risk-session-stateSweeper risk: may lose/corrupt/mis-associate session or context statetype/bugSomething isn't working
4 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
provider:modelchoice in Hermes ACPsession/set_modelpersistence regressionRoot cause
ACP parsed an explicit provider correctly, then ran bare-model detection when the parsed provider matched the current provider. A catalog collision could therefore replace the provider that the client selected.
This builds on #59092 and preserves @BROCCOLO1D's original commit authorship.
Impact
ACP clients can select a provider-qualified model without Hermes silently routing the model through another provider. Unqualified selections retain automatic provider detection.
Validation
scripts/run_tests.sh tests/acp_adapter/ tests/hermes_cli/test_model_validation.py tests/hermes_cli/test_models.py— 84 passed.venv/bin/ruff check .— passedgit diff --check— passed