openclaw 使用(1)

6 阅读1分钟

开始总以为安装完openclaw就可以使用了,尝试在工作区创建文件,结果发现无法创建,最后发现是因为创建的agent没有配置model; openclaw.json内容:

{
  "meta": {
    "lastTouchedVersion": "2026.3.28",
    "lastTouchedAt": "2026-03-30T03:44:06.378Z"
  },
  "wizard": {
    "lastRunAt": "2026-03-30T03:44:06.369Z",
    "lastRunVersion": "2026.3.28",
    "lastRunCommand": "doctor",
    "lastRunMode": "local"
  },
  "models": {
    "mode": "merge",
    "providers": {
      "custom-iflow-cn": {
        "baseUrl": "https://api.flow.cn/v1",
        "apiKey": "sk-xxxxxx",
        "api": "openai-completions",
        "models": [
          {
            "id": "qwen3-max-preview",
            "name": "qwen3-max-preview (Custom Provider)",
            "reasoning": false,
            "input": [
              "text"
            ],
            "cost": {
              "input": 0,
              "output": 0,
              "cacheRead": 0,
              "cacheWrite": 0
            },
            "contextWindow": 16000,
            "maxTokens": 4096
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "custom-iflow-cn/kimi-k2-0905"
      },
      "models": {
        "custom-iflow-cn/qwen3-max-preview": {
          "alias": "iflow"
        }
      },
      "workspace": ".openclaw/workspace",
      "contextPruning": {
        "mode": "cache-ttl",
        "ttl": "1h"
      },
      "compaction": {
        "mode": "safeguard"
      },
      "heartbeat": {
        "every": "30m"
      },
      "maxConcurrent": 4,
      "subagents": {
        "maxConcurrent": 8
      }
    },
    "list": [
      {
        "id": "main",
        "name": "main",
        "workspace": ".openclaw/ai/work-main",
        "agentDir": ".openclaw/ai/agents/main/agent",
	"model": {
        "primary": "custom-iflow-cn/iflow-rome-30ba3b"
        },
        "tools": {
            "allow": ["group:fs"],   
            "deny": ["group:runtime"] 
      }
      },
      {
        "id": "leader",
        "name": "leader",
        "workspace": ".openclaw/ai/work-leader",
        "agentDir": ".openclaw/ai/agents/leader/agent",
        "default": true,
	"model": {
        "primary": "custom-iflow-cn/qwen3-vl-plus"
        },
        "tools": {
            "allow": ["group:fs"],   
            "deny": ["group:runtime"] 
      }
      },
      {
        "id": "requirement",
        "name": "requirement",
        "workspace": ".openclaw/ai/work-requirement",
        "agentDir": ".openclaw/ai/agents/requirement/agent",
	"model": {
        "primary": "custom-iflow-cn/qwen3-235b-a22b-2507"
        },
        "tools": {
            "allow": ["group:fs"],   
            "deny": ["group:runtime"] 
      }
      }
    ]
  },
  "tools": {
    "profile": "coding",
    "web": {
      "search": {
        "enabled": true,
        "provider": "tavily"
      }
    }
  },
  "messages": {
    "ackReactionScope": "group-mentions"
  },
  "commands": {
    "native": "auto",
    "nativeSkills": "auto",
    "restart": true,
    "ownerDisplay": "raw"
  },
  "session": {
    "dmScope": "per-channel-peer"
  },
  "gateway": {
    "port": 18789,
    "mode": "local",
    "bind": "loopback",
    "auth": {
      "mode": "token",
      "token": "92226f6a5fcb59ddddsfasfs"
    },
    "tailscale": {
      "mode": "off",
      "resetOnExit": false
    }
  },
  "skills": {
    "load": {
      "extraDirs": [
        ".openclaw/ai/skills"
      ],
      "watch": true,
      "watchDebounceMs": 250
    }
  },
  "plugins": {
    "entries": {
      "tavily": {
        "enabled": true,
        "config": {
          "webSearch": {
            "apiKey": "tvly-dev-xBbCrsfsfwsdfsf"
          }
        }
      }
    }
  }
}