使用OpenClaw风险之一就是不可控的Token成本消耗。在使用云厂商的模型接口上,建议选择 Coding Plan 套餐,虽然调用可能被限制,但成本可控。
在提交一个任务后,OpenClaw 会循环尝试解决任务问题,直到成功为止。
但是,如果大模型能力不足,或者任务太复杂不好解决的时候,循环尝试带来的结果就是极长的时间等待,以及极大的 Token 消耗。

这是我的一个案例,在前面对话中生成了一个 HTML 页面,但是页面不显示,我让他修复页面不显示问题的过程:
生成的这个文件页面不显示,请解决: /Users/zhaowenyu/.qclaw/workspace/course/index.html执行了命令 wc -l /Users/zhaowenyu/.qclaw/workspace/course/index.html && grep -n "const modu...执行了命令 tail -100 /Users/zhaowenyu/.qclaw/workspace/course/index.html执行了命令 sed -n '130,180p' /Users/zhaowenyu/.qclaw/workspace/course/index.html执行了命令 grep -n "5.5" /Users/zhaowenyu/.qclaw/workspace/course/index.html | head -10执行了命令 sed -n '1450,1510p' /Users/zhaowenyu/.qclaw/workspace/course/index.html执行了命令 # 检查JavaScript语法错误 grep -n "syntax\|error\|undefined" /Users/zhaowenyu/.qclaw/wo...执行了命令 grep -c "id: 'module-0" /Users/zhaowenyu/.qclaw/workspace/course/index.html && g...执行了命令 grep "id: 'module" /Users/zhaowenyu/.qclaw/workspace/course/index.html执行了命令 # 检查括号匹配 - 计算大括号数量 echo "Opening braces: $(grep -o '{' /Users/zhaowenyu/.qclaw/w...执行了命令 # 使用node检查语法 node -e " const fs = require('fs'); const html = fs.readFileSync('/...执行了命令 # 检查模板字符串的反引号匹配 awk '/content: `/{s=1} s{print NR": "$0} /`\s*,/{if(s) print NR"...执行了命令 # 检查是否有重复的模块定义导致问题 grep -n "module-02" /Users/zhaowenyu/.qclaw/workspace/course/...发现问题!模块2有重复定义。让我修复这个问题:执行了命令 sed -n '290,300p' /Users/zhaowenyu/.qclaw/workspace/course/index.html执行了命令 sed -n '535,560p' /Users/zhaowenyu/.qclaw/workspace/course/index.html找到问题了!模块2被定义了两次。让我删除重复的模块:执行了命令 # 找到第一个模块2结束的位置到第二个模块2结束的位置 sed -n '540,555p' /Users/zhaowenyu/.qclaw/workspace/...执行了命令 # 删除第二个重复的模块2开头(从行540到第一个模块2的lesson结束) # 先找到正确的分隔点 sed -n '536,545p' /Users/zhao...执行了命令 # 删除重复的模块2(行538-539是注释和新模块的开始) sed -i '538,539d' /Users/zhaowenyu/.qclaw/workspa...执行了命令 python3 << 'EOF' import re with open('/Users/zhaowenyu/.qclaw/workspace/course/...执行了命令 python3 << 'EOF' with open('/Users/zhaowenyu/.qclaw/workspace/course/index.html'...执行了命令 python3 << 'EOF' with open('/Users/zhaowenyu/.qclaw/workspace/course/index.html'...执行了命令 # 再次验证JavaScript语法 node -e " const fs = require('fs'); const html = fs.readFileS...执行了命令 node -e " const fs = require('fs'); const html = fs.readFileSync('/Users/zhaowen...执行了命令 grep -n "lessons" /Users/zhaowenyu/.qclaw/workspace/course/index.html | head -20执行了命令 sed -n '535,545p' /Users/zhaowenyu/.qclaw/workspace/course/index.html执行了命令 sed -n '530,550p' /Users/zhaowenyu/.qclaw/workspace/course/index.html执行了命令 python3 << 'EOF' with open('/Users/zhaowenyu/.qclaw/workspace/course/index.html'...执行了命令 python3 << 'EOF' with open('/Users/zhaowenyu/.qclaw/workspace/course/index.html'...执行了命令 sed -n '795,815p' /Users/zhaowenyu/.qclaw/workspace/course/index.html执行了命令 # 检查代码结构 sed -n '800,815p' /Users/zhaowenyu/.qclaw/workspace/course/index.html执行了命令 # 提取JavaScript部分并保存 python3 << 'EOF' with open('/Users/zhaowenyu/.qclaw/workspac...执行了命令 sed -n '400,425p' /tmp/course.js执行了命令 # 找到确切的问题位置 sed -n '405,420p' /tmp/course.js执行了命令 python3 << 'EOF' with open('/tmp/course.js', 'r') as f: lines = f.readlines(...执行了命令 grep -n "title: '系统要求" /tmp/course_fixed.js执行了命令 python3 << 'EOF' import re with open('/tmp/course_fixed.js', 'r') as f: con...执行了命令 python3 << 'EOF' with open('/tmp/course_fixed.js', 'r') as f: content = f.re...执行了命令 python3 << 'EOF' with open('/tmp/course_fixed.js', 'r') as f: content = f.re...执行了命令 python3 << 'EOF' import re with open('/tmp/course_fixed.js', 'r') as f: con...执行了命令 python3 << 'EOF' with open('/tmp/course_fixed.js', 'r') as f: content = f.re...执行了命令 python3 << 'EOF' import re with open('/tmp/course_fixed.js', 'r') as f: con...文件结构损坏比较严重,让我直接重新生成一个干净完整的课程文件:执行了命令 # 备份原文件 cp /Users/zhaowenyu/.qclaw/workspace/course/index.html /Users/zhaowenyu/...执行了命令 cat >> /Users/zhaowenyu/.qclaw/workspace/course/index.html << 'JSEOF' const modu...cat >> /Users/zhaowenyu/.qclaw/workspace/course/index.html << 'JSEOF' const modu...执行了命令 cat >> /Users/zhaowenyu/.qclaw/workspace/course/index.html << 'JSEOF' {id:"modul...cat >> /Users/zhaowenyu/.qclaw/workspace/course/index.html << 'JSEOF' {id:"modul...执行了命令 cat >> /Users/zhaowenyu/.qclaw/workspace/course/index.html << 'JSEOF' {id:"modul...执行了命令 cat >> /Users/zhaowenyu/.qclaw/workspace/course/index.html << 'JSEOF' {id:"modul...执行了命令 cat >> /Users/zhaowenyu/.qclaw/workspace/course/index.html << 'JSEOF' {id:"modul...执行了命令 cat >> /Users/zhaowenyu/.qclaw/workspace/course/index.html << 'JSEOF' {id:"modul...执行了命令 cat >> /Users/zhaowenyu/.qclaw/workspace/course/index.html << 'JSEOF' {id:"modul...执行了命令 cat >> /Users/zhaowenyu/.qclaw/workspace/course/index.html << 'HTMLEOF' functio...cat >> /Users/zhaowenyu/.qclaw/workspace/course/index.html << 'HTMLEOF' functio...执行了命令 # 验证文件 echo "File size: $(wc -c < /Users/zhaowenyu/.qclaw/workspace/course/index...执行了命令 tail -20 /Users/zhaowenyu/.qclaw/workspace/course/index.html文件构建时混入了 echo 命令。让我重新生成一个干净的文件:写入了文件写入了 index.html文件再次被截断。让我用更简洁的方式重新创建:执行了命令 cat > /Users/zhaowenyu/.qclaw/workspace/course/index.html << 'ENDHTML' <!DOCTYPE...文件太大了,shell heredoc 方式无法完整写入。让我用 Python 来生成完整的课程文件:执行了命令 python3 << 'PYEOF' html = '''<!DOCTYPE html> <html lang="zh-CN"> <head> <meta ch...❌ 服务太火爆了,请稍后重新发起请求。直到最后,可能是被服务商策略强行终止了,所以问题依旧没有修复。
夜雨聆风