Repository navigation
fix(update): standalone 安装的官方 Codex 升级提醒直接给出 codex update - #3070
Merged
Merged
Conversation
官方 Codex 用 install.sh 原生安装时,codex doctor --json 的 update action 只给状态标签 standalone installer,被归一为「未识别出升级命令」。而官方 codex update 子命令对 standalone 安装执行的正是同一个官方安装脚本。 官方 provider(internal)在 doctor 版本与可执行文件一致、标签为 standalone installer 时给出 codex update;兼容 fork(self)与 manual or unknown 仍保持未识别,不恢复按 binPath 猜测命令的兜底。
deepcoldy
requested review from
47seek,
LucasIcarus,
xiaoxueSunn and
xiongz-c
as code owners
November 7, 2026 15:37
|
🚀 Released in v3.59.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1773
症状
官方 Codex 用 install.sh 原生安装(
~/.codex/packages/standalone/...)时,升级提醒卡片和 Dashboard「宿主 CLI 升级」里只显示「未识别出升级命令,请按该 CLI 原有的安装方式手动升级」。根因
codex doctor --json对 standalone 安装的update action给的是状态标签standalone installer,不是可执行命令,#1608 把它和manual or unknown一起归一成 null。但官方codex update子命令对 standalone 安装执行的就是官方安装脚本(curl -fsSL …/codex/install.sh | CODEX_NON_INTERACTIVE=1 sh),是权威且可执行的升级入口。修法
src/core/cli-runtime-update.ts:只在官方 provider(internal)且 doctor 可信(doctor 报告的版本与--version一致)、update action为standalone installer(忽略大小写和首尾空白)时,升级命令给出codex update。无论最新版本取自 doctor 还是回落到 npm 查询,都一致。manual or unknown仍显示「未识别出升级命令」。self)即使报standalone installer也不映射:它的安装脚本不是官方的,codex update可能指向错误的更新流。selfdoctor 给出的真实命令照旧原样透传。${binPath} update」兜底。影响面
lastNotifiedVersion去重,只是卡片里「未识别」一行换成可执行命令。持久化格式不变;已缓存的条目在下一次 24 小时探测后更新。doctor和update子命令;0.164.0 的 doctor 对该安装输出"update action": "standalone installer"。验证
bunx vitest run test/cli-runtime-update.test.ts:89 passed;bun test test/cli-runtime-update.test.ts:89 pass。bun run build(含 tsc)通过。self:fork 守卫的 2 条用例变红。bun scripts/fenced-run.ts -- env CODEX_HOME=<真实 codex 目录> bun probe.ts,对本机 standalone 安装的 codex 0.164.0 调probeCliRuntimeUpdate):internal得到updateCommand: null。internal得到"codex update",self仍为null。$CODEX_HOME/packages/standalone下的可执行文件认作 standalone,换了CODEX_HOME会报manual or unknown,这种情况仍为未识别,符合预期。