ChatGPT/Codex Windows 桌面版“幽灵会话”问题:网页端已删除,桌面端仍显示且无法删除/归档

1. 问题现象

ChatGPT 网页端已经删除部分聊天,但 Windows 桌面版左侧 Recents 中仍然保留这些会话。

这些"幽灵会话"通常具有以下特征:

  • 网页端已经找不到;
  • 其他电脑上的 ChatGPT 桌面版也不存在;
  • 当前电脑桌面版仍然显示;
  • 打开会话失败;
  • 删除失败;
  • 归档失败;
  • 置顶失败;
  • 分享失败;
  • 卸载重装 ChatGPT 无效;
  • Windows 设置中的"重置 ChatGPT"无效。

这并不是个例。OpenAI 的 openai/codex GitHub 仓库中已经有多个类似 Issue。

例如:

Issue #39989:Windows desktop keeps already-deleted ChatGPT conversations in Recents after full restart

报告中的表现几乎完全一致:网页端已经删除,会话 API 返回 conversation_deleted,但是 Windows Desktop 的 Recents 中仍然保留旧标题。

GitHub Issue #39989

另外还有:

Issue #41602:Deleted conversations remain as stale titles in Windows app Recents

该用户甚至已经尝试 Windows App Reset、退出重新登录和重启,但旧标题仍然存在。

GitHub Issue #41602


2. 真正的本地缓存位置

经过排查,最终发现 ChatGPT Windows Desktop 会在下面这个 SQLite 数据库中维护本地会话目录:

text 复制代码
C:\Users\<用户名>\.codex\sqlite\codex-dev.db

数据库中非常关键的一张表是:

text 复制代码
local_thread_catalog

其字段包括:

text 复制代码
host_id
thread_id
display_title
source_created_at
source_updated_at
source_kind
source_detail
missing_candidate
thread_source
source_recency_at
pending_observed_title
conversation_origin

其中最值得关注的是:

text 复制代码
thread_id
display_title
source_kind
conversation_origin
missing_candidate

display_title 就是桌面端 Recents 中显示的会话标题。


3. 验证 ChatGPT 会话是否存在于本地 Catalog

可以使用 Python 读取数据库。

python 复制代码
import sqlite3
from pathlib import Path

db = Path.home() / ".codex" / "sqlite" / "codex-dev.db"

con = sqlite3.connect(f"file:{db}?mode=ro", uri=True)
cur = con.cursor()

for row in cur.execute("""
SELECT
    source_kind,
    conversation_origin,
    COUNT(*)
FROM local_thread_catalog
GROUP BY source_kind, conversation_origin
ORDER BY COUNT(*) DESC
"""):
    print(row)

con.close()

在我的电脑上实际得到:

text 复制代码
('chatgpt', None, 33)
('cli', None, 31)
('chatgpt', 'tpp', 1)
('vscode', None, 1)

这说明:

codex-dev.db 不只是 Codex CLI 的数据库,其中确实还保存了 ChatGPT Desktop 的 ChatGPT 会话目录信息。


4. 查看 ChatGPT Desktop 本地保存的会话标题

可以进一步执行:

python 复制代码
import sqlite3
from pathlib import Path

db = Path.home() / ".codex" / "sqlite" / "codex-dev.db"

con = sqlite3.connect(f"file:{db}?mode=ro", uri=True)
con.row_factory = sqlite3.Row
cur = con.cursor()

rows = cur.execute("""
SELECT
    thread_id,
    display_title,
    conversation_origin,
    missing_candidate,
    source_recency_at
FROM local_thread_catalog
WHERE source_kind = 'chatgpt'
ORDER BY source_recency_at DESC
""").fetchall()

for row in rows:
    print(
        row["thread_id"],
        row["display_title"],
        row["conversation_origin"],
        row["missing_candidate"]
    )

con.close()

如果网页端已经删除的会话标题仍然出现在这里,就说明 Desktop 的本地 thread catalog 仍然保留着该会话记录。


5. 为什么幽灵会话无法删除、归档和分享?

原因并不复杂:

text 复制代码
ChatGPT 云端
    ↓
真实 conversation 已经删除
    ↓
Windows Desktop 本地 local_thread_catalog
    ↓
旧 thread 记录仍然存在
    ↓
Recents 继续显示 display_title

所以桌面版实际上处于一种:

text 复制代码
标题还存在
↓
真实 conversation 已经不存在

的状态。

因此,当用户执行:

text 复制代码
打开
删除
归档
置顶
分享

时,Desktop 会尝试操作一个实际上已经不存在的会话,于是操作失败。

GitHub Issue #40981 中就报告了完全相同的表现:打开会话返回 404,同时删除显示 Failed to delete chat,归档显示 Failed to archive conversation。

GitHub Issue #40981

另一个 Issue #41067 中,用户遇到的 Cloud Recents 会话在网页端已经不存在,但 Desktop 中仍然显示,并且 Archive 和 Delete 都失败。

