Skip to content

Codex App 重启后 notify 被 Computer Use 包装,doctor codex 误报 standby-notify-drift #84

@YangChen-pro

Description

@YangChen-pro

问题描述

在 Codex standby 模式下,helloagents doctor codex 初始检查正常;但重启 Codex App 后,~/.codex/config.toml 里的 notify 会被 Codex App / Computer Use 改写为链式通知形式,随后 helloagents doctor codex 会报告 drift:

issue[standby-notify-drift]: standby notify 未使用受管命令入口
fix: helloagents update codex --standby

但实际配置里 HelloAGENTS 的 codex-notify 并没有丢失,只是被放进了 SkyComputerUseClient--previous-notify 参数里。

环境

  • HelloAGENTS: 3.0.37
  • Codex: 0.132.0
  • 安装模式: standby
  • 命令: helloagents install codex --standby
  • 平台: macOS / Codex App

复现步骤

  1. 执行:
helloagents doctor codex

结果正常:

Codex CLI:
  status: ok
  detected_mode: standby
  tracked_mode: standby
  notifyPathMatch: ok
  globalNotifyPathMatch: ok
  issues=0
  1. 重启 Codex App。

  2. 再次执行:

helloagents doctor codex

结果变为 drift:

Codex CLI:
  status: drift
  notifyPathMatch: missing
  globalNotifyPathMatch: missing
  issue[standby-notify-drift]: standby notify 未使用受管命令入口
  fix: helloagents update codex --standby

实际配置

重启 Codex App 后,~/.codex/config.toml 中的 notify 被改为类似:

notify = [
  "/Users/xxx/.codex/computer-use/Codex Computer Use.app/Contents/SharedSupport/SkyComputerUseClient.app/Contents/MacOS/SkyComputerUseClient",
  "turn-ended",
  "--previous-notify",
  "[\"helloagents-js\",\"codex-notify\"]"
]

这里 helloagents-js codex-notify 仍然存在,只是作为 --previous-notify 的 JSON 字符串参数传给了 SkyComputerUseClient

预期行为

helloagents doctor codex 应该识别这种链式 notify 配置,并认为它仍然有效:

  • codexNotify: ok
  • notifyPathMatch: ok
  • globalNotifyPathMatch: ok
  • 不应报告 standby-notify-drift

实际行为

当前 doctor 只识别直接形式:

notify = ["helloagents-js", "codex-notify"]

但不识别被 Computer Use 包装后的形式:

notify = [".../SkyComputerUseClient", "turn-ended", "--previous-notify", "[\"helloagents-js\",\"codex-notify\"]"]

因此重启 Codex App 后会误报 drift。

疑似原因

源码中 notifyPathMatch / globalNotifyPathMatch 似乎是通过文本包含判断实现的:

codexConfig.includes(CODEX_MANAGED_NOTIFY_VALUE)

CODEX_MANAGED_NOTIFY_VALUE 是直接形式:

["helloagents-js", "codex-notify"]

--previous-notify 包装后,配置文本中实际出现的是转义后的 JSON 字符串:

"[\"helloagents-js\",\"codex-notify\"]"

所以文本匹配失败。

建议修复

建议 doctor 对 notify 做结构化解析,而不是只做原始文本包含判断:

  • 解析 notify 数组;
  • 如果直接等于 ["helloagents-js", "codex-notify"],视为有效;
  • 如果包含 --previous-notify,解析其后一个参数为 JSON;
  • 若解析结果等于 ["helloagents-js", "codex-notify"],也视为有效;
  • 对这种情况可额外输出 note,例如:HelloAGENTS notify is chained through Codex Computer Use,但不应标记为 drift。

这样可以兼容 Codex App / Computer Use 对 notify 的包装行为,避免用户每次重启 Codex App 后都看到误报。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions