fix: Codex 自动压缩不触发 —— 接管时链接模型目录(绝对路径)进 config.toml (hot 1.5.83)

This commit is contained in:
mac
2026-08-16 12:45:32 +08:00
parent e9a261482c
commit 1b687c01e9
50 changed files with 10885 additions and 1161 deletions
+8 -2
View File
@@ -7,6 +7,7 @@ const os = require("os");
const { exec } = require("child_process");
const codex = require("./codex");
const codexDesktop = require("./codex_desktop");
const IS_WIN = process.platform === "win32";
@@ -85,6 +86,11 @@ async function detectInstalls() {
add("Codex 数据目录(配置 · 登录 · 会话 · 插件)", "data", path.join(home, ".codex"));
// 2) PATH 里的可执行文件(which / where 可能返回多行)
for (const item of codexDesktop.desktopExecutableCandidates()) {
add(item.label || "ChatGPT/Codex 桌面程序", "bin", item.path);
}
// 3) PATH 里的可执行文件(which / where 可能返回多行)
const whichOut = IS_WIN ? await run("where codex") : await run("which -a codex");
if (whichOut) {
for (const line of whichOut.split(/\r?\n/)) {
@@ -103,7 +109,7 @@ async function detectInstalls() {
}
}
// 3) npm 全局包与 npm 全局 bin
// 4) npm 全局包与 npm 全局 bin
const npmRoot = await run(IS_WIN ? "npm.cmd root -g" : "npm root -g");
if (npmRoot) add("@openai/codex 安装包(npm 全局)", "npm-package", path.join(npmRoot, "@openai", "codex"));
@@ -116,7 +122,7 @@ async function detectInstalls() {
add("@openai/codex 安装包(npm 全局)", "npm-package", path.join(npmPrefix, IS_WIN ? "node_modules" : "lib/node_modules", "@openai", "codex"));
}
// 4) 各平台常见固定位置兜底
// 5) 各平台常见固定位置兜底
if (IS_WIN) {
const appdata = process.env.APPDATA || path.join(home, "AppData", "Roaming");
for (const n of ["codex", "codex.cmd", "codex.ps1"]) {