fix(agent): skip local server probes on known public endpoints - #61692
Closed
kyssta-exe wants to merge 1 commit into
Closed
fix(agent): skip local server probes on known public endpoints#61692kyssta-exe wants to merge 1 commit into
kyssta-exe wants to merge 1 commit into
Conversation
detect_local_server_type() probes for Ollama/LM Studio/vLLM/llama.cpp by sending GET requests to paths like /api/tags, /v1/props, /version. When the configured base_url is a well-known public endpoint like api.openai.com, these probes produce harmless but noisy 404s that: - Pollute egress logs - Trigger false-positive alerts in monitoring - Make it harder to distinguish real issues (NousResearch#61421) Fix: add _is_likely_local_network() helper that returns True only for localhost, 127.0.0.1, private IPv4 ranges (10.x, 172.16-31.x, 192.168.x), Docker internal hosts, and Unix socket paths. When the endpoint is NOT on a local/private network, skip probing entirely and return None. This is semantically correct: the function is called 'detect_local_server_type' — it should only probe endpoints that could plausibly be local servers. Closes NousResearch#61421
Collaborator
Related: competing with #61428 (both fix #61421). This PR uses an allowlist approach ( |
Contributor
|
Thanks for tracing the noisy public-endpoint probes. The premise is confirmed on current main: Problems
Suggested changes
Automated hermes-sweeper review. |
Contributor
Author
|
Stale — no merge activity for 4-6 days. Can resubmit if still needed. |
1 task
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
detect_local_server_type()probes for Ollama/LM Studio/vLLM/llama.cpp by sending GET requests to paths like/api/tags,/v1/props,/versionon the configured base URL. When the base URL ishttps://api.openai.com/v1, these probes produce harmless but noisy 404s that pollute egress logs and trigger false-positive monitoring alerts (#61421).Fix
Add
_is_likely_local_network()helper that returnsTrueonly for local/private addresses: localhost, 127.0.0.1, 10.x.x.x, 172.16-31.x.x, 192.168.x.x, Docker internal hosts, and Unix sockets. When the endpoint is NOT local/private, skip probing and returnNone.Rationale
The function is named
detect_local_server_type— it semantically should only probe local endpoints. The previous behavior probed every endpoint including public cloud APIs, which is both wasteful and noisy.Test Plan
localhost/127.0.0.1/192.168.x.xaddresses — all continue to pass.detect_local_server_type("https://api.openai.com/v1")now returnsNoneimmediately without any HTTP traffic.Closes #61421