mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-03 02:11:48 +00:00
fix(delegate): honor runtime default model during provider resolution
This commit is contained in:
parent
b29b709a71
commit
9ae1fa9e39
2 changed files with 21 additions and 1 deletions
|
|
@ -786,6 +786,26 @@ class TestDelegationCredentialResolution(unittest.TestCase):
|
|||
self.assertEqual(creds["api_mode"], "chat_completions")
|
||||
mock_resolve.assert_called_once_with(requested="openrouter")
|
||||
|
||||
@patch("hermes_cli.runtime_provider.resolve_runtime_provider")
|
||||
def test_provider_resolution_uses_runtime_model_when_config_model_missing(self, mock_resolve):
|
||||
"""Named providers should propagate their runtime default model to children."""
|
||||
mock_resolve.return_value = {
|
||||
"provider": "custom",
|
||||
"base_url": "https://my-server.example/v1",
|
||||
"api_key": "sk-test-key",
|
||||
"api_mode": "chat_completions",
|
||||
"model": "server-default-model",
|
||||
}
|
||||
parent = _make_mock_parent(depth=0)
|
||||
cfg = {"provider": "custom:my-server", "model": ""}
|
||||
|
||||
creds = _resolve_delegation_credentials(cfg, parent)
|
||||
|
||||
self.assertEqual(creds["model"], "server-default-model")
|
||||
self.assertEqual(creds["provider"], "custom")
|
||||
self.assertEqual(creds["base_url"], "https://my-server.example/v1")
|
||||
mock_resolve.assert_called_once_with(requested="custom:my-server")
|
||||
|
||||
def test_direct_endpoint_uses_configured_base_url_and_api_key(self):
|
||||
parent = _make_mock_parent(depth=0)
|
||||
cfg = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue