Skip to content

Dashboard crash: React error #31 when model config is an object with {primary, fallbacks} #23

@xtraxion

Description

@xtraxion

Bug

Clicking Dashboard causes a crash with:

Something went wrong
Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Bprimary%2C%20fallbacks%7D

React error #31 = "Objects are not valid as a React child" — the Dashboard tries to render {primary, fallbacks} directly as JSX text.

Cause

Since OpenClaw added support for model fallbacks, agents.defaults.model in openclaw.json can now be an object:

{
  "agents": {
    "defaults": {
      "model": {
        "primary": "openai-codex/gpt-5.4",
        "fallbacks": ["openrouter/minimax/minimax-m2.7"]
      }
    }
  }
}

The Dashboard likely renders the model value expecting a string, but receives an object. This also affects imageModel and imageGenerationModel which follow the same {primary, fallbacks} pattern.

Expected

Dashboard should display the model name (e.g. the .primary value) instead of crashing.

Suggested Fix

const modelDisplay = typeof model === "string" ? model : model?.primary ?? "unknown";

Environment

  • OpenClaw config with model object format ({primary, fallbacks})
  • ClawControl (latest)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions