GPT-5.6 支持 + 外部 Harness 改进 + MCP 无状态化迁移
v2026.7.1-beta.1OpenClaw v2026.7.1-beta.1(2026年7月2日发布)带来了重大更新:
距离 2026年7月28日 截止日期还有 24 天
现在开始迁移,避免最后时刻的慌乱!
# 全局安装最新版本
npm install -g openclaw@latest
# 检查版本
openclaw --version
# 应输出: 2026.7.1-beta.1 或更高
# 如果使用 pnpm
pnpm add -g openclaw@latest
# 拉取最新镜像
docker pull openclaw/openclaw:2026.7
# 停止旧容器
docker stop openclaw
# 启动新容器
docker run -d \
--name openclaw \
-p 3000:3000 \
-v ~/openclaw-data:/data \
openclaw/openclaw:2026.7
# 检查版本
openclaw --version
# 检查配置兼容性
openclaw doctor
# 查看更新日志
openclaw changelog
| 特性 | GPT-5.5 | GPT-5.6 |
|---|---|---|
| Context Window | 128K | 256K |
| 最大输出 | 4K | 8K |
| 多模态 | 文本+图像 | 文本+图像+视频 |
| 工具调用 | 基础 | 并行 + 链式 |
| 价格(输入/百万) | $2.50 | $2.00 |
# ~/.openclaw/config.yaml
model:
provider: openai
name: gpt-5.6-turbo
context_window: 256000
max_tokens: 8192
temperature: 0.7
# 或者使用环境变量
export OPENAI_MODEL="gpt-5.6-turbo"
export OPENAI_API_KEY="sk-..."
Harness 是 OpenClaw 的外部工具链集成机制,允许你将外部工具、API、服务包装成 OpenClaw 可以调用的 Skill。
// my-harness.ts
import { Harness } from '@openclaw/harness';
interface MyToolParams {
query: string;
limit?: number;
}
const myHarness = new Harness({
name: 'my-tool',
description: 'My custom tool',
parameters: {
query: { type: 'string', required: true },
limit: { type: 'number', default: 10 }
},
async execute(params: MyToolParams) {
// 你的工具逻辑
const result = await searchAPI(params.query, params.limit);
return result;
}
});
export default myHarness;
# ~/.openclaw/skills/my-tool/SKILL.md
---
name: my-tool
harness: ./my-harness.ts
---
# My Tool
自定义工具描述...
MCP(Model Context Protocol)正在从有状态模式迁移到无状态模式。这意味着每个请求都是独立的,不再依赖会话状态。
# 列出所有 MCP 服务器
openclaw mcp list
# 检查服务器状态
openclaw mcp status --server my-server
# ~/.openclaw/mcp-servers.json
{
"my-server": {
"command": "node",
"args": ["/path/to/server.js"],
"env": {
"MCP_MODE": "stateless" // 新增:启用无状态模式
}
}
}
// 旧代码(有状态)
let sessionState = {};
function handleRequest(req) {
sessionState[req.id] = req.data;
// ...
}
// 新代码(无状态)
function handleRequest(req) {
// 每个请求独立处理,不依赖全局状态
const result = processRequest(req.data);
return result;
}
# 测试无状态模式
openclaw mcp test --server my-server --stateless
# 查看测试结果
openclaw mcp test-results my-server
# 逐步迁移
openclaw mcp migrate --server my-server --strategy gradual
# 监控迁移进度
openclaw mcp migration-status my-server
# 测试所有渠道
openclaw channels test-all
# 查看渠道状态
openclaw channels status
# 查看修复日志
openclaw channels changelog
# ~/.openclaw/config.yaml
context:
strategy: sliding-window # 滑动窗口策略
max_tokens: 200000 # 最大 200K tokens
reserve: 50000 # 预留 50K 给输出
# 压缩策略
compression:
enabled: true
threshold: 0.9 # 达到 90% 时压缩
method: summarization # 使用摘要压缩
# 启用 Token 缓存
openclaw config set token_cache.enabled true
# 查看 Token 使用统计
openclaw token-stats
# 优化建议
openclaw token-optimize --aggressive
如果升级后出现问题,可以快速回滚:
# 查看可用版本
npm view openclaw versions --json
# 安装特定版本
npm install -g openclaw@2026.6.11
# 或者使用 Docker
docker run -d openclaw/openclaw:2026.6.11
A: 配置文件通常位于 ~/.openclaw/ 目录。如果丢失,可以从备份恢复,或者重新运行 openclaw init 初始化。
A: 根据官方测试,GPT-5.6 的响应速度提升了约 30%,尤其是处理长上下文时。
A: 短期可能会有轻微影响(因为需要重新加载状态),但长期会提升可靠性和扩展性。
A: 运行 openclaw mcp check-stateless --server my-server,工具会自动检测并给出建议。