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 数据库结构或修复该问题。

相关推荐
万年咸鱼1 小时前
Java List 接口详解:从基础到实战
java·windows·list
Neighbor_OldY1 小时前
【实战复盘】RDP暴力破解与内网横向移动溯源:Windows全套排查命令与事件ID硬核解析
运维·windows·web安全
深念Y2 小时前
Windows 11 工具链部署与 SSH 踩坑笔记
windows·笔记·ssh
可爱系程序猿4 小时前
Windows 11 添加共享打印机提示 0x00000bc4:从 RPC 发现到策略配置排查
windows·网络协议·rpc
草莓熊Lotso1 天前
【Redis 初阶】Set 类型深度解析:去重集合的运算能力与实战场景
linux·网络·数据库·windows·redis·tcp/ip·缓存
AI砖家1 天前
Codex 客户端频繁提示「正在重连 / Reconnecting」的原因与完整解决方案
人工智能·chatgpt·ai编程·codex
YH55269842 天前
如何减少大模型的token消耗?日常使用,可以通过什么方式减少大模型 token 的消耗
gpt·chatgpt·github
郝学胜-神的一滴2 天前
C++11 工程级应用 06:自己造一个类似Python的Range迭代器
开发语言·c++·windows·python·程序人生·microsoft
richard_first2 天前
从 ChatGPT 到机器人:NVIDIA Jetson Orin Nano 2 背后的 Physical AI 浪潮
人工智能·chatgpt·机器人