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:
vominh1919 2026-04-28 13:18:04 +07:00 committed by Teknium
parent db305bba8b
commit 0169c51820
2 changed files with 15 additions and 1 deletions

View file

@ -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 = {