Delete Agent With Telegram Group
简介
Delete Agent With Telegram Group
原始描述
Safely and thoroughly delete an OpenClaw agent and its artifacts. Use when user asks to remove an agent completely, including workspace, agent files under ~/...
通过你的 Agent 添加
安装目录:delete-agent-with-telegram-group/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
技能正文
name: delete-agent-with-telegram-group
description: Safely and thoroughly delete an OpenClaw agent and its artifacts. Use when user asks to remove an agent completely, including workspace, agent files under ~/.openclaw/agents, bindings, Telegram group routing config, dedicated Telegram group, and related cron jobs. Always run local cleanup via script with dry-run first; if Telegram group deletion is requested, require a separate explicit confirmation before any browser/session control or irreversible group deletion.
Delete Agent (Clean)
Permanently remove an agent and its related local config/files.
Safety Rules
- This is destructive. Always require explicit user confirmation.
- Enforce 3-step gate:
- run
--dry-run,
- explicit confirmation for local deletion,
- separate explicit confirmation for Telegram browser/session-controlled group deletion.
- Ask user whether to also delete the dedicated Telegram group.
- Never auto-delete Telegram groups without the separate confirmation.
- Prefer script execution for local cleanup (stable, low token).
Inputs
- run
--dry-run, - explicit confirmation for local deletion,
- separate explicit confirmation for Telegram browser/session-controlled group deletion.
Collect:
agent_id(required)delete_workspace(yes/no)delete_telegram_group_config(yes/no; usually yes)delete_telegram_group(yes/no; requires explicit confirmation)delete_cron_jobs(yes/no; usually yes)
Script-first Commands
Dry-run:
python3 scripts/delete_agent.py --agent-id <agent_id> --dry-run
Execute (after confirmation):
python3 scripts/delete_agent.py --agent-id <agent_id> --yes --delete-workspace --delete-telegram-group-config --delete-cron-jobs
Script Safety Guardrails
scripts/delete_agent.py validates agent_id format: [a-z0-9-]+.
- It refuses deletion when target paths are outside allowed directories.
- Workspace deletion is allowed only when path is under user home and folder name starts with
claw-.
- It creates backup files before writing config changes.
What the script removes
- Agent entry in
~/.openclaw/openclaw.json (agents.list)
- Agent bindings (
bindings[] with matching agentId)
- Telegram group routing entries linked by those bindings
channels.telegram.groups.<chat_id>
- Agent directory:
~/.openclaw/agents/<agent_id>
- Workspace directory from agent config (if
--delete-workspace)
- Cron jobs owned by this agent from
~/.openclaw/cron/jobs.json (if --delete-cron-jobs)
Dedicated Telegram Group Deletion
scripts/delete_agent.py validates agent_id format: [a-z0-9-]+.claw-.- Agent entry in
~/.openclaw/openclaw.json(agents.list) - Agent bindings (
bindings[]with matchingagentId) - Telegram group routing entries linked by those bindings
channels.telegram.groups.<chat_id>
- Agent directory:
~/.openclaw/agents/<agent_id>
- Workspace directory from agent config (if
--delete-workspace) - Cron jobs owned by this agent from
~/.openclaw/cron/jobs.json(if--delete-cron-jobs)
Dedicated Telegram Group Deletion
This skill does not bundle Telegram deletion automation code; it uses external browser automation tooling or manual user actions.
After local script deletion and only if user confirmed delete_telegram_group=yes:
- Require a separate explicit confirmation: user agrees to browser/session control and irreversible group deletion.
- Identify dedicated group
chat_idfrom removed bindings. - Use browser automation (Telegram Web) to open the group and run
Delete Group. - In Telegram delete dialog, enable
Delete for all memberswhen available, then confirm deletion. - Report final group status clearly:
deleted/left-only/pending-manual.
Post-step
- Surface backup files created by the script (
openclaw.json.bak.*, jobs.json.bak.*) so user can retain recovery points.
- If gateway reload is available, let hot reload apply.
- If not applied, ask for explicit confirmation before restarting gateway, then verify logs.
- Return concise summary with removed items.
openclaw.json.bak.*, jobs.json.bak.*) so user can retain recovery points.正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。