Agent Migration
Use this skill when the user wants to rename or migrate an OpenClaw agent safely.
Scope
This skill handles:
- - agent id rename
- workspace rename
- config/path updates
- prior session content migration
- session display metadata updates
- restart and verification
- separate deletion confirmation for the old agent
Defaults and boundaries
- - Confirm old id, new id, new workspace, and whether model also changes.
- Migrate prior session content by default unless the user explicitly says not to.
- Do not skip migration just because a session does not look active.
- Do not hard-edit active lock files or force-rewrite a live session shell.
- Restart is required after migration.
- Never delete the old agent without a separate user confirmation.
Files involved
- - config: INLINECODE0
- agent dirs: INLINECODE1
- workspace: INLINECODE2
- session metadata such as INLINECODE3
Use the included files
- - INLINECODE4
- INLINECODE5
- INLINECODE6
- INLINECODE7
- INLINECODE8
Recommended commands
CODEBLOCK0
Guardrails
- - Keep config, workspace, and naming changes consistent.
- Update session display-layer metadata as part of the migration.
- Verify the new agent before offering deletion of the old one.
- Use
references/cleanup.md only after the user separately confirms deletion.
Agent 迁移
当用户需要安全地重命名或迁移 OpenClaw agent 时,使用此技能。
适用范围
此技能处理:
- - agent ID 重命名
- 工作区重命名
- 配置/路径更新
- 先前会话内容迁移
- 会话显示元数据更新
- 重启与验证
- 旧 agent 的单独删除确认
默认设置与边界
- - 确认旧 ID、新 ID、新工作区,以及模型是否同时变更。
- 除非用户明确表示不需要,否则默认迁移先前会话内容。
- 不要因为某个会话看起来不活跃就跳过迁移。
- 不要硬编辑活跃锁文件或强制重写运行中的会话 shell。
- 迁移后需要重启。
- 未经用户单独确认,绝不删除旧 agent。
涉及的文件
- - 配置文件:~/.openclaw/openclaw.json
- agent 目录:~/.openclaw/agents//...
- 工作区:/home/yln/claw-workspace/
- 会话元数据,如 sessions.json
使用附带的文件
- - references/checklist.md
- references/cleanup.md
- scripts/inspectagentmigration.sh
- scripts/copysessioncontent.sh
- scripts/verifyagentmigration.sh
推荐命令
bash
bash skills/agent-migration/scripts/inspect
agentmigration.sh <旧ID> <新ID>
bash skills/agent-migration/scripts/copy
sessioncontent.sh <旧ID> <新ID>
bash skills/agent-migration/scripts/verify
agentmigration.sh <旧ID> <新ID>
防护措施
- - 保持配置、工作区和命名变更的一致性。
- 在迁移过程中更新会话显示层元数据。
- 在提供删除旧 agent 的选项前,先验证新 agent。
- 仅在用户单独确认删除后,才使用 references/cleanup.md。