main agent in OpenClaw has no explicit binding - it's the default catch-all.
Previous code required explicit binding with accountId && !peer to detect
root agents, causing main and its sub-agents to appear as orphan independents.
Now main is always treated as root, with accountId inferred from first
unclaimed telegram account in channels.telegram.accounts.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- POST /api/agents/bot now creates agents/<id>/sessions/ runtime directory
- POST /api/agents (sub-agent) also creates agents/<id>/sessions/
- Add Agent form now includes Purpose and Personality fields
- Personality keywords generate structured SOUL.md, empty uses default growth prompt
- Notes now remind to restart gateway for new bots
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Main agents displayed horizontally side-by-side (flex row)
- Sub-agents drop below their respective parent agent
- Main agent now shows defaults.workspace path
- All agents get "View Files" button regardless of root/sub status
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Each agent with hasOwnBot is rendered as independent tree root (not all under "main")
- Layout changed: buttons centered top, agent tree below (max 720px centered)
- Added expand/collapse toggle at top of sub-agent branch line
- API returns accountId/parentAccountId for proper tree grouping
- Event delegation for agent tree actions (data-action attributes)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 11:52:23 +00:00
16 changed files with 1058 additions and 146 deletions
- 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
A zero-dependency, single-file web dashboard for [OpenClaw](https://github.com/anthropics/openclaw). Manage agents, monitor token usage, and run commands — all from your browser, no `npm install` required.
@@ -25,6 +25,23 @@ Open [http://localhost:3333](http://localhost:3333) in your browser. For remote
## Features
**Screenshots** — Redacted UI walkthrough (no personal paths, no Telegram IDs):







**Agent Management** — Add main agents and sub-agents through a guided setup flow. View all agents in a tree structure with model selection, workspace browsing, and inline configuration.
**Usage Statistics** — Real token usage data parsed directly from OpenClaw session files. Breakdown by model, agent, and day with a visual chart.
@@ -37,6 +54,32 @@ Open [http://localhost:3333](http://localhost:3333) in your browser. For remote
**Bilingual UI** — English and Chinese interface with one-click language switching.
> Audience: People who already have OpenClaw running locally (you can run `openclaw status` and read `openclaw gateway logs`).
>
> Goal: Use **OpenClaw Manager (OCM)** to make agent/sub-agent setup and day-to-day ops **visual, safer, and easier to audit**.
---
## 0) The pain: why OCM exists
Creating and maintaining OpenClaw agents is powerful, but the “default workflow” is often messy:
1) **Editing `openclaw.json` is risky**
- Deep/nested config, many fields.
- One accidental overwrite can break multiple agents (tokens, bindings, accountIds).
2) **Sub-agent topology is hard to see**
- With multiple bots + multiple groups, it’s not obvious which agent is bound to which Telegram peer.
3) **Model IDs are easy to misconfigure**
- A wrong `provider/model-id` can silently degrade performance, cause timeouts, or produce “typing…” with no reply.
4) **Usage and troubleshooting take time**
- Without tooling, you’re digging through JSONL sessions and gateway logs to answer: “who used tokens?”, “what failed?”, “which provider?”
OCM’s role: **a zero-dependency local UI** that helps you view and update OpenClaw configuration safely, keep changes auditable, and centralize common ops.
---
## 1) Why Telegram groups are the best way to build sub-agents
Think of it as:
> **One Telegram group = one agent boundary** (context + purpose + workspace).
### Benefits
1) **Clear isolation**
- Each agent speaks only inside its own group.
- Less cross-contamination between tasks.
2) **Controllable context**
- The group chat is the agent’s input stream.
- You can keep an agent “clean” by keeping the group focused.
3) **Natural delegation**
- A main agent can coordinate; sub-agents can specialize (tech / travel / finance / translation, etc.).
4) **Auditable**
- You can see exactly which message triggered which response.
### Safety / cost: keep groups private
Recommended rule:
- **Each agent group should contain only you + the bot** (and optionally your second account).
- Don’t invite other people:
- cost: anyone can trigger token usage
- safety: higher risk of prompt-injection / accidental tool actions
---
## 2) Start OCM (macOS)
From the repo directory:
```bash
bash start.sh
```
Then open: <http://localhost:3333>
Restrict to localhost only:
```bash
bash start.sh --host 127.0.0.1
```
---
## 3) Dashboard: check health first
The Dashboard is your “sanity check”:
- CPU / RAM / Disk
- gateway running status
- agent counts
Screenshot:

