Skip to content

Setup script doesn't sync provider config into models.json, causing key drift #1497

@SebConejo

Description

@SebConejo

Problem

When /setup-manifest-plugin runs, it writes the Manifest provider config (baseUrl, apiKey, models) into openclaw.json but never updates models.json (~/.openclaw/agents/main/agent/models.json). Since the OpenClaw gateway merges both files at runtime ("mode": "merge"), this causes silent config drift.

How to reproduce

  1. Run openclaw onboard — the wizard writes the Manifest provider into models.json with key A
  2. Later, run /setup-manifest-plugin (or re-run it with a new key) — the script writes key B into openclaw.json
  3. models.json still has key A — nobody updated it
  4. Run /manifest-status → reports WARNING: API key mismatch

Observed result

  • openclaw.json has mnfst_Ahjk... for the manifest provider
  • models.json has mnfst_3VSU... for the same provider
  • Additionally, models.json retains a stale auto provider on port 32037 (old Manifest endpoint) that the wizard created, which the setup script never cleans up

Expected result

After running /setup-manifest-plugin, both openclaw.json and models.json should have the same provider config. Stale duplicate providers (like auto with a mnfst_* key on a non-standard port) should be removed.

Root cause

setup_manifest.sh only writes to openclaw.json (via jq and openclaw config set). The wizard (openclaw onboard) writes to a separate file models.json. Neither process is aware of the other file.

Suggested fix

Add a sync step to setup_manifest.sh after writing the provider to openclaw.json:

MODELS_FILE="${OPENCLAW_DIR}/agents/main/agent/models.json"
if [[ -f "$MODELS_FILE" ]]; then
  MANIFEST_PROVIDER=$(jq '.models.providers.manifest' "$CONFIG_FILE")
  jq --argjson mp "$MANIFEST_PROVIDER" '
    .providers.manifest = $mp |
    if (.providers.auto?.apiKey // "" | startswith("mnfst_")) then del(.providers.auto) else . end
  ' "$MODELS_FILE" > "$TEMP" && cp "$TEMP" "$MODELS_FILE"
fi

This copies the manifest provider block from openclaw.json into models.json and removes any stale auto provider that has a mnfst_* key (leftover from a previous wizard run on a different port).

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