openclaw - 💡(How to fix) Fix Agent model configuration ignored—defaults override explicit agent.list[*].model settings [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#43680Fetched 2026-04-08 00:17:19
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Timeline (top)
commented ×1cross-referenced ×1

Agent-level model configurations specified in agents.list[*].model are being ignored. Instead, the system defaults to agents.defaults.model.primary (anthropic/claude-haiku-4-5) regardless of explicit agent config.

This occurs even when:

  • Agent model is explicitly set in gateway config
  • Workspace-level config overrides are removed
  • Default fallbacks are stripped to empty array

Root Cause

Agent-level model configurations specified in agents.list[*].model are being ignored. Instead, the system defaults to agents.defaults.model.primary (anthropic/claude-haiku-4-5) regardless of explicit agent config.

This occurs even when:

  • Agent model is explicitly set in gateway config
  • Workspace-level config overrides are removed
  • Default fallbacks are stripped to empty array

Fix Action

Fix / Workaround

Actual Behavior

  • All agents use agents.defaults.model.primary regardless of explicit config
  • Explicit agent model settings are completely ignored
  • Even when attempting to change an agent's model via config.patch, it reverts to default on next load

Additional Testing Performed

  • ✅ Verified config file syntax is correct
  • ✅ Confirmed no workspace-level AGENTS_*.json overrides exist
  • ✅ Stripped agents.defaults.fallbacks to empty array
  • ✅ Explicitly set agent models multiple times via config.patch
  • ✅ Restarted gateway multiple times
  • ❌ All agents still default to inherited model

Code Example

agents:
  list:
    - id: jagen-openclaw
      model:
        primary: opencode/minimax-m2.5-free
        fallbacks: []
    - id: ollama
      model:
        primary: openrouter/openrouter/free
        fallbacks:
          - opencode/minimax-m2.5-free
RAW_BUFFERClick to expand / collapse

Bug Report

Version

OpenClaw 2026.3.8 (latest)

Description

Agent-level model configurations specified in agents.list[*].model are being ignored. Instead, the system defaults to agents.defaults.model.primary (anthropic/claude-haiku-4-5) regardless of explicit agent config.

This occurs even when:

  • Agent model is explicitly set in gateway config
  • Workspace-level config overrides are removed
  • Default fallbacks are stripped to empty array

Steps to Reproduce

  1. Configure gateway with multiple agents, each with different explicit models
  2. Set agents with explicit models (e.g., jagen-openclaw with opencode/minimax-m2.5-free)
  3. Restart gateway
  4. Query agents for their active model
  5. Observe: All agents report using anthropic/claude-haiku-4-5 (the default), NOT their configured models

Expected Behavior

  • Each agent should use its configured agents.list[*].model.primary setting
  • If that model fails, it should cascade through fallbacks
  • Only if no model is specified should it inherit agents.defaults.model

Actual Behavior

  • All agents use agents.defaults.model.primary regardless of explicit config
  • Explicit agent model settings are completely ignored
  • Even when attempting to change an agent's model via config.patch, it reverts to default on next load

Environment

  • OS: Windows 10 (x64)
  • OpenClaw: 2026.3.8
  • Multiple agents with different model requirements

Additional Testing Performed

  • ✅ Verified config file syntax is correct
  • ✅ Confirmed no workspace-level AGENTS_*.json overrides exist
  • ✅ Stripped agents.defaults.fallbacks to empty array
  • ✅ Explicitly set agent models multiple times via config.patch
  • ✅ Restarted gateway multiple times
  • ❌ All agents still default to inherited model

Reproduction Configuration Example

agents:
  list:
    - id: jagen-openclaw
      model:
        primary: opencode/minimax-m2.5-free
        fallbacks: []
    - id: ollama
      model:
        primary: openrouter/openrouter/free
        fallbacks:
          - opencode/minimax-m2.5-free

Expected: jagen-openclaw uses minimax, ollama uses openrouter Actual: Both use anthropic/claude-haiku-4-5 (default)

This appears to be a bug in the agent model resolution logic where explicit agent-level config is not taking precedence over defaults.

extent analysis

Fix Plan

To resolve the issue where agent-level model configurations are being ignored, we need to update the agent model resolution logic.

Here are the steps to fix the issue:

  • Update the agent_model_resolver function to prioritize agent-level configurations over defaults.
  • Ensure that the agents.list[*].model configuration is correctly parsed and applied.

Example code snippet:

def agent_model_resolver(agent_config, default_config):
    # Prioritize agent-level model configuration
    if 'model' in agent_config and 'primary' in agent_config['model']:
        return agent_config['model']['primary']
    # If no agent-level model is specified, use the default
    return default_config['model']['primary']

# Example usage:
agent_config = {
    'id': 'jagen-openclaw',
    'model': {
        'primary': 'opencode/minimax-m2.5-free',
        'fallbacks': []
    }
}
default_config = {
    'model': {
        'primary': 'anthropic/claude-haiku-4-5'
    }
}

resolved_model = agent_model_resolver(agent_config, default_config)
print(resolved_model)  # Output: opencode/minimax-m2.5-free

Verification

To verify that the fix worked, follow these steps:

  • Restart the gateway with the updated configuration.
  • Query the agents for their active model.
  • Verify that each agent is using its configured model.

Extra Tips

  • Ensure that the configuration file syntax is correct and that there are no workspace-level overrides.
  • If issues persist, try stripping the agents.defaults.fallbacks to an empty array and restarting the gateway.
  • Regularly review and update the agent model resolution logic to prevent similar issues in the future.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Agent model configuration ignored—defaults override explicit agent.list[*].model settings [1 comments, 2 participants]