ChatGPT 桌面版内置1.7GB运行时:LibreOffice、Python、Node.js全家桶 · 干货攻略
- 链接: https://simonwillison.net/2026/Sep/1/codex-libreoffice/
- 分类: x-tips
- 来源: X @simonw
- 作者: Jay
- 更新: 2026-09-04
这是什么
2026年9月1日,开发者 Simon Willison 在整理磁盘空间时(使用 OmniDiskSweeper 扫描 ~/.cache/)偶然发现:OpenAI 的桌面版 ChatGPT(由原 Codex 桌面应用 rebranding 而来)在用户本地静默捆绑了约 1.7GB 的完整运行时环境,位于:
~/.cache/codex-runtimes/codex-primary-runtime/
这并不是应用更新残留或缓存文件,而是刻意打包的完整工具链,包含:
| 组件 | 类型 | 典型用途 |
|---|---|---|
| Python | 完整安装 (~440 MB) | 脚本执行、数据处理 |
| Node.js | 完整安装 (~446 MB) | JS 脚本、npm 工具调用 |
| LibreOffice | headless 二进制 (~430 MB) | DOCX/PPT/XLS → PDF 转换 |
| Poppler (pdftoppm) | Linux 工具 (~188 MB) | PDF → PNG 分页栅格化 |
| git | CLI 工具 (~148 MB) | 代码版本控制 |
核心路径为:
~/.cache/codex-runtimes/codex-primary-runtime/plugins/openai-primary-runtime/plugins/documents/
该 documents 文件夹内含 skills 文件(描述性配置),告知 Codex 如何定位和使用这些二进制工具。Simon Willison 将其形容为:ChatGPT 桌面版自带了一个「1.7GB 的私人工具箱」,专门用于在用户机器上本地处理 PDF 和 Office 文档。
为什么值得关注
谁分享的、解决什么问题
这次发现出自 Simon Willison(@simonw)——知名独立开发者、DBs 的创建者、长期关注 AI 工具链的技术作者。他在 2026 年 9 月 1 日的博客中记录了这次逆向探索,旨在回答一个简单问题:我的磁盘空间去哪儿了?
答案是:OpenAI 把一整套开发环境打包进了每个人的 ChatGPT 桌面客户端。
核心价值点
- 本地文档处理,无需网络调用:ChatGPT 桌面版处理 DOCX、PDF、PPT 等文档时,并非调用外部 API,而是调用本地绑定的 LibreOffice(转换为 PDF)+ Poppler(栅格化)+ Python/Node.js 脚本。这意味着文档内容全程不离开本机。
- Skill 机制揭秘:Codex 的 skills 系统不只定义 prompt,还直接封装了工具调用方式——路径查找、参数构造(如 LibreOffice 的
--headless --convert-to pdf)均由 skills 文件控制。 - 磁盘空间的重要来源:1.7GB 对 SSD 来说不算小,对在意磁盘占用的用户来说是个盲区。这是目前唯一通过磁盘扫描器才被偶然发现的「隐藏安装」。
- OpenAI Codex → ChatGPT rebranding 节点:此次发现恰逢 OpenAI 将 Codex 桌面应用正式整合进新版 ChatGPT 桌面客户端(2026年9月1日),时间节点具有标志性意义。
核验过程
读过的官方来源
-
Simon Willison 博客原文(simonwillison.net/2026/Sep/1/codex-libreoffice) - 确认发现时间、磁盘路径、组件列表、skills 机制描述。
-
OpenAI Help Center:Moving to the new ChatGPT desktop app(help.openai.com) - 确认 Codex → ChatGPT rebranding 事实:Codex 桌面版更新后即成为带 Chat、Work、Codex 三大入口的新版 ChatGPT 桌面应用;现有 Codex 用户自动迁移,Codex 仍保留为独立视图。 - 确认 ChatGPT Classic 继续存在,部分新 agent 功能仅在新版应用提供。
-
OpenAI Codex GitHub 仓库(github.com/openai/codex) - 确认 Codex CLI 安装方式(
curl .../install.sh | sh)及 npm/Homebrew 安装途径。 - 确认桌面应用基于codex-primary-runtime架构,但 README 未记录 bundled runtimes 细节。 -
GitHub Issue #24210(openai/codex/issues/24210) - 技术细节核心来源:确认
render_docx.py脚本存在,位于openai-primary-runtime/documents/插件目录。 - 确认 LibreOffice 版本 26.2.3.2(bundled)。 - 确认 Documents 插件版本:openai-primary-runtime/documents/26.521.10419。 - 确认具体命令结构:soffice -env:UserInstallation=file://<profile> --invisible --headless \ --norestore --convert-to pdf --outdir <dir> <file> pdftoppm -png <pdf> <output_prefix>- 已知问题:Windows 上 LibreOffice 临时 UserInstallation profile URI 构建存在跨平台 bug(file://路径格式问题导致 libpng 写入错误)。 -
AI/TLDR 摘要来源(ai-tldr.dev) - 确认组件大小分解:LibreOffice 429.7 MB、Poppler 187.9 MB、git 148.1 MB、Node.js 446.4 MB、Python 440.6 MB。 - 来源可靠性:TLDR 为第三方摘要平台,数字引用自 Simon Willison 原文。
交叉验证结论
- ✅ Simon Willison 的原始发现时间(2026-09-01)与 OpenAI Help Center 的 rebranding 日期一致,交叉印证。
- ✅ GitHub Issue #24210 由用户提交,描述的命令行参数结构与 Simon 描述的 skills 机制高度吻合——两份独立来源均指向同一
documents插件架构。 - ⚠️ 组件大小数字(429.7 MB 等)来自 AI/TLDR 对 Simon 博客的二次摘要,未经 Simon 原文直接数字核验,标注为「原帖数字」。
- ⚠️ LibreOffice 具体版本号 26.2.3.2 来自 GitHub Issue,在 OpenAI 官方文档中未单独列出,仅作参考。
上手指南
查看你自己的 ChatGPT 桌面版 bundled runtimes
# macOS / Linux
ls -lh ~/.cache/codex-runtimes/codex-primary-runtime/
# 查看具体二进制大小
du -sh ~/.cache/codex-runtimes/codex-primary-runtime/*
查看 Documents skill 文件内容
# skills 文件定义如何调用工具
ls ~/.cache/codex-runtimes/codex-primary-runtime/plugins/openai-primary-runtime/plugins/documents/
# 读取 skill 配置(示例)
cat ~/.cache/codex-runtimes/codex-primary-runtime/plugins/openai-primary-runtime/plugins/documents/SKILL.md
直接使用 bundled LibreOffice(macOS/Linux)
CODEX_RT=~/.cache/codex-runtimes/codex-primary-runtime
# DOCX → PDF
"$CODEX_RT/program/soffice" \
--headless --norestore \
--convert-to pdf \
--outdir /tmp/ \
/path/to/document.docx
# PDF → PNG(每页一张)
pdftoppm -png /tmp/document.pdf /tmp/page
直接使用 bundled Python
CODEX_RT=~/.cache/codex-runtimes/codex-primary-runtime
"$CODEX_RT/bin/python3" -c "print('Hello from bundled Python')"
直接使用 bundled Node.js
CODEX_RT=~/.cache/codex-runtimes/codex-primary-runtime
"$CODEX_RT/bin/node" -e "console.log('Hello from bundled Node.js')"
坑与适用边界
⚠️ 平台差异
| 平台 | 状态 | 说明 |
|---|---|---|
| macOS | ✅ 完全支持 | Codex 桌面应用首发平台,bundled runtimes 完整 |
| Windows | ⚠️ 部分支持 | LibreOffice 有已知 bug(Issue #24210):--env:UserInstallation URI 在 Windows 上构造错误,导致 libpng 写入失败;Poppler 转换不受影响 |
| Linux | ⚠️ 预览版 | Codex 桌面应用 Linux 版 2026 年 8 月进入预览(community.openai.com),bundled runtimes 机制理论上存在但未广泛验证 |
⚠️ 磁盘空间
1.7GB 的 bundled runtimes 不算小,且位于 ~/.cache/ 下——这是许多磁盘清理工具的默认扫描路径,但如果用户不知道它的存在,可能会误以为这是残留文件而清理,导致 ChatGPT 桌面功能受损。建议不要手动删除 ~/.cache/codex-runtimes/ 目录。
⚠️ 安全性注意事项
- bundled LibreOffice 版本(~26.2.3.2):未标注自动更新机制,如果存在安全漏洞需要等 OpenAI 更新整个桌面客户端来修复。
- git bundled:bundled git 可被 Codex 调用执行危险操作,OpenAI 桌面应用有沙箱/权限控制,但建议查看 ChatGPT 桌面版的「权限模式」设置(沙箱 / 自动审批 / 完全访问)。
- Windows bug 利用:GitHub Issue #24210 的 workaround 是直接调用 LibreOffice 而非通过
render_docx.py的 profile 机制,可作为临时绕过的参考。
⚠️ Skill 文件不可直接编辑
documents 下的 skills 文件位于应用内部缓存区,不建议直接修改。OpenAI 可能在更新时覆盖这些文件。
一句话结论
ChatGPT 桌面版(原 Codex)内置了一套完整的本地工具链(Python、Node.js、LibreOffice、Poppler、git),总计 1.7GB,隐藏在 ~/.cache/codex-runtimes/ 中,支撑着桌面 AI agent 对 PDF 和 Office 文档的本地处理——这是目前了解最少的「隐藏运行时」,对磁盘空间敏感用户和想要复用这套工具的开发者都有意义。
参考来源
- Simon Willison,Codex bundles LibreOffice,simonwillison.net,2026-09-01
- OpenAI Help Center,Moving to the new ChatGPT desktop app,help.openai.com
- openai/codex GitHub,Lightweight coding agent that runs in your terminal,github.com/openai/codex
- GitHub Issue #24210,Documents render_docx.py fails on Windows with LibreOffice temporary UserInstallation profile,github.com/openai/codex/issues/24210