Skip to content

Profile config fallback_providers not inherited by kanban worker agents #23362

@pty819

Description

@pty819

Problem

Profile-specific config.yaml files (e.g. ~/.hermes/profiles/scraper/config.yaml) support a model section:

model:
  provider: minimax-cn
  base_url: https://api.minimaxi.com/anthropic
  default: MiniMax-M2.7

The main agent config (~/.hermes/config.yaml) supports fallback_providers as a top-level list:

fallback_providers:
- provider: deepseek
  model: deepseek-v4-flash
  base_url: https://api.deepseek.com/v1
- provider: openrouter
  model: tencent/hy3-preview:free
  base_url: https://openrouter.ai/api/v1

However, when kanban dispatcher spawns worker agents via _default_spawn(), those workers (AIAgent instances) are initialized with fallback_model=None, regardless of what is configured in the worker's profile config. The fallback_providers field in a profile config is never read — only gateway/run.py:_try_resolve_fallback_provider() reads fallback_providers from the main config, not from profile-specific configs.

Impact

Workers (e.g. scraper profile agents) have no fallback if their primary provider fails (rate limit, timeout, etc.). The agent simply fails instead of failing over to a backup provider.

Root Cause

In hermes_cli/kanban_db.py:_default_spawn(), workers are spawned as:

hermes -p <profile> --skills kanban-worker chat -q work kanban task <id>

The profile's config.yaml is loaded but only model.provider / model.base_url / model.default are extracted. fallback_providers is never read from the profile config and is not passed to AIAgent.__init__(fallback_model=...).

Additionally, run_agent.py:AIAgent.__init__() accepts fallback_model as a constructor argument, but callers (the hermes CLI entry points) never extract fallback_providers from the active profile config to pass it through.

Expected Behavior

When a worker agent is spawned with hermes -p <profile>, the profile's config.yaml fallback_providers (if present) should be used as the worker's fallback chain, just as the main config's fallback_providers is used for the main agent.

Suggested Fix

In hermes_cli/ where a profile config is loaded and an AIAgent is constructed (e.g. the CLI entry point that handles -p <profile> chat or the kanban dispatcher path), extract fallback_providers from the profile config and pass it as fallback_model=fallback_providers to AIAgent.__init__().

Specifically:

  1. Profile config loading in the CLI path should also extract config.get("fallback_providers")
  2. That value should be passed to the AIAgent constructor as fallback_model
  3. This applies to both the interactive CLI path and the kanban worker spawn path

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/cliCLI entry point, hermes_cli/, setup wizardsweeper:implemented-on-mainSweeper: behavior already present on current maintype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions