fix(runtime): surface malformed proxy env before client init#6403
fix(runtime): surface malformed proxy env before client init#6403MestreY0d4-Uninter wants to merge 1 commit into
Conversation
|
Refreshed this PR against current The old branch had accumulated stacked unrelated commits ( Validation run:
Result:
This is now a much cleaner review unit for the actual issue this PR is meant to solve. |
4fc121b to
cc9adc1
Compare
cc9adc1 to
41bc069
Compare
|
Final validation pass on current main base is complete. What I rechecked:
Concrete results:
I also rebuilt this branch so it now contains only the proxy/runtime hardening fix (dropping the unrelated stacked commits that had accumulated on the old branch). This one is ready for review/merge. |
|
Merged via PR #10545. Your commit was cherry-picked onto current main with your authorship preserved in git log. Thanks for the thorough detective work tracking this down from the cryptic error to the proxy env var root cause — great issue investigation @MestreY0d4-Uninter! |
Summary
Invalid portRoot cause
I initially suspected a malformed persisted custom endpoint URL because the user-facing error was:
Invalid port: 6153exportBut after the reporter shared their redacted config files, the diagnosis changed:
config.yamlwas cleanauth.jsonwas clean6153exportvalue in uploaded config/auth dataI then reproduced the exact failure by setting a malformed proxy environment variable such as:
HTTP_PROXY=http://127.0.0.1:6153exportThat triggers the same stack trace through
httpx/openaiclient creation:InvalidURLInvalid port: '6153export'So the stronger root cause for issue #6360 is malformed inherited proxy env, not a saved custom endpoint URL.
Fix
HTTP_PROXY,HTTPS_PROXY,ALL_PROXY(and lowercase variants) before creating OpenAI-compatible clientsrun_agent.pyagent/auxiliary_client.pyMalformed proxy environment variable HTTP_PROXY='http://127.0.0.1:6153export'. Fix or unset your proxy settings and try again.Validation
Direct reproduction used during investigation:
HTTP_PROXY=http://127.0.0.1:6153exporthttpx.InvalidURL: Invalid port: '6153export'RuntimeErroridentifying the broken proxy env varAutomated checks run locally:
pytest tests/run_agent/test_endpoint_and_proxy_validation.py -q -o addopts=python -m py_compile run_agent.py agent/auxiliary_client.py tests/run_agent/test_endpoint_and_proxy_validation.pyNotes
Closes #6360