[FEATURE]: desktop: abort session when its conversation tab is closed

Đang mở
#66,877 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
desktop

Hướng nghiên cứu

Start in packages/app/src/context/tabs.tsx, where closeTab calls removeTab and never calls session.abort. Check how the Stop action calls session.abort or session.interrupt so the tab-close path can reuse it. Done means closing a tab with a setting enabled stops the running session, and the existing close behaviour stays unchanged when the setting is off. The default (opt-in or on) still needs a maintainer decision.

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

Mô tả

area/desktop platform/windows type/feature version/v2
Feature hasn't been suggested before.
  • I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request

Problem

In OpenCode Desktop, closing a conversation tab only removes the UI view. The agent keeps running on the server and keeps appending messages/tokens after the tab is closed. There is no setting or hook to make a tab close stop the session, so an abandoned tab can burn tokens indefinitely.

Proposal

Add an option (and/or make it the default) to abort the session's active run when its conversation tab is closed, equivalent to pressing Stop (session.abort / session.interrupt). Suggested behavior:

  • Setting: "Stop session when its tab is closed" (opt-in, or on by default).
  • Applies to the tab close button (X) and to Ctrl/Cmd+W.
  • Optional modifier (e.g. Ctrl+Shift+W) to close without stopping, for users who want the current behavior.

Why it matters

  • Prevents abandoned sessions from consuming tokens and writing history.
  • Matches the natural expectation that closing the conversation ends it.
  • Complements session.idle: closing a tab is a clear signal the user is done with that run.

Current behavior and workarounds

  • packages/app/src/context/tabs.tsx closeTab -> removeTab removes the tab only; it does not call session.abort.
  • opencode:session-tabs-removed is dispatched only by archive/delete/server-removal paths, not by user-initiated tab close, so a GUI plugin cannot hook the X button.
  • Workaround today: press Stop before closing, or run a watchdog that interrupts long-running sessions.
  • A GUI plugin can register a command bound to a key that calls session.interrupt then commands.run("tab.close"), but it cannot intercept the X button.

Environment

  • OpenCode Desktop 2.3.0 (opencode-cli 2.3.0), Windows x64.
  • Reproduced consistently by closing a tab while a multi-step agent run is in progress.
Ngôn ngữ chính
TypeScript
Star
230k
Fork
31.3k
Merge trung bình
5 giờ 32 phút
Pull request đã merge (30 ngày)
453

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.