fix(console): allow Ollama custom model validation - #1576
Closed
arimu1 wants to merge 2 commits into
Closed
Conversation
Detect Ollama endpoints during model validation and use a dedicated provider path: accept chat completion responses without a usage field and permit private/local addresses via the existing blockPrivate SSRF toggle instead of the strict OpenAI compatibility check.
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
arimu1
force-pushed
the
fix/1551-ollama-custom-model-validation
branch
2 times, most recently
from
July 27, 2026 09:23
5edb424 to
7a03e46
Compare
Avoid reclassifying OpenAI-compat endpoints with /ollama in the path as Ollama, which disabled private-IP SSRF blocking. Infer Ollama only from explicit provider, hostname containing "ollama", or port 11434.
arimu1
force-pushed
the
fix/1551-ollama-custom-model-validation
branch
from
July 27, 2026 09:23
7a03e46 to
4d26f56
Compare
Contributor
|
The CI is having issues—please investigate |
Contributor
|
This issue has been fixed in PR #1562. Please deploy the latest version and give it a try. Thanks! |
Contributor
|
START TRANSACTION; UPDATE config_info UPDATE config_info_en COMMIT; |
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.
Summary
ollamaprovider or default port:11434/ hostname containingollama)usagefield (Ollama often omits it)SsrfProperties.blockPrivateflag (previously unused) instead of rejecting loopback/LAN URLs by defaultFixes #1551
Type of Change
Related Issue
Fixes #1551
Changes
ModelService.resolveValidationProvider()infers Ollama from provider/endpoint and routes to relaxed response + SSRF rulesModelService.isValidModelResponse()accepts Ollama replies withchoicesonly (nousagerequired)ModelService.buildModelApiUrlNew()setsblockPrivate=falsefor Ollama endpointsSsrfParamGuardhonorsblockPrivate: when false, only explicit IP blacklist applies (not default private-network denial)usageand localhost:11434URL buildingTesting
Added:
ModelServiceTest.testValidateModel_ollamaResponseWithoutUsage_successModelServiceTest.buildModelApiUrlAllowsPrivateIpForOllamaEndpointProve-it (bug on current main):
usage— seeModelService.isValidModelResponse()and existingtestValidateModel_responseNotCompatible_throwswhich asserts missingusageis rejected.buildModelApiUrlRejectsPrivateIpWhenBlacklistIsEmptywhich assertshttp://192.168.xis rejected even with empty blacklist; Ollama on127.0.0.1:11434hit the same path.Screenshots (if applicable)
N/A (backend validation fix)
Checklist
Made-with: Cursor (Composer)
Made with Cursor