[FEATURE]: desktop: abort session when its conversation tab is closed
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 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 内容生成。
描述
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.tsxcloseTab->removeTabremoves the tab only; it does not callsession.abort.opencode:session-tabs-removedis 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.interruptthencommands.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 分钟
- 30 天内合并 PR
- 453
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
anomalyco/opencode 的其他 Issue
-
area/desktop platform/macos status/repro-plausible type/bug version/v2
难度 1/5 1-3 小时 新手友好度 88/100
anomalyco/opencode#67064 · 4 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 半天 新手友好度 82/100
anomalyco/opencode#67009 · 2 条评论 ·
维护者通常 1 天内回复
-
area/web type/feature version/v2
难度 2/5 1-3 小时 新手友好度 78/100
anomalyco/opencode#67001 · 3 条评论 ·
维护者通常 1 天内回复
-
skills: a Claude-compatible SKILL.md that fails to parse is dropped without any log可能已有人在做 @liwenjie200543 于 2 天前认领。 未关闭area/plugins platform/linux reproduced type/bug version/v2
难度 2/5 1-3 小时 新手友好度 72/100
anomalyco/opencode#66970 · 4 条评论 ·
维护者通常 1 天内回复
-
tui: Mermaid renderer displays <b>/<strong> tags literally and ignores \n line breaks可能已有人在做 @argszero 于 2 天前认领。 未关闭area/tui platform/wsl status/repro-simulated type/bug version/v2
难度 2/5 1-3 小时 新手友好度 82/100
anomalyco/opencode#66773 · 4 条评论 ·
维护者通常 1 天内回复
查看 anomalyco/opencode 的全部 Issue
相似的 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
ci
难度 2/5 1-3 小时 新手友好度 78/100
ClickHouse/clickhouse-js#1248 ·
维护者通常 1 天内回复
-
E2E: Darlehen-Test wartet auf die gebuchte Auszahlung, bevor er zur Liquiditätsvorschau wechselt未关闭technik
难度 2/5 1-3 小时 新手友好度 78/100
-
bug
难度 2/5 1-3 小时 新手友好度 67/100
SR5-FoundryVTT/SR5-FoundryVTT#2162 ·
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 84/100
AhmedNAgy25/analysor#25 ·
维护者通常 1 天内回复