feat: auto-detect models from server probe in custom endpoint setup#4218
Merged
Conversation
Custom endpoint setup (_model_flow_custom) now probes the server first and presents detected models instead of asking users to type blind: - Single model: auto-confirms with Y/n prompt - Multiple models: numbered list picker, or type a name - No models / probe failed: falls back to manual input Context length prompt also moved after model selection so the user sees the verified endpoint before being asked for details. All recent fixes preserved: config dict sync (#4172), api_key persistence (#4182), no save_env_value for URLs (#4165). Inspired by PR #4194 by sudoingX — re-implemented against current main.
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 27, 2026
…ousResearch#4218) Custom endpoint setup (_model_flow_custom) now probes the server first and presents detected models instead of asking users to type blind: - Single model: auto-confirms with Y/n prompt - Multiple models: numbered list picker, or type a name - No models / probe failed: falls back to manual input Context length prompt also moved after model selection so the user sees the verified endpoint before being asked for details. All recent fixes preserved: config dict sync (NousResearch#4172), api_key persistence (NousResearch#4182), no save_env_value for URLs (NousResearch#4165). Inspired by PR NousResearch#4194 by sudoingX — re-implemented against current main. Co-authored-by: Xpress AI (Dip KD) <200180104+sudoingX@users.noreply.github.com>
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
…ousResearch#4218) Custom endpoint setup (_model_flow_custom) now probes the server first and presents detected models instead of asking users to type blind: - Single model: auto-confirms with Y/n prompt - Multiple models: numbered list picker, or type a name - No models / probe failed: falls back to manual input Context length prompt also moved after model selection so the user sees the verified endpoint before being asked for details. All recent fixes preserved: config dict sync (NousResearch#4172), api_key persistence (NousResearch#4182), no save_env_value for URLs (NousResearch#4165). Inspired by PR NousResearch#4194 by sudoingX — re-implemented against current main. Co-authored-by: Xpress AI (Dip KD) <200180104+sudoingX@users.noreply.github.com>
olympus-terminal
pushed a commit
to olympus-terminal/hermes-agent
that referenced
this pull request
May 16, 2026
…ousResearch#4218) Custom endpoint setup (_model_flow_custom) now probes the server first and presents detected models instead of asking users to type blind: - Single model: auto-confirms with Y/n prompt - Multiple models: numbered list picker, or type a name - No models / probe failed: falls back to manual input Context length prompt also moved after model selection so the user sees the verified endpoint before being asked for details. All recent fixes preserved: config dict sync (NousResearch#4172), api_key persistence (NousResearch#4182), no save_env_value for URLs (NousResearch#4165). Inspired by PR NousResearch#4194 by sudoingX — re-implemented against current main. Co-authored-by: Xpress AI (Dip KD) <200180104+sudoingX@users.noreply.github.com>
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
…ousResearch#4218) Custom endpoint setup (_model_flow_custom) now probes the server first and presents detected models instead of asking users to type blind: - Single model: auto-confirms with Y/n prompt - Multiple models: numbered list picker, or type a name - No models / probe failed: falls back to manual input Context length prompt also moved after model selection so the user sees the verified endpoint before being asked for details. All recent fixes preserved: config dict sync (NousResearch#4172), api_key persistence (NousResearch#4182), no save_env_value for URLs (NousResearch#4165). Inspired by PR NousResearch#4194 by sudoingX — re-implemented against current main. Co-authored-by: Xpress AI (Dip KD) <200180104+sudoingX@users.noreply.github.com>
Egavasyug
pushed a commit
to Egavasyug/hermes-agent
that referenced
this pull request
Jun 10, 2026
…ousResearch#4218) Custom endpoint setup (_model_flow_custom) now probes the server first and presents detected models instead of asking users to type blind: - Single model: auto-confirms with Y/n prompt - Multiple models: numbered list picker, or type a name - No models / probe failed: falls back to manual input Context length prompt also moved after model selection so the user sees the verified endpoint before being asked for details. All recent fixes preserved: config dict sync (NousResearch#4172), api_key persistence (NousResearch#4182), no save_env_value for URLs (NousResearch#4165). Inspired by PR NousResearch#4194 by sudoingX — re-implemented against current main. Co-authored-by: Xpress AI (Dip KD) <200180104+sudoingX@users.noreply.github.com>
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
Re-implements the custom endpoint model flow change from PR #4194 (by @sudoingX) against current main. The original PR couldn't be cherry-picked due to three recent refactors (#4165, #4172, #4182) that significantly changed
_model_flow_custom.What changed
_model_flow_customnow probes the server before asking for a model name and uses the results:Use this model? [Y/n]:(Enter to confirm)Context length prompt also moved after model selection — the user sees the verified endpoint status before being asked for details.
What's preserved (unchanged)
All three recent fixes in
_model_flow_customare untouched:config["model"] = dict(model)caller dict sync ([Bug] Provider auto-detection ignores model.provider in config.yaml — stale API keys override explicit custom endpoint #4172)model["api_key"] = effective_keypersistence (fix(setup): save API key to model config for custom endpoints #4182)save_env_value("OPENAI_BASE_URL", ...)calls (refactor: make config.yaml the single source of truth for endpoint URLs #4165)Affected paths
Both
hermes model(viaselect_provider_and_model) andhermes setup(viasetup_model_provider) call_model_flow_custom, so both get the improvement.Tests
Updated
test_model_flow_custom_saves_verified_v1_base_urlto match the new input sequence (confirm detected model instead of typing it). 956 tests pass; 2 pre-existing test pollution failures unrelated to this change (confirmed same on clean main).Credit: @sudoingX for the original idea and approach in PR #4194.