[BUG] Archiving a running session via the API gives no warning and the run continues
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 76/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
阅读 packages/core/src/session/session.ts,尤其是 Session.archive,并追踪代码如何检查会话是否已归档,以及交互式会话的执行状态如何表示。按照 HTTP API 步骤重现报告,并检查相关的会话测试。完成标准是:归档正在运行的交互式会话时遵循预期的拒绝或警告行为,并有测试覆盖该行为。
由索引模型根据 Issue 内容生成。
描述
Description
In 2.4.1 I archived a session through the HTTP API while it was still running. The request succeeded with no warning or confirmation, and the run continued until it finished. Right after archiving, the session was returned by the archived=true list and not by the archived=false list.
Session.archive in packages/core/src/session/session.ts returns early only when the session is already archived. It does not look at execution state.
I understand that background sessions are meant to stay archived while they run (#66348). This report is about an interactive session that is already running when I archive it.
I expected archiving a running session to be refused, or to at least warn that the run will continue. I did not test how each client shows a later permission request or question from that session.
For comparison, OpenAI's help center says that archiving a Codex chat in the ChatGPT app stops a running chat, and shows a confirmation when one applies.
Plugins
No response
OpenCode version
2.4.1
Steps to reproduce
- Create a session and ask it to run
sleep 60with Bash, then replyDONE. - While it runs, archive it:
PATCH /api/session/<id>with{"archived": true}. - Check the
archived=trueandarchived=falselists, then wait for the run to finish.
Screenshot
No screenshot. On my machine: archived at 10:00:12. The assistant turn in progress completed at 10:01:05, a new assistant reply was written at 10:01:05, and the session went idle at 10:01:06.
Operating System
Linux 6.12.116+deb13-amd64
Terminal
Not used for this reproduction; the session was archived through the HTTP API.
- 主要语言
- TypeScript
- 星标
- 228k
- 派生
- 31k
- 平均合并
- 5 小时 19 分钟
- 30 天内合并 PR
- 457
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
anomalyco/opencode 的其他 Issue
-
tui: Mermaid renderer displays <b>/<strong> tags literally and ignores \n line breaks可能已有人在做 @argszero 今天认领。 未关闭area/tui platform/wsl status/repro-simulated type/bug version/v2
难度 2/5 1-3 小时 新手友好度 82/100
anomalyco/opencode#66773 · 2 条评论 ·
维护者通常 1 天内回复
-
area/tui platform/linux type/feature version/v2
难度 2/5 1-3 小时 新手友好度 68/100
anomalyco/opencode#66585 · 1 条评论 ·
维护者通常 1 天内回复
-
area/web inference/go reproduced type/bug
难度 2/5 1-3 小时 新手友好度 84/100
anomalyco/opencode#66475 · 1 条评论 ·
维护者通常 1 天内回复
-
[FEATURE]: More colorful built-in Dracula theme for the desktop app可能重新可做 关联的 PR 已关闭且未合并。 未关闭area/desktop type/feature version/v2
难度 2/5 1-3 小时 新手友好度 68/100
anomalyco/opencode#66446 · 1 条评论 ·
维护者通常 1 天内回复
-
scripts: path comparisons break on Windows (check-greys fails the pre-push hook, upgrade-opentui skips nothing)可能已有人在做 @deosiree 于 2 天前认领。 未关闭platform/windows status/repro-plausible type/bug version/v2
难度 2/5 1-3 小时 新手友好度 76/100
anomalyco/opencode#66192 · 2 条评论 ·
维护者通常 1 天内回复
查看 anomalyco/opencode 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 67/100
knaw-huc/textannoviz#742 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
cloudflare/realtimekit-ui#219 ·
维护者通常 1 天内回复
-
ui
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
mermaid-js/mermaid-v13#1370 ·
维护者通常 1 天内回复
-
area:docs area:plugins bug documentation low-priority platform:windows
难度 1/5 1 小时以内 新手友好度 84/100
anthropics/claude-code#112676 ·