Fix OpenClaw configuration options

This commit is contained in:
decolua
2026-02-09 22:36:57 +07:00
parent 102c193112
commit dd043f6ff4
2 changed files with 23 additions and 11 deletions

View File

@@ -518,7 +518,13 @@ codex "your prompt"
### OpenClaw
Edit `~/.openclaw/openclaw.json`:
**Option 1 — Dashboard (recommended):**
```
Dashboard → CLI Tools → OpenClaw → Select Model → Apply
```
**Option 2 — Manual:** Edit `~/.openclaw/openclaw.json`:
```json
{
@@ -532,8 +538,8 @@ Edit `~/.openclaw/openclaw.json`:
"models": {
"providers": {
"9router": {
"baseUrl": "http://localhost:20128/v1",
"apiKey": "your-9router-api-key",
"baseUrl": "http://127.0.0.1:20128/v1",
"apiKey": "sk_9router",
"api": "openai-completions",
"models": [
{
@@ -547,7 +553,7 @@ Edit `~/.openclaw/openclaw.json`:
}
```
**Or use Dashboard:** CLI Tools → OpenClaw → Auto-config
> **Note:** OpenClaw only works with local 9Router. Use `127.0.0.1` instead of `localhost` to avoid IPv6 resolution issues.
### Cline / Continue / RooCode

View File

@@ -4,8 +4,6 @@ import { useState, useEffect, useRef } from "react";
import { Card, Button, ModelSelectModal, ManualConfigModal } from "@/shared/components";
import Image from "next/image";
const CLOUD_URL = process.env.NEXT_PUBLIC_CLOUD_URL;
export default function OpenClawToolCard({
tool,
isExpanded,
@@ -33,9 +31,8 @@ export default function OpenClawToolCard({
if (!openclawStatus?.installed) return null;
const currentProvider = openclawStatus.settings?.models?.providers?.["9router"];
if (!currentProvider) return "not_configured";
const localMatch = currentProvider.baseUrl?.includes("localhost") || currentProvider.baseUrl?.includes("127.0.0.1");
const cloudMatch = cloudEnabled && CLOUD_URL && currentProvider.baseUrl?.startsWith(CLOUD_URL);
if (localMatch || cloudMatch) return "configured";
const localMatch = currentProvider.baseUrl?.includes("localhost") || currentProvider.baseUrl?.includes("127.0.0.1") || currentProvider.baseUrl?.includes("0.0.0.0");
if (localMatch) return "configured";
return "other";
};
@@ -94,13 +91,22 @@ export default function OpenClawToolCard({
}
};
const normalizeLocalhost = (url) => url.replace("://localhost", "://127.0.0.1");
const getLocalBaseUrl = () => {
if (typeof window !== "undefined") {
return normalizeLocalhost(window.location.origin);
}
return "http://127.0.0.1:20128";
};
const getEffectiveBaseUrl = () => {
const url = customBaseUrl || baseUrl;
const url = customBaseUrl || getLocalBaseUrl();
return url.endsWith("/v1") ? url : `${url}/v1`;
};
const getDisplayUrl = () => {
const url = customBaseUrl || baseUrl;
const url = customBaseUrl || getLocalBaseUrl();
return url.endsWith("/v1") ? url : `${url}/v1`;
};