Skip to content

docs: document OpenRouter model ID invalidation and fallback best practices - #40087

Closed
alaamohanad169-ship-it wants to merge 1 commit into
NousResearch:mainfrom
alaamohanad169-ship-it:auto-fix-40066
Closed

docs: document OpenRouter model ID invalidation and fallback best practices#40087
alaamohanad169-ship-it wants to merge 1 commit into
NousResearch:mainfrom
alaamohanad169-ship-it:auto-fix-40066

Conversation

@alaamohanad169-ship-it

Copy link
Copy Markdown
Contributor

Summary

Adds a new Known Pitfall entry to AGENTS.md documenting the OpenRouter model ID invalidation issue (tracked in #40066).

What's Documented

  • Upstream providers (Fireworks, DeepInfra) can rename/pull model IDs on OpenRouter without notice
  • Example: accounts/fireworks/models/deepseek-v4-pro → HTTP 400 "is not a valid model ID"
  • How Hermes already handles this correctly:
    • Error classifier classifies as model_not_found with retryable=False, should_fallback=True
    • _classify_400() catches "is not a valid model" in 400 responses
    • _is_model_not_found_error() covers cron/worker/compression paths
    • Conversation loop skips retries and immediately tries fallback
  • Best practices: configure fallback_providers, pin cron to stable direct-serving endpoints

Verification

  • Read the relevant code paths to confirm accuracy:
    • agent/error_classifier.py_classify_400() line ~984 checks _MODEL_NOT_FOUND_PATTERNS
    • agent/auxiliary_client.py_is_model_not_found_error() covers same patterns
    • agent/conversation_loop.py — non-retryable client errors route to _try_activate_fallback()

Closes #40066

…ctices

Adds a new Known Pitfall entry to AGENTS.md explaining that OpenRouter
model IDs (like accounts/fireworks/models/deepseek-v4-pro) can be
invalidated by upstream hosting providers without notice.

Documents:
- How the error classifier already handles this (model_not_found with
  retryable=False, should_fallback=True)
- That _classify_400(), _is_model_not_found_error(), and the
  conversation_loop fallback mechanism all cover this case
- Best practice: configure fallback_providers and pin cron/worker
  sessions to stable direct-serving endpoints

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

Labels

P3 Low — cosmetic, nice to have provider/openrouter OpenRouter aggregator type/docs Documentation improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: OpenRouter model ID accounts/fireworks/models/deepseek-v4-pro invalidated — Hermes loops on 400 instead of fast-fallback

2 participants