Repository navigation
fix(ai): the MCP prewarm tool takes no URL from the model - #2677
Merged
Merged
Conversation
The MCP tool ai_prewarm published the option url. A model could give a loopback URL that ends in ?x=. The tool then sent a POST request to any path of any loopback service, and told the model if the answer was HTTP 200. The tool now publishes no url option. It prewarms the servers of ai.ollama_urls, at the configured egress level. A call that gives url fails at the argument contract and sends no request. The command keeps --url for a person at the command line. This is the same cause as #2480 and #2634: input from a caller is used as configuration. The change uses the _PATH_PARAM_RESTRICTIONS table of the MCP generator and plans the work as an OpenSpec change.
The test of the configured servers checked only the request line, the Host header and the reply text. It now reads the JSON body of each POST request and checks the model name and the keep-alive value.
The design said that the model does not know the configured Ollama URLs. The reply of the tool names each server by its URL, so the design now says that and points to the issue for it. The proposal lists the real callers of preload_models. The follow-up list names the new issue.
Owner
Author
|
Test results at the head of this branch:
Output of |
dan-petty
marked this pull request as ready for review
October 29, 2026 15:50
dan-petty-release Bot
added a commit
that referenced
this pull request
Oct 29, 2026
🤖 I have created a release *beep* *boop* --- ## [0.16.6](v0.16.5...v0.16.6) (2026-10-29) ### Bug Fixes * **ai:** the MCP prewarm tool takes no URL from the model ([#2677](#2677)) ([edf5325](edf5325)), closes [#2637](#2637) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
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.
The MCP tool
ai_prewarmpublished the optionurl. A model could give a loopback URL that ends in?x=. The tool then sent a POST request to any path of any loopback service. It also told the model if the answer was HTTP 200.The tool now publishes no
urloption, through_PATH_PARAM_RESTRICTIONS. It prewarms the servers ofai.ollama_urlsat the configured egress level. A call that givesurlfails at the argument contract and sends no request. The commanddevops ai prewarmkeeps--urlfor a person at the command line.The cause is the same as in #2480 and #2634: input from a caller is used as configuration. The change adds the capability
ai-prewarmand two tests that fail onmain.Related issues that this change does not cover: #2638 and #2639 (two other MCP tools with a URL option), #2670 (a wrong sentence in
SECURITY.md) and #2676 (the prewarm output names a server by its configured URL).Change: openspec/changes/archive/2026-10-29-2637-ai-prewarm-mcp-tool-no-url/
Closes #2637