Repository navigation
fix(host): Web 目录不再列出临时侧边聊天 / keep temporary side chats out of the Web catalog - #1198
Conversation
Filter ephemeral rows after merging catalog sources and omit their IDs from the local archive summary. Scoped Thread lists still have the full record set for ancestry checks.
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
|
感谢修复!改动精准收敛,过滤临时侧边聊天与 Desktop 语义一致且文档单测齐备,现已合并。 |
摘要
Desktop 打开临时侧边聊天时,用
thread/fork加ephemeral: true从主对话 Fork 出子 Thread(见docs/architecture/external-thread-side-chats.md)。外部 Harness 的这类 Thread 由 Host 写入 mapping store 并一直保留。官方 Desktop 的侧栏不显示它们:Desktop 26.1120 的shouldSurfaceRecentConversation只显示满足三个条件的会话:不是ephemeral,没有attachedToThreadId,也不是sideConversation。Web 侧栏读取的
codexhost/thread/catalog/read没有这项过滤,所以每个临时侧边聊天在 Web 中都是一条独立的顶层会话:现在
readThreadCatalog()的行为:ephemeral行,threads与ownership仍一一对应。来自sharedThreads的临时行也一并去掉。archivedThreadIds也不再包含临时 Thread。thread/list不变。Desktop 自己会隐藏这些会话,而带parentThreadId的范围列表仍可能需要临时 Thread 下的 Subagent 记录。thread/read、置顶会话补读和直链。docs/architecture/external-thread-side-chats.md补充了 Web 目录的这条规则。thread/list一行改为「不含挂靠的侧边聊天」,与实现一致。关联 Issue
无 / N/A
测试
基于
main(0e5029124),macOS 27.2.1(arm64),Node 26.0.0:npx vitest run --config tests/vitest.config.js packages/host-runtime/test/thread-catalog.test.ts packages/host-runtime/test/app-server-host.thread-catalog.test.ts:26 个通过。thread-catalog.test.ts的两条既有用例加入了三种临时 Fork(本地未归档、本地已归档、共享来源),以及一个应当保留的持久 Fork。thread-catalog.ts的改动后,这两条用例失败:多出 3 条临时行和 1 个归档 ID。prettier --check通过,eslint没有报错。UI Demo
这是示意图,不是 Web 实机截图:用修改前后的
readThreadCatalog()和 Web 的threadListTitle()处理同一组合成记录,再把得到的标题画成简化的侧栏。修复前,一个本地 Claude Code 临时 Fork 和一个共享来源的 Pi 临时 Fork 都以继承来的预览「Compare the release notes」为标题出现;修复后只剩来源会话和持久 Fork。Summary
Desktop opens a temporary side chat by forking a child Thread from the main conversation with
thread/forkandephemeral: true(seedocs/architecture/external-thread-side-chats.md). For external Harnesses, the Host writes these Threads to the mapping store and keeps them. The official Desktop does not show them in its sidebar. In Desktop 26.1120,shouldSurfaceRecentConversationshows a conversation only if it meets three conditions: it is notephemeral, has noattachedToThreadId, and is not asideConversation.The Web sidebar reads
codexhost/thread/catalog/read, which had no such filter, so every temporary side chat shows up in the Web as a separate top-level Thread:What
readThreadCatalog()does now:ephemeralrows after merging the sources, sothreadsandownershipstay aligned. Temporary rows fromsharedThreadsare dropped too.archivedThreadIds, no longer includes temporary Threads either.thread/listis unchanged. Desktop already hides these conversations, and scoped lists withparentThreadIdmay still need the Subagent records under a temporary Thread.thread/read, the pinned-thread fallback and direct links.docs/architecture/external-thread-side-chats.mddescribes this catalog rule. Thethread/listrow now says "other lists do not include attached side chats", matching the implementation.Related issues
N/A
Test plan
On
main(0e50291), macOS 27.2.1 (arm64), Node 26.0.0:npx vitest run --config tests/vitest.config.js packages/host-runtime/test/thread-catalog.test.ts packages/host-runtime/test/app-server-host.thread-catalog.test.ts: 26 passed.thread-catalog.test.tsnow include three temporary forks (local live, local archived and shared) and one persistent fork that must stay.thread-catalog.ts, both cases fail: 3 extra temporary rows and 1 extra archived ID.prettier --checkpasses andeslintreports no errors on the changed files.UI Demo
This is a schematic, not a screenshot of a running Web page. The old and new
readThreadCatalog()and the Web'sthreadListTitle()processed the same synthetic records, and the resulting titles were drawn as a simplified sidebar. Before the fix, a local Claude Code temporary fork and a shared Pi temporary fork both appear, titled with the inherited preview "Compare the release notes". After the fix, only the source Thread and the persistent fork remain.