Skip to content

fix(gateway): preserve custom runtime model#14386

Open
sgaofen wants to merge 1 commit into
NousResearch:mainfrom
sgaofen:codex/fix-14189-ollama-custom-model
Open

fix(gateway): preserve custom runtime model#14386
sgaofen wants to merge 1 commit into
NousResearch:mainfrom
sgaofen:codex/fix-14189-ollama-custom-model

Conversation

@sgaofen

@sgaofen sgaofen commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Root cause

Remote/custom Ollama-compatible endpoints could resolve provider credentials as provider=custom but drop the configured model name before gateway-created agents were constructed. The gateway then fell back to the provider catalog default for custom, which is empty, causing OpenAI-compatible local servers to reject requests with model is required.

Tests

  • /Users/stephenyu/Documents/hermes-agent/.venv/bin/python -m pytest tests/hermes_cli/test_runtime_provider_resolution.py::test_plain_custom_runtime_propagates_config_model tests/hermes_cli/test_runtime_provider_resolution.py::test_plain_custom_runtime_propagates_config_model_pool_path tests/gateway/test_session_model_override_routing.py::test_runtime_agent_kwargs_preserves_runtime_model tests/gateway/test_session_model_override_routing.py::test_session_runtime_inherits_custom_model_from_runtime -q -> 4 passed
  • /Users/stephenyu/Documents/hermes-agent/.venv/bin/python -m pytest tests/hermes_cli/test_runtime_provider_resolution.py tests/gateway/test_session_model_override_routing.py -q -> 77 passed
  • /Users/stephenyu/Documents/hermes-agent/.venv/bin/python -m pytest tests/gateway/test_compress_command.py tests/gateway/test_compress_focus.py tests/gateway/test_session_model_override_routing.py -q -> 8 passed
  • git diff --check

Notes

  • I also tried /Users/stephenyu/Documents/hermes-agent/.venv/bin/python -m pytest tests/gateway/test_agent_cache.py tests/gateway/test_model_switch_persistence.py -q; the only failure was the existing macOS-local terminal cleanup assertion in tests/gateway/test_agent_cache.py::TestAgentCacheIdleResume::test_close_vs_release_full_teardown_difference, unrelated to this model routing change.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery comp/cli CLI entry point, hermes_cli/, setup wizard labels Apr 23, 2026
@sgaofen

sgaofen commented Apr 23, 2026

Copy link
Copy Markdown
Contributor Author

CI note: the failing test job is hitting the same current-main baseline failures covered by #13352 (which is now green and mergeable). The targeted checks for this PR still pass locally:

  • python -m pytest tests/hermes_cli/test_runtime_provider_resolution.py tests/gateway/test_session_model_override_routing.py -q -> 77 passed
  • python -m pytest tests/gateway/test_compress_command.py tests/gateway/test_compress_focus.py tests/gateway/test_session_model_override_routing.py -q -> 8 passed

Once #13352 lands, I can re-run/rebase this branch to confirm the full suite on the fixed baseline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: openai client cannot get the right model info from local Ollama service

2 participants