mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-29 01:31:41 +00:00
fix(config): add request_timeout_seconds and stale_timeout_seconds to provider _KNOWN_KEYS
Both keys are documented in cli-config.yaml.example and read at runtime by hermes_cli/timeouts.py (get_provider_request_timeout and get_provider_stale_timeout), but the provider-entry validator in config.py flagged them as unknown, producing noisy warnings on every CLI invocation for users who followed the documented config. Fixes #16779
This commit is contained in:
parent
db305bba8b
commit
0169c51820
2 changed files with 15 additions and 1 deletions
|
|
@ -82,7 +82,7 @@ class TestNormalizeCustomProviderEntry:
|
|||
"""Unknown config keys should produce a warning."""
|
||||
entry = {
|
||||
"base_url": "https://api.example.com/v1",
|
||||
"api_key": "sk-test-key",
|
||||
"api_key": "***",
|
||||
"unknownField": "value",
|
||||
"anotherBad": 42,
|
||||
}
|
||||
|
|
@ -91,6 +91,19 @@ class TestNormalizeCustomProviderEntry:
|
|||
assert result is not None
|
||||
assert any("unknown config keys" in r.message.lower() for r in caplog.records)
|
||||
|
||||
def test_timeout_keys_not_flagged_unknown(self, caplog):
|
||||
"""request_timeout_seconds and stale_timeout_seconds should not produce warnings."""
|
||||
entry = {
|
||||
"base_url": "https://api.example.com/v1",
|
||||
"api_key": "***",
|
||||
"request_timeout_seconds": 300,
|
||||
"stale_timeout_seconds": 900,
|
||||
}
|
||||
with caplog.at_level(logging.WARNING):
|
||||
result = _normalize_custom_provider_entry(entry, provider_key="test")
|
||||
assert result is not None
|
||||
assert not any("unknown config keys" in r.message.lower() for r in caplog.records)
|
||||
|
||||
def test_camel_case_warning_logged(self, caplog):
|
||||
"""camelCase alias mapping should produce a warning."""
|
||||
entry = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue