Skip to main content

how-to-change-name

Nested system-manual reference for renaming a live POSIX agent workdir/address. Use after system-manual for the deliberately narrow suspend, no-replace rename, and resume procedure; Windows, network filesystems, and bulk address rewrites are out of scope.

跳到安装

来源信息

仓库
Lingtai-AI/lingtai-kernel
最近来源活动
2026年7月20日 09:34
检测到的 SKILL.md 语言
英语
星标
11
分支
14

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
2 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
how-to-change-name
description
Nested system-manual reference for renaming a live POSIX agent workdir/address. Use after system-manual for the deliberately narrow suspend, no-replace rename, and resume procedure; Windows, network filesystems, and bulk address rewrites are out of scope.
version
1.0.0
last_changed_at
2026-07-20T00:00:00Z
tags
["lingtai","system-manual","posix","rename"]
related_files
["src/lingtai/intrinsic_skills/system-manual/SKILL.md","src/lingtai/intrinsic_skills/system-manual/reference/how-to-change-name/scripts/change_name.py","src/lingtai/cli.py","src/lingtai/kernel/base_agent/lifecycle.py","src/lingtai/kernel/base_agent/identity.py","tests/test_how_to_change_name.py","tests/test_how_to_change_name_e2e.py"]
maintenance
Keep this small POSIX procedure aligned with the executable's preflight, suspend, no-replace rename, and resume behavior.
# Change an agent address (POSIX v1) This changes the workdir basename and derived address, **not** the true `agent_name` or `agent_id`. It does not rewrite contacts, history, ledgers, or other agents' old addresses. ## Run Use an absolute canonical workdir path and a new safe basename: ```sh python /path/to/change_name.py /absolute/old-address new-address ``` The default command first performs a read-only preflight, then starts a detached supervisor so suspending the agent cannot kill the rename operation. Its log starts at `old-address/logs/change-name.log` and moves with the directory. An external operator can wait for the final result with `--foreground`. ## V1 contract The helper is POSIX-only and requires a local, live agent with a fresh heartbeat, held lease, exactly one `python -m lingtai run <old>` process, strict-JSON `init.json`, matching `manifest.agent_name`, and an absolute `venv_path` that can import `lingtai`. Its import probe sets `PYTHONDONTWRITEBYTECODE=1`. It then: 1. touches `.suspend` and waits for the exact process to disappear, heartbeat to go stale, and lease to release; a failed `ps` scan is a failure, never proof that the process is absent; 2. renames once with Linux `renameat2(RENAME_NOREPLACE)` or macOS `renamex_np(RENAME_EXCL)`, so a destination that appears after preflight is never replaced; 3. rebases an in-workdir `venv_path`, changes only `.agent.json` `address`, and starts the rebased runtime; and 4. requires the new exact process, a post-launch heartbeat, and unchanged `agent_id`/`agent_name` before reporting success. There is no copy/delete fallback, automatic rollback, venv creation, or repair of unrelated config paths. A missing/invalid old path never writes to a pre-existing destination. ## Recover honestly Before rename failure leaves the old directory in place; it may be suspended, so restart that same old path before retrying. After rename failure leaves the new directory in place and the log there; inspect and repair that new path. Do not retry against a missing old path or delete either directory automatically.
在 GitHub 查看