# OpenClaw Manager — 开发日志 > 最后更新:2026-03-01 > 当前版本:v0.9.0 --- ## v0.9.0 更新日志(2026-03-01) ### New Features - Agents: Add Agent / Add Sub-Agent 向导支持 Telegram + Discord - Telegram: 传统 group 绑定 - Discord: 主 Agent 建议绑定 Channel;Sub-Agent 建议绑定 Thread - Routing: 删除绑定提示文案增强(支持“更换 group/thread → 先删旧绑定再加新绑定”) ### UX / UI - 顶部居中显示醒目的 OCM 版本标识 - Agents 页面:Agent Tree 支持显示 bindings 概览(Telegram/Discord)并按 parentAgentId 分组 - Setup Guide:补全 Telegram Allow Groups 步骤;Discord guide 按 channel/thread 经验重写 ### Fixes - 修复 MAIN_HTML_SCRIPT 内联 JS 语法问题(tree toggle / i18n 单引号等),避免启动自检失败 ## Unreleased(2026-02-28) ### Dashboard / Layout - Removed the dashboard `HTTP Ping` field (often misleading in Telegram gateway setups) - Expanded dashboard visibility with richer gateway routing metadata: - bind host - telegram account count - group count - binding count - allowFrom count - Reordered dashboard cards and made `Agents` / `Gateway` cards wider for denser information display ### Bug Fixes - Fixed `main` agent workspace file browsing/editing fallback: - when agent-level workspace is empty, it now resolves from defaults or `workspace/` - writing files now ensures workspace directory exists before save ### UX Clarification - Channels page hint text updated to position it as **advanced routing management** - Clarifies scope difference from Agents page (daily add/remove should stay in Agents) - Navigation label updated from `Channels` to `Routing` to reduce conceptual overlap with Agent lifecycle management - Added `Routing` page agent filter (`All Agents` + per-agent quick filter) for easier large-tree inspection - Added compact grouped rendering in `Routing`: bindings are grouped by agent with expand/collapse support for denser large-config browsing ### Settings UX - Merged `Models` and `Auth` pages into a single `Models & Auth` tab ### Stats - Added daily (`1 day`) range option and set it as default --- ## v0.7.1 更新日志(2026-02-27) ### New Features **Dashboard Guidance Block (Telegram-first usage + safety)** - Added a concise guidance card under Dashboard explaining OCM's intended Telegram workflow - Clarifies prerequisites: users should already have basic OpenClaw CLI experience - Clarifies purpose: OCM mainly helps visualize and update `openclaw.json` for easier main-agent/sub-agent management and multi-tree structures - Added explicit Telegram security checklist: - BotFather `Allow Groups = ON` - BotFather `Group Privacy = OFF` - Keep each group private (only you + agent/sub-agents), do not invite others ### Improvements **Model Dropdown Source — only `openclaw models list`** - Model dropdown options are now sourced from real CLI output (`openclaw models list`) instead of built-in/static lists or config-only additions - Applies to all relevant selectors: agent/sub-agent creation forms, agent inline model switcher, primary model selector, and fallback picker - Added warning message when model list loading/parsing fails ### Technical Notes - Added model ID parser for CLI output and short-term cache for model list fetches - `GET /api/models` now returns: - `knownModels` from CLI - `modelListError` for UI warning display - Startup script banners updated to `v0.7.1` (`start.sh` / `start.bat`) --- ## v0.7.0 更新日志(2026-02-27) ### New Features **Dashboard Redesign — Circular Gauge System Health** - CPU%, RAM%, DISK% displayed as SVG circular gauges with colour-coded arcs (green < 70%, amber < 90%, red ≥ 90%) - System info card: hostname, OS, Node.js, CPU model, cores, uptime, load average (1/5/15 min) - Agent overview: separate main agent count and sub-agent count (plus total) - Auto-refresh toggle: when enabled, dashboard polls `/api/dashboard` every 10 seconds - Backend now measures CPU usage via `os.cpus()` delta sampling (200ms interval) and returns `loadAvg` from `os.loadavg()` **Sub-Agent Creation Flow — Step-by-Step Guide Rewrite** - Expanded from 3 steps to 5 detailed steps covering the full BotFather → Telegram Group → OCM workflow - Step 1: Create new Bot via `/newbot` in BotFather - Step 2: Disable Group Privacy via `/mybots` → Bot Settings → Group Privacy → Turn off - Step 3: Create Telegram group, add Bot (with security warning) - Step 4: Get Group ID from gateway logs - Step 5: Fill in the form - New "Your Telegram User ID" input field — auto-writes to `channels.telegram.allowFrom` whitelist on creation - Security warning banner: "Do NOT add other people to this group" with explanation about API cost risks **Setup Page — English Localization** - All Chinese text in the initial directory selection page translated to English - Includes: title, description, labels, placeholders, error messages, button text ### Bug Fixes **Agent tree: sub-agents not grouped under main (old config format)** - **Symptom**: On machines with openclaw.json created before OCM v0.6 multi-bot support, all sub-agents displayed as independent cards instead of nested under main - **Root cause**: Old-format bindings lack `accountId` field in sub-agent entries. The tree builder relied on `parentAccountId` to match sub-agents to roots, but old bindings only had `channel` + `peer` — no `accountId`. So `parentAccountId` was null and no parent match was found - **Fix**: Fallback inference — if a sub-agent has a peer binding but no `accountId`, automatically infer `parentAccountId` from main's binding (`accountId`) or fall back to `'default'` ### Technical Notes - **CPU usage measurement:** Two `os.cpus()` snapshots 200ms apart, calculating idle-to-total ratio across all cores - **Gauge rendering:** Pure SVG arcs with `stroke-dasharray` animation, no external libraries. 270° arc (gap at bottom), colour transitions via `gaugeColor()` function - **allowFrom auto-config:** `POST /api/agents` now accepts optional `telegramUserId` field (numeric string), appends to `channels.telegram.allowFrom[]` if not already present - **Old-config compatibility:** Sub-agent bindings without `accountId` are now auto-assigned to the main agent's bot, maintaining backward compatibility with configs created before multi-bot support --- ## v0.6.6 更新日志(2026-02-27) ### Bug Fixes **Agent tree: main agent not detected as root** - **Symptom**: Sub-agents displayed as independent agents instead of under their parent. All agents appeared as orphan roots. - **Root cause**: `main` agent in OpenClaw is the default catch-all and typically has NO explicit binding in `openclaw.json`. The `hasOwnBot` detection required an explicit binding with `accountId && !peer`, so `main` was classified as a non-root. Without `main` being a root, sub-agents' `parentAccountId` had no matching root to link to. - **Fix**: - `main` is now always treated as a root agent regardless of binding existence - `main`'s `accountId` is inferred from `channels.telegram.accounts`: first unclaimed account (not explicitly bound to another agent), or first account as fallback - Sub-agents with `parentAccountId` matching `main`'s inferred `accountId` now correctly appear under `main` in the tree --- ## v0.6.5 更新日志(2026-02-26) ### New Features **Dashboard Tab (🏠 Dashboard)** - New default landing tab showing system overview at a glance - **System card**: hostname, OS, Node.js version, CPU model/cores, uptime, memory usage with progress bar - **Gateway card**: process status indicator (running/stopped/unknown) with coloured dot, port, PID, HTTP ping reachability - **Agents card**: total agent count, last session activity timestamp (Brisbane time), OCM version, server time - **Storage card**: OpenClaw dir size, disk usage with progress bar, free space - New `GET /api/dashboard` endpoint aggregates all info (ps grep + curl ping + fs stat) - Lazy-loaded on tab switch; auto-loaded on first page load **Cache-Control + Version-Based Cache Busting** - All HTTP responses now include `Cache-Control: no-store, no-cache, must-revalidate` - HTML responses include `ETag: "ocm-"` for version-based cache validation - All responses include `X-OCM-Version` header - Browser `api()` function checks `X-OCM-Version` against client version; shows toast notification when server has been updated, prompting user to refresh - Prevents stale frontend from calling deleted/changed API endpoints after update ### Cleanup **Old `/api/agents/main` endpoint fully removed** (confirmed via code search — no residual references) ### Technical Notes - Dashboard gateway detection: `ps aux | grep openclaw.*gateway` for process status, `curl --max-time 2 http://127.0.0.1:` for HTTP ping - Disk usage: `df -k` for filesystem stats, `du -sk` for OpenClaw dir size - Agent last activity: scans `~/.openclaw/agents/*/sessions/*.jsonl` mtime - Version cache busting: `OCM_CLIENT_VERSION` is injected into browser script via template literal `${APP_VERSION}`, compared against `X-OCM-Version` response header on every API call --- ## v0.6.0 更新日志(2026-02-26) ### 重大 Bug 修复 **Add Agent 覆盖已有 Bot Token(数据破坏性 Bug)** - **症状**:通过 Add Agent 表单添加新 agent 时,直接覆盖 `channels.telegram.botToken`,导致所有已有 agent(包括 sub-agent)全部失效 - **根本原因**:`POST /api/agents/main` 端点无条件覆盖 `channels.telegram.botToken` 字段,没有保护已有配置 - **修复**: - 彻底删除 `POST /api/agents/main` 端点 - 新建 `POST /api/agents/bot` 端点,使用 OpenClaw 的 `channels.telegram.accounts` 多 bot 结构 - 每个新 agent 获得独立的 `accountId` 和 `botToken`,绝不覆盖已有 token - 自动迁移:首次添加新 bot 时,自动将旧格式(顶层 `botToken`)迁移到 `accounts.default` - **数据恢复**:程序在修改前自动创建 `openclaw.json.create.*` 备份,可通过 `cp` 恢复 **浏览器 Popover API 命名冲突** - **症状**:点击 "+ Add Agent" / "+ Add Sub-Agent" 按钮报错 `NotSupportedError: Failed to execute 'togglePopover' on 'HTMLElement'` - **根本原因**:自定义函数 `togglePopover()` 与浏览器原生 Popover API 的 `HTMLElement.togglePopover()` 方法冲突 - **修复**:函数重命名为 `showConfigPop()` ### 架构变更 **多 Bot 支持(Multi-Account)** - 支持 OpenClaw 的 `channels.telegram.accounts` 结构,每个主 agent 可绑定独立的 Telegram bot - 配置格式: ```json { "channels": { "telegram": { "accounts": { "default": { "botToken": "TOKEN_A" }, "research": { "botToken": "TOKEN_B" } }}} } ``` - `GET /api/agents` 返回 `hasOwnBot` 字段,标识 agent 是否拥有独立 bot - Sub-Agent 表单新增 "Parent Agent" 下拉,选择共享哪个 bot(不再硬编码 "main") **去除 Landing Page,直接进入主程序** - 移除模式选择首页(Sub-agent / Multi-agent 二选一) - 启动后直接进入 Agent 管理页面 - 移除 landing page 相关 HTML、CSS、JS、i18n keys **Agent 页面重设计(popover 配置窗口)** - 不再使用左右分屏布局 - "+ Add Agent" / "+ Add Sub-Agent" 按钮居中显示在 agent 树上方 - 点击按钮弹出浮动配置窗口(popover),包含引导步骤和表单 - Agent 树宽度限制 720px 居中,多个 agent 树纵向排列 ### 功能改进 **Stats 重写 — 从 session JSONL 文件解析真实用量** - 不再从 `gateway.log` 解析(之前一直是 0 数据) - 改为扫描 `~/.openclaw/agents/*/sessions/*.jsonl` - 解析 `type: "message"` + `role: "assistant"` 的 `message.usage` 字段 - 新增维度:By Agent(每个 agent 的用量)、Cache Read tokens - 测试验证:成功解析出 990 条请求、6 个 agent、10 个模型的真实数据 **Model 下拉 — 只显示已注册模型** - 不再使用硬编码的 KNOWN_MODELS 列表 - 改为从 `openclaw.json` 的 `agents.defaults.models` 读取实际注册的模型 **Agent 树事件委托** - `renderAgents()` 中的按钮不再使用 `onclick="func('escaped-string')"` 内联写法 - 改用 `data-action` / `data-id` 属性 + 事件委托(`agentTreeAction`),避免 template literal 转义问题 **响应式布局** - `main` 容器改为 `max-width:100%`,适配不同屏幕宽度 - 新增 `@media (max-width: 600px)` 断点:侧边导航折叠、按钮纵向排列 **备份时间戳改为 Brisbane 时区** - `brisbaneTimestamp()` 函数,所有备份文件名使用 `Australia/Brisbane` 时区 - 重要:系统所有时间显示统一按 Brisbane 处理 **启动脚本全面重写** - `start.sh` / `start.bat` 全部英文 - 端口冲突时自动 kill 旧进程,而非报错退出 - 支持 `--host` 参数 **README 重写** - 移除所有空的 screenshot 占位符(含敏感 ID 的截图已删除) - 更新功能描述匹配 v0.6 - 精简结构,保留中英文双语 ### 新功能 i18n 策略 - v0.6 新增的所有 UI 文案仅提供英文 - 中文翻译推迟到 v1.0 正式版 ### 技术备忘 - **Template literal 转义规则**:MAIN_HTML_SCRIPT 是反引号模板字符串 - `\n` → 真实换行(浏览器 JS 字符串跨行 → SyntaxError),必须写 `\\n` - `\'` → `'`(无法用于 onclick 里的引号转义),改用 data 属性 + 事件委托 - `\`` → `` ` ``(嵌套模板字符串在 evaluated output 中正常工作) - **`assertBrowserScriptSyntax()`** 在启动时检查 MAIN_HTML_SCRIPT 的 evaluated 值 - **OpenClaw config 多 bot 格式**:`channels.telegram.accounts..botToken`,binding 用 `accountId` 路由 ### 下一步(v0.7+) - [x] Dashboard 首页 tab(系统信息 + OpenClaw health 状态)— done in v0.6.5 - [x] HTTP 响应加 `Cache-Control: no-store` + version-based cache busting — done in v0.6.5 - [x] 彻底删除旧 `/api/agents/main` 端点残留(确认已清除)— confirmed in v0.6.5 - [x] Agent tree: independent roots per bot + side-by-side layout — done in v0.6.5 - [x] Agent tree: expand/collapse toggle for sub-agents — done in v0.6.5 - [x] Add Agent: creates `agents//sessions/` runtime dirs + SOUL.md personality — done in v0.6.5 - [x] Agent tree: main agent always root with inferred accountId — done in v0.6.6 - [ ] Dashboard: auto-refresh every 30s when tab is active - [ ] Dashboard: OpenClaw version display (from `openclaw --version`) - [ ] Agent page: edit agent name, purpose, personality inline - [ ] Agent page: restart gateway button with status feedback - [ ] Settings tab: edit openclaw.json key fields via form (model, workspace defaults) - [ ] Telegram bot connectivity test button (ping bot API from server) - [ ] DEVLOG.md 中文 → 逐步迁移为英文 --- ## v0.5.2 更新日志(2026-02-25) ### 修复 **远程访问无法连接(ERR_CONNECTION_REFUSED)** - `server.listen` 原来绑定 `127.0.0.1`(仅本机),远程通过 `http://:3333` 访问时被直接拒绝 - 改为默认绑定 `0.0.0.0`(所有网卡),远程设备可通过局域网 IP 访问 - 新增 `--host` 命令行参数:需要限制仅本机访问时可用 `--host 127.0.0.1` 覆盖 - 新增 `getLanIP()` 工具函数,自动检测第一个非内部 IPv4 地址 ### 改进 **启动日志改为英文** - 终端启动信息(目录、地址、提示、错误)全部改为英文 - 绑定 `0.0.0.0` 时自动显示局域网地址,方便远程复制:`🌐 LAN: http://192.168.x.x:3333` - 端口占用、启动失败等错误提示同步改为英文 --- ## v0.5.1 更新日志(2026-02-25) ### 修复 **Action 菜单英文模式残留中文** - 修复 Action 菜单下多处弹窗在 EN 模式仍显示中文的问题(日志、回滚、目录切换、命令输出) - 统一接入 i18n:标题、按钮、说明文案、加载态、空态、确认框、toast 文案 - 菜单项触发后的交互文案现在与语言切换保持一致 ### 工程改进 **1) 嵌入脚本转义/语法防护** - 新增启动时预检:对前端嵌入脚本执行 `node --check` 语法校验 - 若语法异常(常见为 `MAIN_HTML` 内 `\n` 转义写错),启动阶段直接报错并给出修复提示,避免浏览器白屏后才发现问题 **2) 单文件结构化重构(保持零依赖)** - 将主页面模板从单一超长 `MAIN_HTML` 拆分为三段常量: - `MAIN_HTML_CSS` - `MAIN_HTML_BODY` - `MAIN_HTML_SCRIPT` - 最终由 `MAIN_HTML` 组合输出,保持“单文件 + 零依赖”不变,同时降低维护复杂度 - 修复拆分过程中的脚本模板转义问题:`MAIN_HTML_SCRIPT` 使用普通模板字符串(非 `String.raw`),确保前端脚本内的反引号模板语法可被正确还原 ### 其他 - 程序头部版本与启动日志版本更新为 `v0.5.1` - `start.sh` / `start.bat` 启动横幅版本号同步更新为 `v0.5.1` - `README` 补充 Git 安装/更新流程(`git clone` / `git pull --ff-only`),并精简中英文功能介绍 - `README` 首屏改版:增加「1 分钟上手」命令区(安装/更新/运行同屏),并将开场介绍改为精简版 - `README` 去重:移除中部重复的安装/更新/运行段落,统一引用首屏快速上手 - `README` 截图区改为首屏精简展示(3 张)+ 折叠更多截图(`
`) --- ## v0.5 更新日志(2026-02-24) ### 新功能 **认证页简化为引导模式** - 移除了不稳定的 API Key 提交表单(通过 stdin 管道传 CLI 的方案不可靠) - 改为引导页:点击 Provider 显示清晰的操作步骤 + 一键复制 CLI 命令 - 已配置的 Provider 在网格中显示 ✅ 标记 - 每个 Provider 指引末尾都提示运行 `openclaw onboard` 注册可用模型 - 删除了 `runWithStdin()` 函数和 `POST /api/auth/run` 端点 **模型页精简** - 移除「添加模型」和「删除模型」功能(模型应由 `openclaw onboard` 管理) - 只保留 Primary Model 选择器和 Fallback Chain 编辑 - 删除了 `POST /api/models` 和 `DELETE /api/models/:id` 端点 **API 费用追踪(Token Cost Monitor)— 📊 Stats 标签页** - 新增 `GET /api/stats` 端点,解析 `logs/gateway.log` 中的 token 用量 - 支持 JSON 日志和文本格式日志(`input_tokens: N, output_tokens: N`) - 按模型和按天汇总统计,显示 Token 用量和估计成本 - 可视化:四张汇总卡片 + CSS 柱状图(按日) + 模型明细卡片 - 支持自定义模型定价(存 `manager-config.json` 的 `modelPricing` 字段) - 时间范围过滤:7 / 30 / 90 天 - 点击标签页时懒加载,不影响首屏性能 **Cron 任务管理 — ⏰ Cron 标签页** - 新增 `GET/POST/PUT/DELETE /api/cron` 四个端点,操作系统 crontab - 只展示包含 `openclaw` 或 `ocm` 关键词的 cron 条目 - 支持:查看、添加、启用/禁用(注释/取消注释)、手动触发、删除 - 与 NAS 备份的 cron 条目联动(同样显示) - 添加任务支持自定义 Cron 表达式 + 命令 + 标签 **Workspace 文件浏览器(全文件 + 可编辑)** - 重写 `GET /api/workspace/:id`:动态扫描 workspace 目录下所有文件(不再硬编码 4 个文件名) - 每个文件显示大小和最后修改时间 - 默认只读视图(`
` 代码块),点击「编辑」按钮切换为 `