Install
Install with PiG
pig install npm:pi-auto-titlesInstall with Pi
pi install npm:pi-auto-titlesPackages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.
Pi manifest JSON
The pi field of package.json.
{
"extensions": [
"./src/index.ts"
]
}README
Written by the package's publisher, shown as published in version 0.1.0 (README.md). PiG does not review it.
pi-auto-titles
One Pi extension for every auto-generated title:
| # | 标题 | 槽位 | 状态 |
|---|---|---|---|
| ① | 工具调用 title | assistant 消息的 toolCall.arguments.title | ✅ |
| ② | 主会话标题 | session_info.name | ✅ |
| ③ | 子会话(subagent)标题 | 子会话自己的 session_info.name | ✅ |
取代 pi-tool-title(①)与 @pi-archimedes/session-name(②)。
装载本插件时请同时卸载它们:两个插件会注册同名工具,互相覆盖。
安装
pi install ~/Projects/pi-auto-titles # 或用 npm 包名
配置(~/.pi/agent/settings.json)
命名空间固定为 autoTitles(不用 titles:通用词会与官方潜在键撞车)。
读取路径是 pi.getSettings(),因此项目级 <repo>/.pi/settings.json 里的同名键会覆盖全局值。
"autoTitles": {
"version": 1,
"model": "aiapi-o/oc/mimo-v2.6-flash",
"reasoning": "off",
"session": { "enabled": true, "trigger": "prompt" },
"subagent": { "enabled": true, "model": "aiapi-o/oc/mimo-v2.6-flash" }
}
| 键 | 缺省 | 说明 |
|---|---|---|
model | 当前会话模型 | provider/id;裸 id 仅在唯一时接受;: 后缀会被忽略 |
reasoning | "off" | 起标题不需要思考 |
session.enabled / subagent.enabled | true | 分别开关 |
session.trigger | "prompt" | prompt = 用户提交后立刻用提问生成(<20 字短提问会等正文);answer = 等首条正文回复 |
session.model / subagent.model | 继承 model | 子会话调用次数多,可单独指更便宜的模型 |
非法值不静默:模型解析不到 → 告警并退当前会话模型;reasoning 非法 → 告警并退默认。
时机关口
- 主会话:默认在用户提交后用提问 + 目录名生成(短提问自动等正文);
trigger: "answer"则等首条带文本的回复。/title <text>手动改名后,该会话永不再自动覆盖。 - 子会话:派发后立即用任务文本生成,不等它跑完。名字已是人类名(非
subagent-<agent>-<uuid>-<n>)则不动。 - 失败 3 次封顶;模型不可用时保持原名,不报错、不影响会话。
开发
npm run typecheck
npm test
约束与踩坑见 AGENTS.md(12 条继承自 pi-tool-title,都是实测过的)。