Skip to content

fix(config): accept request_timeout_seconds / stale_timeout_seconds in providers entries (#16779)#16786

Closed
briandevans wants to merge 1 commit into
NousResearch:mainfrom
briandevans:fix/providers-validator-timeout-keys-16779
Closed

fix(config): accept request_timeout_seconds / stale_timeout_seconds in providers entries (#16779)#16786
briandevans wants to merge 1 commit into
NousResearch:mainfrom
briandevans:fix/providers-validator-timeout-keys-16779

Conversation

@briandevans

Copy link
Copy Markdown
Contributor

Summary

  • _normalize_custom_provider_entry()'s _KNOWN_KEYS set was missing request_timeout_seconds and stale_timeout_seconds, both of which are valid runtime keys and are documented in cli-config.yaml.example.
  • Result: every CLI invocation that follows the documented example prints a spurious unknown config keys ignored: request_timeout_seconds, stale_timeout_seconds warning, even though hermes_cli/timeouts.py reads and applies both keys correctly.
  • Fix: add the two keys to _KNOWN_KEYS. One-line addition, plus a regression test.

The bug

hermes_cli/config.py:2187-2191 (pre-fix):

_KNOWN_KEYS = {
    "name", "api", "url", "base_url", "api_key", "key_env",
    "api_mode", "transport", "model", "default_model", "models",
    "context_length", "rate_limit_delay",
}

But hermes_cli/timeouts.py reads:

  • request_timeout_seconds at line 40 (get_provider_request_timeout).
  • stale_timeout_seconds at lines 65 and 69 (get_provider_stale_timeout).

And cli-config.yaml.example documents both keys under the top-level providers: block (request_timeout_seconds: 300, stale_timeout_seconds: 900, etc.).

So users following the documented example see the validator complain about keys it actually accepts. That's not just noise: a "validator" warning telling users a key is "ignored" trains them to delete keys that are in fact load-bearing for their endpoint behavior.

The fix

Add both keys to the existing _KNOWN_KEYS set in _normalize_custom_provider_entry(). No other path needs changing — the runtime readers in timeouts.py already do the right thing.

Test plan

  • Focused regression test: test_timeout_keys_not_warned in tests/hermes_cli/test_provider_config_validation.py — asserts a providers entry with both timeout keys produces zero "unknown config keys" warnings.
  • Adjacent suite: full tests/hermes_cli/test_provider_config_validation.py — 17 passed (16 existing + 1 new).
  • Regression guard: with only the test added (no _KNOWN_KEYS change), the test fails with AssertionError: ... got: ['providers.myhost: unknown config keys ignored: request_timeout_seconds, stale_timeout_seconds']. With the one-line fix applied, the test passes. So the test is genuinely guarding the runtime contract.

Related

…n providers entries (NousResearch#16779)

The providers-entry validator's `_KNOWN_KEYS` set in
`_normalize_custom_provider_entry()` was missing two keys that are
both **valid runtime config** and **documented in
`cli-config.yaml.example`**:

- `request_timeout_seconds` — read by
  `hermes_cli/timeouts.py:get_provider_request_timeout()` (line 40).
- `stale_timeout_seconds` — read by
  `hermes_cli/timeouts.py:get_provider_stale_timeout()` (lines 65, 69),
  for both per-model and per-provider levels.

Net effect: these keys still worked at runtime (the validator only
warns, doesn't strip), but every CLI invocation against the documented
example printed a noisy

    WARNING hermes_cli.config: providers.<name>: unknown config keys
    ignored: request_timeout_seconds, stale_timeout_seconds

That warning trains users to delete keys that are actually load-bearing,
so this is more than cosmetic.

Fix: add both keys to `_KNOWN_KEYS`. They were already correctly read
by `timeouts.py` — only the validator was out of sync with the
documented schema and runtime readers.

Regression test (`test_timeout_keys_not_warned`): confirms a providers
entry with both timeout keys produces zero `"unknown config keys"`
warnings. Verified the test fails on plain `origin/main` (warning is
emitted as expected) and passes after the one-line fix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 28, 2026 03:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes provider-config validation noise by aligning _normalize_custom_provider_entry()’s _KNOWN_KEYS with the runtime-supported and documented provider timeout keys, preventing misleading “unknown config keys ignored” warnings for valid settings.

Changes:

  • Add request_timeout_seconds and stale_timeout_seconds to the provider entry _KNOWN_KEYS allowlist.
  • Add a regression test ensuring these timeout keys do not trigger “unknown config keys” warnings.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
hermes_cli/config.py Extends _KNOWN_KEYS in _normalize_custom_provider_entry() to recognize the two timeout keys as valid.
tests/hermes_cli/test_provider_config_validation.py Adds regression coverage asserting no “unknown config keys” warning is emitted when those timeout keys are present.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists area/config Config system, migrations, profiles comp/cli CLI entry point, hermes_cli/, setup wizard labels Apr 28, 2026
@briandevans

Copy link
Copy Markdown
Contributor Author

CI audit — all 19 test job failures are pre-existing baselines on clean origin/main (a7cdd41). Zero failures intersect with the touched code (hermes_cli/config.py allowlist + new test in tests/hermes_cli/test_provider_config_validation.py).

Test Symptom Reproduces on main?
tests/gateway/test_agent_cache.py::TestAgentCacheSpilloverLive::test_concurrent_inserts_settle_at_cap TimeoutError: Test exceeded 30 second timeout yes
tests/gateway/test_run_progress_topics.py::test_run_agent_progress_uses_event_message_id_for_slack_dm TypeError: 'NoneType' object is not callable yes
tests/hermes_cli/test_pty_bridge.py::TestPtyBridgeResize::test_resize_updates_child_winsize tput: No value for $TERM and no -T specified yes
tests/hermes_cli/test_cmd_update.py::TestCmdUpdateBranchFallback::test_update_refreshes_repo_and_tui_node_dependencies call-args mismatch yes
tests/hermes_cli/test_config_env_expansion.py::TestLoadConfigExpansion::test_load_config_expands_env_vars TypeError: string indices must be integers, not 'str' yes
tests/hermes_cli/test_config_env_expansion.py::TestLoadConfigExpansion::test_load_config_unresolved_kept_verbatim TypeError: string indices must be integers, not 'str' yes
tests/hermes_cli/test_web_server.py::TestBuildSchemaFromConfig::test_no_single_field_categories Category 'prompt_caching' has only 1 field(s) yes
tests/run_agent/test_background_review_toolset_restriction.py::test_background_review_agent_uses_restricted_toolsets AIAgent.__init__ was not called yes
tests/hermes_cli/test_web_server.py::TestPtyWebSocket::test_resize_escape_is_forwarded TimeoutError: Test exceeded 30 second timeout yes
tests/gateway/test_gateway_shutdown.py::test_cancel_background_tasks_cancels_inflight_message_processing TimeoutError yes
tests/gateway/test_session_split_brain_11016.py::TestAdapterSessionCancellation::test_command_cancels_active_task_and_unblocks_follow_up[/stop|/new|/reset] TimeoutError (3 params) yes
tests/run_agent/test_tool_arg_coercion.py::TestCoerceNumber::test_inf_stays_string_for_integer_only assert 'inf' == inf yes
tests/tools/test_clipboard.py::TestIsWsl::* result-cache leaks across xdist workers (different specific tests fail run-to-run) yes (same TestIsWsl class, different tests fail per xdist ordering)
tests/tui_gateway/test_make_agent_provider.py::test_make_agent_passes_resolved_provider call-args mismatch yes
tests/tui_gateway/test_protocol.py::test_session_resume_returns_hydrated_messages _DB.get_messages_as_conversation() got an unexpected keyword argument 'include_ancestors' yes

The PR only widens the _KNOWN_KEYS allowlist in _normalize_custom_provider_entry() — no behavior change for accepted/rejected configs, only the warning output. Happy to rebase on green main.

@briandevans

Copy link
Copy Markdown
Contributor Author

Closing — superseded by @teknium1's #16908 (salvaging @vominh1919's #16853), which landed first and is effectively the same fix.

Coverage comparison:

  • Root cause: Both PRs add request_timeout_seconds and stale_timeout_seconds to the provider-entry _KNOWN_KEYS allowlist in hermes_cli/config.py. Same one-line allowlist change.
  • Test coverage: Both add a regression test asserting the keys no longer trigger the unknown-config-keys warning. Same shape.

Nothing left to land here. Thanks @vominh1919 and @teknium1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provider validator's _KNOWN_KEYS is missing request_timeout_seconds / stale_timeout_seconds

3 participants