---
## 4) Create a main agent (with its own Telegram bot)
> Your `main` agent usually exists already. This section is for creating an additional **root agent** that owns its own Telegram bot/account.
### 4.1 BotFather prerequisites
1) Create a bot
- In Telegram, open **BotFather**
- Run `/newbot` → follow prompts → copy the bot token
2) Allow groups
- BotFather → your bot → Bot Settings
- **Allow Groups = ON**
3) Disable group privacy (critical)
- BotFather → your bot → Bot Settings → Group Privacy
- **Group Privacy = OFF**
If group privacy is ON, the bot can’t see normal group messages. The symptom often looks like:
- slow replies
- “typing…” appears frequently
- sometimes no response at all
### 4.2 Add the agent in OCM
Go to **Agents**:

Click `+ Add Agent` and fill:
- agent id / name
- workspace path (recommended: separate folder per agent)
- model (dropdown is sourced from `openclaw models list`)
- the BotFather token
OCM writes the agent + Telegram account/binding into `openclaw.json`.
---
## 5) Create a sub-agent (recommended workflow)
### 5.1 Why a new group per sub-agent
- clean context isolation
- easier debugging
- easy to “turn off” by muting a group
### 5.2 Step-by-step
In **Agents** → `+ Add Sub-Agent`:
**Step 1 — Create a Telegram group**
- private group
- add only: you + the bot
**Step 2 — Get the Group ID (peer id)**
Use gateway logs:
```bash
openclaw gateway logs --follow
```
Send a message in the new group. In logs you should see something like:
-`-100xxxxxxxxxx` (Telegram group id)
**Step 3 — Fill the sub-agent form**
- choose the Parent Agent (which bot/account to share)
- paste the Group ID
- set workspace (recommended: its own folder)
- choose model
**Step 4 — Allowlist (optional but recommended)**
If you use `channels.telegram.allowFrom`, OCM can take “Your Telegram User ID” and append it automatically to the allowlist.
---
## 6) Verify bindings (Channels)
Go to **Channels**:

Here you can quickly validate:
- which agent is bound to which Telegram peer
- whether `main` has the catch-all binding (if you use that pattern)
---
## 7) Model settings (Models)
Go to **Models**:

Key idea:
- OCM uses the real CLI model list (`openclaw models list`) for dropdowns.
- This reduces “invalid model-id” mistakes.
---
## 8) Credentials (Auth)
Go to **Auth**:

Use this page to:
- see which provider profiles exist
- troubleshoot expired/missing tokens
---
## 9) Usage stats (Stats)
Go to **Stats**:

You can break down usage by:
- model
- agent
- time window
OCM parses usage from OpenClaw session JSONL files.
'dash.notice1':'OCM is primarily for Telegram workflows: bind agents to groups so each agent has isolated Workspace / SOUL.md / MEMORY.md.',
'dash.notice2':'Basic OpenClaw CLI experience is required. OCM focuses on visual openclaw.json updates for easier main-agent/sub-agent management and multiple agent trees.',
'dash.notice3':'In BotFather, keep Allow Groups = ON and Group Privacy = OFF; otherwise sub-agents may fail to join or respond.',
'dash.noticeWarn':'⚠️ Strong recommendation: each agent group should include only you and that agent (or its sub-agents). Treat each group like a private chat.',
'auth.guide':'Click a Provider for setup instructions. Auth is done in terminal or via the CLI panel below.',
'auth.step1':'1. Get API Key','auth.step2':'2. Run the command below in terminal','auth.step3':'3. Paste your API Key when prompted',
@@ -2251,9 +2412,13 @@ const I18N = {
'guide.agent.s2':'Send <code>/newbot</code> and follow prompts to name your Bot',
'guide.agent.s3':'Copy the <code>Bot Token</code> from BotFather and paste below',
'guide.agent.s4':'Send <code>/setprivacy</code> → select your Bot → click <code>Disable</code> (allow Bot to read group messages)',
'guide.sub.s1':'Add the Bot to your target Telegram group',
'guide.sub.s2':'Send a message in the group, find <code>peer.id</code> (negative number) in gateway logs',
'guide.sub.s3':'Fill in the Group ID and Agent config below',
'guide.sub.s1':'Send <code>/newbot</code> to BotFather to create a new Bot and get the Bot Token',
'guide.sub.s2':'Send <code>/mybots</code> to BotFather → select your Bot → <b>Bot Settings</b> → <b>Group Privacy</b> → <b>Turn off</b>',
'guide.sub.s3':'Create a new Telegram group, add the Bot to the group (<b>do NOT add anyone else</b>)',
'guide.sub.s4':'Send a message in the group, find <code>peer.id</code> (negative number) in gateway logs',
'guide.sub.s5':'Fill in the form below to create the Sub-Agent',
'guide.sub.warn':'⚠️ Security: Do NOT add other people to this group. Only you and the Bot should be in the group. Otherwise others can chat with the Bot and incur API costs.',
'wiz.telegramId':'Your Telegram User ID','wiz.telegramIdHint':'💡 Get it from @userinfobot — auto-configures allowFrom whitelist','wiz.telegramIdPh':'e.g. 123456789',
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.