Town CLIAgent

town agent doctor

诊断并可修复 agent 的僵尸状态文件

town agent doctor

诊断指定 agent 的状态文件,并可清理僵尸 pid/meta。

这页保留为命令入口。更完整的说明见 CLI / doctorAgent 显示 stale

用法

town agent doctor [path] [--fix]

常用参数

  • --fix [enabled]:发现僵尸状态时自动清理

行为说明

  • path 默认当前目录 .
  • 目标 agent 需要已登记在受管 agent registry。
  • 不带 --fix 时只诊断,不修改文件。

相关命令

示例输出(基于当前实现)

以下示例直接对齐 cli/town/src 当前命令实现(含默认输出模式与字段结构),示例值使用占位符表示。

$ town agent doctor .
town v1.0.0
⚠️  Stale daemon state detected
   project: <projectRoot>
   stalePid: <pid>
   reason: <reasons>
   log: <daemonLogPath>
   Run `town agent doctor <path> --fix` to clean stale pid/meta.
$ town agent doctor . --fix
town v1.0.0
✅ Cleaned stale daemon pid/meta files