Skip to content

opencode web 归档与删除有什么不同? #15636

Closed as not planned
Closed as not planned

Description

@KaiSiMai

Question

Image 归档后,web sessions中不可见,但终端中还是可见。终端中只有删除没有归档。这是一个已知问题吗?

Activity

  1. github-actions commented on Mar 2, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. taoalpha commented on Mar 2, 2026

    @taoalpha

    FYI, deepwiki can be a great place to ask questions about the repo: https://deepwiki.com/search/difference-between-archive-and_8cc4bef0-de6f-457e-b5ce-ebde59723e68?mode=fast

    归档和删除是 opencode 中两种不同的会话管理操作:

    主要区别

    方面 归档 删除
    数据持久性 会话保留在数据库中,带有 time_archived 时间戳 1 会话从数据库中永久删除,使用级联删除 2
    UI 行为 会话从侧边栏移除但数据保留 3 会话从 UI 中移除,所有子会话递归删除 4
    恢复 可以通过清除 time_archived 来取消归档 无法恢复 - 永久删除

    实现细节

    归档操作

    setArchived 函数使用归档时间戳更新会话记录:

    .set({ time_archived: input.time })

    这会保留所有会话数据,同时将其从活动会话列表中隐藏。

    删除操作

    remove 函数执行完整的数据库删除:

    db.delete(SessionTable).where(eq(SessionTable.id, sessionID)).run()

    这会级联删除所有关联的消息和部分,并递归删除子会话。

    E2E 测试行为

    测试确认了差异 - 归档的会话保留其 ID 和 archived 时间戳,而删除的会话在获取时变为 undefined 5 。

    注意事项

    • 归档是可逆的 - 您可以恢复归档的会话
    • 删除是永久性的,包括清理共享 URL 6
    • 两种操作都会从主 UI 侧边栏中移除会话,但只有删除会将其从数据库中完全移除

    您可能想要探索的 Wiki 页面:

    Wiki pages you might want to explore:

    Citations

  3. github-actions commented on May 2, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

webRelates to opencode on web / desktop

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions