Skip to content

Custom routing config in openclaw.json is silently ignored #147

@jeegankones

Description

@jeegankones

I defined custom routing tiers in openclaw.json under plugins.entries.clawrouter.config.routing, but the proxy always starts with the default routing config. No errors or warnings, it just silently uses defaults.

After digging into the source, I found the cause: register(api) gets called twice during OpenClaw's gateway startup. The first call happens in a pre-gateway phase before openclaw.json has been read, so api.pluginConfig is empty. The proxy starts with DEFAULT_ROUTING_CONFIG at this point. Then proc.__clawrouterProxyStarted gets set to true, which causes the second register() call (the one that actually has the user's config in api.pluginConfig) to bail out immediately.

You can see this in the gateway log: the timestamp-less [plugins] lines (pre-gateway phase) appear before [gateway] loading configuration…, and all subsequent timestamped calls log "Proxy already started by earlier register() call - skipping".

This means plugins.entries.clawrouter.config.routing effectively does nothing for anyone.

Repro: Define any custom tiers in openclaw.json, restart the gateway, check blockrun/logs/usage-*.jsonl. Routed models will match DEFAULT_ROUTING_CONFIG, not the user config.

Version: @blockrun/clawrouter@0.12.139, OpenClaw 2026.4.9

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions