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
@ -2205,6 +2205,7 @@ def _normalize_custom_provider_entry(
|
||||
"name", "api", "url", "base_url", "api_key", "key_env",
|
||||
"api_mode", "transport", "model", "default_model", "models",
|
||||
"context_length", "rate_limit_delay",
|
||||
"request_timeout_seconds", "stale_timeout_seconds",
|
||||
}
|
||||
for camel, snake in _CAMEL_ALIASES.items():
|
||||
if camel in entry and snake not in entry:
|
||||
|
||||
@ -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…
Reference in New Issue
Block a user