fix(models): preserve Ollama model:tag colons in parse_model_input - #170
Open
hashbender wants to merge 1 commit into
Open
fix(models): preserve Ollama model:tag colons in parse_model_input#170hashbender wants to merge 1 commit into
hashbender wants to merge 1 commit into
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
When ACP clients (like AionUI) send
custom:glm-5.2:cloudtoset_session_model,parse_model_inputsplits at the second colon, treating the middle part (glm-5.2) as a named custom provider name. For Ollama models that use colons in their tags (e.g.glm-5.2:cloud,nomic-embed-text:latest,kimi-k2:1t-cloud), this truncates the model id to just the tag suffix (cloudinstead ofglm-5.2:cloud), causing HTTP 404 errors from the inference endpoint.The existing triple-syntax guard (
custom:name:model→("custom:name", "model")) had no way to distinguish between:custom:ollama:qwen3— providercustom:ollama, modelqwen3(intended triple syntax)custom:glm-5.2:cloud— providercustom, modelglm-5.2:cloud(Ollama tag, NOT triple syntax)Solution
Add
_is_registered_custom_provider()that checks whether the middle part matches a configured custom provider inconfig.yaml(viaget_compatible_custom_providers()). The triple split only happens when the middle part is a registered custom provider name. Otherwise, the full string aftercustom:is treated as the model id.Testing
test_custom_triple_syntaxandtest_custom_triple_spacesto mock_is_registered_custom_provider(sincelocal-server/my-serverare not registered providers in the test env)test_custom_triple_unregistered_falls_back— verifiescustom:glm-5.2:cloudwith a mockedFalsereturns the full model idtest_custom_ollama_tag_not_truncated— regression test without mocks, verifies real-world Ollama model names pass through intactVerified manually:
Scope
custom:name:model). Single-colon path (custom:model) is unchanged._is_registered_custom_providerusesget_compatible_custom_providerswhich already exists inhermes_cli/config.py./(slash) syntax in ACP model names. This PR is complementary (different delimiter, same root concern).Mirror-of: NousResearch#56089
NousResearch#56089