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

Đang mở Phù hợp với người mới
#66,604 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
76/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
backend-api-design

Hướng nghiên cứu

Đọc packages/core/src/session/session.ts, đặc biệt là Session.archive, và theo dõi cách kiểm tra xem một phiên đã được lưu trữ hay chưa cũng như cách biểu diễn trạng thái thực thi của các phiên tương tác. Tái hiện báo cáo bằng các bước của HTTP API và kiểm tra các bài kiểm thử phiên liên quan. Công việc được xem là hoàn tất khi việc lưu trữ một phiên tương tác đang chạy tuân theo hành vi từ chối hoặc cảnh báo dự kiến và có bài kiểm thử bao quát trường hợp đó.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
228k
Fork
31k
Merge trung bình
5 giờ 19 phút
Pull request đã merge (30 ngày)
457

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của anomalyco/opencode

Tất cả issue của anomalyco/opencode

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.