☰
Watchdog notes
2026/10/16 5:07:04 网站建设 项目流程

Watchdog notes

【免费下载链接】oh-my-pi⌥ Coding agent with the IDE wired in项目地址: https://gitcode.com/GitHub_Trending/oh/oh-my-pi

Especially watch for:

  • Changes that bypass the durable queue insrc/jobs/.
  • UI renderer paths that display unsanitized tool output.
  • New worker spawns that do not re-enter the CLI host.
### 发现位置 `discoverWatchdogFiles(cwd, agentDir)`([watchdog.ts](https://link.gitcode.com/i/5b6fbb93dd710f1a7a726fee0c9893a0))从以下位置加载所有可读候选: 1. 用户级:`<active agent dir>/WATCHDOG.md`(默认 `~/.omp/agent/WATCHDOG.md`,可被 `PI_CODING_AGENT_DIR` 重定位); 2. 项目级:从 `cwd` 向上走到 git 仓库根(找不到仓库根时走到家目录)沿途的: - `<dir>/WATCHDOG.md` - `<dir>/.omp/WATCHDOG.md` 与原生上下文文件不同,watchdog 发现**不在最近的项目文件处停止**——多个项目级 watchdog 文件可以同时加载。隐藏属主目录中的候选被忽略,除非文件在 `.omp` 目录内;这既避免了误拾其他点目录约定,又允许 `.omp/WATCHDOG.md`。排序规则见 `collectConfigCandidates`:用户级在前,项目级按深度降序(祖先在前、叶子目录最后、最具体),使更窄的目录指引在提示词中比宽泛的祖先指引更醒目。 ### `@` 导入 `WATCHDOG.md` 内容用与上下文文件相同的 `@` 导入助手展开: - 相对导入从导入文件所在目录解析; - `~/` 从用户家目录解析; - 围栏代码块与行内代码中的导入保持字面量; - 循环被跳过; - 缺失或不可读的导入保留原始 `@path` 文本。 ### 提示词顺序 加载的 watchdog 块按以下顺序排列: 1. 用户级 `WATCHDOG.md`; 2. 项目级文件从更远的祖先向 `cwd` 排布。 每个文件以如下形式追加进 advisor 系统提示词: ```xml Especially pay attention to: <attention> ...expanded watchdog content... </attention>

八、WATCHDOG.yml:advisor 花名册

WATCHDOG.yml(或WATCHDOG.yaml)是 advisor 花名册:WATCHDOG.md提供评审优先级,WATCHDOG.yml则声明 advisor 本身——每个名字一条,各带启用开关、模型、工具授予与专精提示词。交互式/advisor configure覆盖层就地编辑该文件。解析失败或 schema 校验失败的文件被记录并跳过——一个坏的项目配置不能杀死会话(config.ts 中discoverAdvisorConfigs对每个候选都 try/catch 后continue,绝不抛出)。

示例:

instructions: | Everyone: prefer diffs that keep tests unified. advisors: - name: Architecture enabled: true model: anthropic/claude-sonnet-4-5:medium tools: [read, grep, glob] instructions: | Watch cross-module coupling and public-API growth. - name: Fixer enabled: false model: anthropic/claude-sonnet-4-5:high tools: [read, grep, glob, edit, bash] instructions: | You may edit and run tests to prove a fix locally, then advise.

【免费下载链接】oh-my-pi⌥ Coding agent with the IDE wired in项目地址: https://gitcode.com/GitHub_Trending/oh/oh-my-pi

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询