Skip to content

fix(auxiliary): use default 600s TTL when provider permanently unavailable (#59984) - #60357

Open
ms-alan wants to merge 1 commit into
NousResearch:mainfrom
ms-alan:fix/59984-auxiliary-unhealthy-ttl
Open

ms-alan wants to merge 1 commit into
NousResearch:mainfrom
ms-alan:fix/59984-auxiliary-unhealthy-ttl

Conversation

@ms-alan

@ms-alan ms-alan commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

When OpenRouter or Nous credentials are not configured, was called with instead of the default 600s. The 60s TTL was designed for transient payment errors (402), but missing credentials are permanent configuration state — after 60s the unhealthy mark expires, the provider is retried, fails identically, and logs another WARNING. This floods with thousands of identical lines.

Fix

Remove the override when marking OpenRouter and Nous as permanently unavailable (no credentials), allowing them to use the default 600s TTL instead.

Closes #59984

…lable (NousResearch#59984)

When OpenRouter/Nous credentials are missing, _mark_provider_unhealthy was
called with ttl=60 instead of the default 600s. The 60s TTL was designed
for transient payment errors (402), but missing credentials are permanent.
After 60s the unhealthy mark expires, the provider is retried, fails
identically, and logs another WARNING — flooding errors.log for the
lifetime of the process.

Use the default 600s TTL (omit ttl=) for permanently unavailable
providers so the warning is not repeated every minute.
@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint area/auth Authentication, OAuth, credential pools P3 Low — cosmetic, nice to have labels Jul 7, 2026

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for targeting a real current-main retry path: the 60-second marks remain at agent/auxiliary_client.py:2003 and :2047.

Problems

  • The PR changes the OpenRouter call but not tests/agent/test_auxiliary_client.py:1131, which currently asserts mock_mark.assert_called_once_with("openrouter", ttl=60). The current PR diff changes no tests.
  • The same unavailable-credential class also exists at agent/auxiliary_client.py:2095 (Nous auth exists but no usable inference JWT), where ttl=60 remains.
  • Commit 057f5a31d1b2358c8a1781c102a1e4401770e239 introduced the short TTL specifically for missing credentials, so changing it needs an explicit regression contract for credential rediscovery in long-running processes.

Suggested changes

  • Update the existing assertion and add direct coverage for both no-auth and no-usable-JWT Nous paths.
  • Apply the intended TTL policy consistently across those paths, with a test that captures the desired rediscovery behavior.

Automated hermes-sweeper review.

Comment thread agent/auxiliary_client.py
if not or_key:
_mark_provider_unhealthy("openrouter", ttl=60)
_mark_provider_unhealthy("openrouter")
return None, None

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This changes a current tested contract: tests/agent/test_auxiliary_client.py:1131 asserts this call includes ttl=60, but this PR does not update that test. Please update the assertion and add coverage for the corresponding Nous no-credential paths.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/auth Authentication, OAuth, credential pools comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Auxiliary client WARNING-spams errors.log for unconfigured providers (OpenRouter/Nous every 60s)

3 participants