Skip to content

openclaw: setup.ts BYOK wizard writes wrong configPatch (old URL-redirect approach) #9

@openclaw-bitrouterai

Description

@openclaw-bitrouterai

Problem

The BYOK setup wizard in src/setup.ts writes a configPatch that uses the old URL-redirect approach:

{
  "models": {
    "providers": {
      "<upstreamProvider>": {
        "baseUrl": "http://127.0.0.1:8787/v1"
      }
    }
  }
}

This is incorrect. The correct design (as manually patched in openclaw.json) is to add a new bitrouter provider entry:

{
  "models": {
    "providers": {
      "bitrouter": {
        "baseUrl": "http://127.0.0.1:8787/v1",
        "api": "openai-completions",
        "models": []
      }
    }
  }
}

Impact

Running the BYOK wizard on a fresh install — or re-running it — will overwrite openclaw.json with the wrong config, breaking routing. The before_model_resolve hook overrides the provider to "bitrouter", which must exist in openclaw.json's models.providers. Without api: "openai-completions", OpenClaw falls back to openai-responses and hits /v1/responses — a path BitRouter does not serve.

Fix Required

Update src/setup.ts writePatch() / buildConfigPatch() to write:

  • models.providers.bitrouter.baseUrl = http://127.0.0.1:<port>/v1
  • models.providers.bitrouter.api = "openai-completions"
  • models.providers.bitrouter.models = []

And add an auth profile entry for bitrouter:default with the plugin JWT.

Labels

bug, openclaw, setup

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