Repository navigation
fix(studio/llama_cpp): disable trust_env on the loopback health probe (#6750) - #6752
Conversation
_wait_for_health() polls http://127.0.0.1:<port>/health with the default httpx trust_env=True, so an ambient HTTP(S)_PROXY in the environment is applied to the loopback request. A proxy that returns 503 for 127.0.0.1 makes every probe fail, so the loop runs until timeout and Studio load hangs (trust_env=False returns 200 immediately). Pass trust_env=False so the local readiness probe never goes through a proxy. This mirrors the existing trust_env=False handling in the sibling llama_http / external_provider HTTP clients.
There was a problem hiding this comment.
Code Review
This pull request updates the loopback health probe in llama_cpp.py to disable environment proxy settings (trust_env=False), preventing loopback requests from being routed through ambient proxies. The reviewer suggests using urllib.request to handle proxy environment variables and TLS/certificate failures, although this suggestion is aimed at external endpoints rather than loopback probes.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
_wait_for_health now calls httpx.get(..., trust_env=False); update the retry test's fake_get to accept the kwarg so it doesn't raise TypeError.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2493f98307
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…t-env # Conflicts: # studio/backend/core/inference/llama_cpp.py
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 85e6b8fd32
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
What
LlamaCppBackend._wait_for_health()pollshttp://127.0.0.1:<port>/healthwithhttpx.get(url, timeout=2.0).httpxdefaults totrust_env=True, so an ambientHTTP_PROXY/HTTPS_PROXYin the environment is applied even to the loopback request.When such a proxy returns
503for127.0.0.1(a common corporate-proxy setup), every probe fails, the loop runs until the full timeout, and Studio load hangs. As reported in #6750:Fix
Pass
trust_env=Falseto the loopback readiness probe so it never routes through a proxy. This mirrors the existingtrust_env=Falsehandling already used by the sibling HTTP clients incore/inference/llama_http.pyandcore/inference/external_provider.py.Scope is intentionally limited to the health probe (the reported hang). The separate Darwin/Metal SIGTERM hard-kill suggestion in the issue is a distinct process-lifecycle concern and is left for a follow-up.
Fixes #6750
🤖 Generated with Claude Code