feat(cli): persist explicit api_mode for manual custom endpoints#13423
Closed
mslovy wants to merge 1 commit into
Closed
feat(cli): persist explicit api_mode for manual custom endpoints#13423mslovy wants to merge 1 commit into
mslovy wants to merge 1 commit into
Conversation
Manual custom endpoint setup always dropped model.api_mode and never saved api_mode into custom_providers. That worked for endpoints whose transport could be inferred from the URL, but broke CCH-style proxies whose base URLs are OpenAI-compatible while only supporting the codex_responses transport. - Adds an explicit api_mode prompt to the manual custom endpoint setup flow. - Persists explicit modes like codex_responses for CCH-style proxies whose URLs do not auto-detect correctly. - Keeps auto behavior by not persisting api_mode when the user chooses auto. - Updates saved custom_providers entries for the same endpoint without adding a new edit UI. - Adds regression coverage for explicit persistence, auto clearing, and custom provider upda
1 task
This was referenced Apr 30, 2026
Contributor
|
Closing as superseded by #25068. Triage notes (high confidence): Thanks for the contribution — the underlying problem this PR addresses has been resolved by the linked PR on current main. If you believe this was closed in error, please comment and we'll reopen. (Bulk-closed during a CLI PR triage sweep.) |
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
Manual custom endpoint setup now supports explicit
api_modeselection.Hermes already supports explicit transport routing such as
codex_responsesat runtime, but the manual custom endpoint flow did not expose that setting. It always relied on URL-based detection and cleared any explicitapi_modeduring save.That made some OpenAI-compatible relays and gateways hard to configure through the CLI. A common example is CCH-style proxies: the base URL does not look like the official OpenAI/Codex endpoint, so Hermes falls back to
chat_completions, while some relays only supportcodex_responses. Refer to Issue: #13415This change adds an explicit API mode prompt to the manual custom endpoint flow so users can choose the transport they need without depending entirely on URL heuristics.
Changes
API modeprompt to the manual custom endpoint flow inhermes_cli/main.pyautochat_completionscodex_responsesanthropic_messagesmodel.api_modecustom_providersentry for the endpointautobehavior as “unset”, so existing URL-based detection continues to work as beforeapi_modevalues when the same endpoint is reconfigured back toautotests/cli/test_cli_provider_resolution.pyfor:codex_responsespersistenceapi_modewhen switching back toautoValidation
Ran:
scripts/run_tests.sh tests/cli/test_cli_provider_resolution.py tests/hermes_cli/test_custom_provider_model_switch.py tests/hermes_cli/test_runtime_provider_resolution.py tests/hermes_cli/test_update_config_clears_custom_fields.py -qResult:
98 passed