feat(setup): Z.AI endpoint picker for Global/China/Coding Plan selection - #52364
Merged
kshitijk4poor merged 4 commits intoJun 25, 2026
Merged
Conversation
Presents a curses-based picker (via _prompt_provider_choice) offering the four official Z.AI endpoints — Global, China, Coding Plan Global, Coding Plan China — plus a custom-proxy option. Sourced from ZAI_ENDPOINTS in auth.py so it stays in sync with the probe list. Not yet wired into the setup flow; that comes in the next commit.
When provider_id == 'zai', replace the plain text Base URL input with _select_zai_endpoint, which presents a curses picker offering Global, China, Coding Plan Global, Coding Plan China, and custom proxy options. Other API-key providers (MiniMax, DeepSeek, etc.) keep the text input.
…niMax Z.AI now uses a curses picker instead of plain text input for base URL, so the existing TestBaseUrlValidation tests (which used zai as their test subject) are migrated to MiniMax, which still uses the text input path. Add TestZaiEndpointPicker covering: - Selecting each official endpoint (Global, China, Coding Plan Global, Coding Plan China) saves the correct base URL to config - Custom proxy URL entry (valid + invalid rejection) - Cancel keeps the existing base URL - Current endpoint is the default choice in the picker - Non-standard URL defaults to the Custom proxy option
- Remove dead `chosen_base or effective_base` fallback; _select_zai_endpoint
always returns a non-empty base URL (returns current_base on cancel).
- Add .rstrip("/") to official-endpoint return for symmetry with custom-proxy
path (both now return normalized URLs).
- Replace magic index 4 with len(ZAI_ENDPOINTS) in custom-proxy tests so they
don't break if a 5th endpoint is added to ZAI_ENDPOINTS.
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.
Summary
Z.AI setup now presents a curses-based endpoint picker instead of a plain text input, letting users explicitly choose between Global, China, Coding Plan Global, Coding Plan China, or a custom proxy URL.
Changes
hermes_cli/model_setup_flows.py: Add_select_zai_endpoint()helper that presents a_prompt_provider_choicepicker sourced fromZAI_ENDPOINTSinauth.py(stays in sync with the probe list). Wire it into_model_flow_api_key_providerforprovider_id == "zai"; other API-key providers keep the text input.tests/hermes_cli/test_model_provider_persistence.py: MigrateTestBaseUrlValidationfromzaitominimax(zai no longer usesinput()for base URL). AddTestZaiEndpointPickercovering each endpoint selection, custom proxy (valid + invalid), cancel, default selection, and custom-URL default behavior.Validation
input()prompt3 commits:
feat(setup): add _select_zai_endpoint helper for Z.AI endpoint pickerfeat(setup): wire Z.AI endpoint picker into _model_flow_api_key_providertest(setup): add ZAI endpoint picker tests, move base-URL tests to MiniMax