Respect configured ZAI base URL - #37816
Conversation
|
This PR and #62467 solve the same problem from different angles. What this PR does well: targets the specific case where What #62467 adds on top:
If this PR merges first, #62467 will automatically rebase on top (the resolver will call through the fixed path). If #62467 merges first, this PR's logic is absorbed into the unified resolver Step 3-5. |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for targeting the remaining Z.AI configuration gap. The auxiliary pool path on current main still derives its endpoint from the selected pool entry at agent/auxiliary_client.py:1855-1862, so the underlying issue is real.
Problems
- The added early return in
agent/auxiliary_client.pyoverrides every Z.AI pool entry whenmodel.base_urlis set. That discards deliberately pinned per-credential endpoints. Current runtime resolution preserves those entries by applying config only when the pool URL equals the registry default (hermes_cli/runtime_provider.py:481-491). - The new test covers only a default/stale pool URL, not an explicit non-default pool URL.
Suggested changes
- Gate the auxiliary config override on the same
pool_url_is_defaultcondition used byhermes_cli/runtime_provider.py:487-491. - Add a test proving an explicit Z.AI pool endpoint is retained while a default endpoint is overridden.
Automated hermes-sweeper review.
| return _config_model_base_url(provider_id) | ||
| except Exception: | ||
| return "" | ||
|
|
There was a problem hiding this comment.
This applies model.base_url before examining the selected pool entry, so it also replaces a deliberately pinned non-default Z.AI endpoint. Please mirror the pool_url_is_default guard in hermes_cli/runtime_provider.py:487-491, and add coverage for retaining an explicit pool URL.
Fixes #18302.
Summary
model.base_urlfor ZAI afterGLM_BASE_URLand before endpoint probing/defaults/api/paas/v4Verification
python -m py_compile hermes_cli/auth.py agent/auxiliary_client.py tests/hermes_cli/test_api_key_providers.py tests/agent/test_auxiliary_client.pyPYTHONPATH=/Users/zhangrong/Documents/home/.pytest-shim:/Users/zhangrong/Documents/home/hermes-agent python -m pytest -q tests/hermes_cli/test_api_key_providers.py::TestZaiEndpointAutoDetect::test_config_base_url_skips_probe tests/agent/test_auxiliary_client.py::test_zai_pool_base_url_honors_config_override2 passed, 8 warningsNote: local Conda Python segfaults when importing native
readline, so the targeted pytest run used a temporarysitecustomize.pyshim that preloads a no-opreadlinemodule.