GitHub Issue #41067


6. 为什么卸载重装和 Windows"重置"没有用?

因为真正残留的数据库位于:

text 复制代码
C:\Users\<用户名>\.codex\sqlite\codex-dev.db

而不是普通的应用安装目录。

卸载 ChatGPT Desktop 或执行 Windows:

text 复制代码
设置
→ 应用
→ ChatGPT
→ 高级选项
→ 重置

并不会一定删除:

text 复制代码
C:\Users\<用户名>\.codex

因此会出现:

text 复制代码
卸载 ChatGPT
    ↓
重新安装
    ↓
.codex\sqlite\codex-dev.db 仍然存在
    ↓
local_thread_catalog 仍然存在
    ↓
幽灵会话继续显示

这也解释了为什么清理:

text 复制代码
C:\Users\<用户名>\AppData\Roaming\Codex\web\Codex

没有解决问题。


7. 解决方法

首先完全退出 ChatGPT Desktop。

建议不要直接删除,先备份:

powershell 复制代码
Copy-Item `
"$env:USERPROFILE\.codex\sqlite\codex-dev.db" `
"$env:USERPROFILE\.codex\sqlite\codex-dev.db.backup"

然后删除或者重命名:

text 复制代码
C:\Users\<用户名>\.codex\sqlite\codex-dev.db

例如:

powershell 复制代码
Rename-Item `
"$env:USERPROFILE\.codex\sqlite\codex-dev.db" `
"codex-dev.db.old"

重新启动 ChatGPT Desktop。

程序会重新生成本地数据库。

我的实际测试结果:

text 复制代码
删除 codex-dev.db
        ↓
重新启动 ChatGPT Desktop
        ↓
幽灵会话全部消失

至此问题解决。


8. 注意事项

不要为了这个问题直接删除整个:

text 复制代码
C:\Users\<用户名>\.codex

.codex 目录中还保存了 Codex 本地线程、历史记录、Agent 状态等其他数据。

如果只是解决 ChatGPT Desktop 的幽灵会话问题,优先处理:

text 复制代码
C:\Users\<用户名>\.codex\sqlite\codex-dev.db

即可。

操作前建议遵循:

text 复制代码
完全退出 ChatGPT
↓
备份 codex-dev.db
↓
重命名或删除数据库
↓
重新启动 ChatGPT

9. 总结

如果遇到:

text 复制代码
网页端聊天已经删除
但 Windows Desktop 仍然显示

并且:

删除失败
归档失败
分享失败
置顶失败
卸载重装无效
Windows Reset 无效

可以重点检查:

text 复制代码
C:\Users\<用户名>\.codex\sqlite\codex-dev.db

以及其中的:

text 复制代码
local_thread_catalog

本次实际测试最终确认:

幽灵会话的 Desktop 本地目录记录存在于 codex-dev.db 中。删除并重新生成该数据库后,幽灵会话立即消失。

相关 GitHub Issues

  • #39989 --- Windows desktop keeps already-deleted ChatGPT conversations in Recents after full restart
  • #41602 --- Deleted conversations remain as stale titles in Windows app Recents
  • #40981 --- Can't delete conversation in desktop app
  • #41067 --- Cloud Recents threads cannot be archived and are absent from web

以上 Issue 都指向同一类 Windows Desktop 会话索引/Recents 同步异常,只是具体触发方式有所区别。

说明:本文基于 2026 年 9 月的 ChatGPT Windows Desktop 实际版本测试。后续版本可能调整 .codex 数据库结构或修复该问题。

相关推荐
Vex2une4 小时前
把 Windows 装进 U 盘随身携带:Windows To Go 现状与 WinToUSB 制作完全指南
windows·vhdx·windows to go·wintousb·便携windows·系统带进u盘·随身系统
ndz12 小时前
怎么查 ChatGPT / Perplexity 会不会推荐你的品牌
chatgpt
星恒随风1 天前
从0实现C++ AI大模型接入SDK(二):AI知识科普——从图灵测试到ChatGPT,人工智能的发展历程
linux·c++·人工智能·笔记·chatgpt
无奈笑天下1 天前
Wine适配Windows程序常见故障标准处理流程
linux·运维·服务器·windows
广东程序猿小展1 天前
PotPlayer 播放 4K 视频卡顿怎么办(硬解与渲染设置)
windows·工具·软件
xx z2 天前
Radmin LAN 怎么联机(虚拟局域网建房与加入教程)
windows·工具·软件
广东程序猿小展2 天前
谷歌相机配置文件怎么导入(GCam 配置导入与不生效排查)
windows·工具·软件
李小白杂货铺3 天前
Windows 桌面 GUI 原型快速开发技术选型指南(Mac 开发 + Windows 交付场景)
windows·原型·gui·原型开发·技术选型·快速开发·技术路线
承渊政道3 天前
magic-resume简历工具教程:Windows部署、在线编辑与远程访问
windows·远程访问·在线编辑·简历制作·工具教程·magic-resume