Skip to content

[Bug]: cron jobs fail with provider.sort: Invalid input after v0.11.0 #20586

Closed

Description

@lapidem

Bug Description

All cron jobs fail consistently with OpenRouter API error provider.sort: Invalid input.

Steps to Reproduce

Cronjob("run")
モデル指定済みでも同じ provider.sort: Invalid input エラーです。これは cronインフラ内の OpenRouter provider 選択ロジックのバグと確定しました。

Expected Behavior

モデル指定済みでも同じ provider.sort: Invalid input エラーです。これは cronインフラ内の OpenRouter provider 選択ロジックのバグと確定しました。

Actual Behavior

provider.sort: Invalid input エラー

Affected Component

CLI (interactive chat)

Messaging Platform (if gateway-related)

No response

Debug Report

Report:       https://paste.rs/wY9Zj                                                                                        │
      agent.log:    https://dpaste.com/FNJ7ZSTLY                                                                                  │
      gateway.log:  https://dpaste.com/F7FDBSRTX

Operating System

macOS 26.3.1

Python Version

3.13.12

Hermes Version

Hermes Agent v0.12.0 (2026.4.30) Project: /Users/sirasawa/.hermes/hermes-agent Python: 3.11.15 OpenAI SDK: 2.32.0 Up to date

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Activity

  1. lapidem commented on May 6, 2026

    @lapidem
    Author

    調査結果 / Root Cause Found │
    │
    provider.sort: Invalid input エラーの原因は、~/.hermes/config.yaml の provider_routing.sort に不正な値 "intelligence" │
    が設定されていたためです。 ┃
    ┃
    OpenRouter API の provider.sort は以下の3値のみ受け付けます: ┃
    ┃
    • throughput ┃
    • latency ┃
    • price ┃
    ┃
    ご自分無くは hermes config set provider_routing.sort null で無効化し、Cronジョブが正常動作することを確認しました。 ┃
    ┃
    また provider_sort を空文字 "" にセットした場合も同様に OpenRouter から Invalid input が返される可能性があります。値が ┃
    truthy な場合のみ extra_body.provider に含めるような、入力値のバリデーション或いはフィルタリングが必要かもしれません。

  2. Ade5954 commented on May 6, 2026

    @Ade5954

    調査結果 / Root Cause Found │ │ provider.sort: Invalid input エラーの原因は、~/.hermes/config.yaml の provider_routing.sort に不正な値 "intelligence" │ が設定されていたためです。 ┃ ┃ OpenRouter API の provider.sort は以下の3値のみ受け付けます: ┃ ┃ • throughput ┃ • latency ┃ • price ┃ ┃ ご自分無くは hermes config set provider_routing.sort null で無効化し、Cronジョブが正常動作することを確認しました。 ┃ ┃ また provider_sort を空文字 "" にセットした場合も同様に OpenRouter から Invalid input が返される可能性があります。値が ┃ truthy な場合のみ extra_body.provider に含めるような、入力値のバリデーション或いはフィルタリングが必要かもしれません。

    yes you are right, "intelligence" isn't a valid sort value and OpenRouter rightfully rejected it. Your workaround (hermes config set provider_routing.sort null) is perfectly fine for unblocking your cron jobs right now.

    That said, I think there's a deeper problem here beyond just your config typo. The real bug is that Hermes blindly forwards whatever provider_routing.sort value it finds in config.yaml straight to OpenRouter, with zero validation. So this doesn't just affect you with "intelligence" — it affects anyone who:

    • Typo's the value (happens to the best of us)
    • Sets it to true or "" or some other non-string type by accident
    • Uses a value that's technically valid YAML but meaningless to OpenRouter

    I've put together a PR that builds a proper guardrail instead of just patching the symptom. It adds a whitelist ("price", "throughput", "latency") and silently drops anything that doesn't match — with a warning log so you know what happened, but no crash. It also handles the dict format ({"by": "price", "partition": "none"}) that OpenRouter supports.

    Same fix is applied in two places — the main request path and the iteration-limit summary path — plus an or {} safety net in the cron scheduler so None config values don't blow up either.

  3. added
    type/bugSomething isn't working
    P1High — major feature broken, no workaround
    comp/cronCron scheduler and job management
    on May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High — major feature broken, no workaroundcomp/cronCron scheduler and job managementprovider/openrouterOpenRouter aggregatortype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions