Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions hermes_cli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2188,6 +2188,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:
Expand Down
23 changes: 23 additions & 0 deletions tests/hermes_cli/test_provider_config_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,26 @@ def test_models_empty_list_omitted(self):
result = _normalize_custom_provider_entry(entry)
assert result is not None
assert "models" not in result

def test_timeout_keys_not_warned(self, caplog):
"""request_timeout_seconds and stale_timeout_seconds are valid runtime
keys (read by hermes_cli/timeouts.py) and documented in
cli-config.yaml.example, so the validator must not flag them as
unknown. Regression for #16779."""
entry = {
"base_url": "https://api.example.com/v1",
"api_key": "sk-test-key",
"request_timeout_seconds": 600,
"stale_timeout_seconds": 900,
}
with caplog.at_level(logging.WARNING):
result = _normalize_custom_provider_entry(entry, provider_key="myhost")
assert result is not None
unknown_warnings = [
r for r in caplog.records
if "unknown config keys" in r.message.lower()
]
assert unknown_warnings == [], (
f"timeout keys should not trigger 'unknown config keys' warning, "
f"got: {[r.message for r in unknown_warnings]}"
)
Loading