[BUG] Archiving a running session via the API gives no warning and the run continues

未关闭 适合新手
#66,604 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
76/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript

调研方向

阅读 packages/core/src/session/session.ts,尤其是 Session.archive,并追踪代码如何检查会话是否已归档,以及交互式会话的执行状态如何表示。按照 HTTP API 步骤重现报告,并检查相关的会话测试。完成标准是:归档正在运行的交互式会话时遵循预期的拒绝或警告行为,并有测试覆盖该行为。

由索引模型根据 Issue 内容生成。

描述

area/sdk-api platform/linux type/feature version/v2
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
  1. Create a session and ask it to run sleep 60 with Bash, then reply DONE.
  2. While it runs, archive it: PATCH /api/session/<id> with {"archived": true}.
  3. Check the archived=true and archived=false lists, 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

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

anomalyco/opencode 的其他 Issue

查看 anomalyco/opencode 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。