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

オープン
#66,877 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript
領域
desktop

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.
主要言語
TypeScript
スター
230k
フォーク
31.3k
平均マージ
5時間 32分
マージ済み PR(30日)
453

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

anomalyco/opencode のほかの issue

anomalyco/opencode の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。