[Bug]: Switching away from and back to a running conversation fails with "this session is already open in another Reasonix window or still running in the background"
Version line / 版本线
v2 — Go rewrite (1.x), main-v2 (active development)
Exact version / 具体版本
1.19.7 (desktop-v1.19.7, reasonix-desktop.exe)
OS / platform / 操作系统
Windows 11 Pro 10.0.26200 (x64)
What happened? / 问题描述
单窗口的桌面应用中,当一个会话仍在运行回合(模型流式输出 / 工具调用 / 有待确认项)时,切换到另一个会话再切回来,经常报启动错误横幅:
In the desktop app with a single window open, while a conversation is still running a turn (streaming / tool calls / pending confirmation), switching to another conversation and switching back frequently fails with this startup error banner:
启动错误: this session is already open in another Reasonix window or still running in the background; close the other window or open a copy
观察结果 / Observations:
- 实际只有一个 Reasonix 窗口/进程;错误文案中的 "another Reasonix window"(另一个窗口)在单窗口场景下具有误导性。 There is only one Reasonix window/process; the "another Reasonix window" wording is misleading here.
- 唯一可靠的恢复方式是重启 Reasonix。 The only reliable recovery is restarting Reasonix.
- 重启后,应用会自动把会话恢复为副本("Recovered unsaved changes from stale runtime",
recovery_reason: snapshot conflict),但卡住的回合及其待确认状态没有恢复:侧栏中该会话显示待确认徽标,打开会话却没有确认弹窗,回合也永远不会推进(卡住点之后没有任何新消息)。 After restart the conversation is auto-recovered as a copy, but the stuck turn's pending confirmation is not recovered: the sidebar shows a待确认badge, opening it shows no confirmation dialog, and the turn never progresses. - 该问题已多次发生(恢复副本上
recovery_depth: 2)。 This has recurred multiple times (recovery_depth: 2).
Steps to reproduce / 复现步骤
- 打开一个会话并开始一个回合(最好会产生待确认 / 工具审批,例如会修改
config.toml的回合)。 Open a conversation and start a turn (ideally one that produces a pending confirmation / tool approval — e.g. editingconfig.toml). - 回合仍在运行时,切换到另一个会话。 While the turn is still running, switch to another conversation.
- 再切回第一个会话。 Switch back to the first conversation.
- 出现启动错误横幅。
Observe the startup error banner:
this session is already open in another Reasonix window or still running in the background; close the other window or open a copy. - 重启 Reasonix;会话被恢复为副本,但待确认项仍然卡死(
待确认徽标、无弹窗)。 Restart Reasonix; the conversation is recovered as a copy, but the pending confirmation stays stuck (待确认badge, no dialog).
期望 / Expected:同一窗口内切回应能重新连接到正在运行的会话(同一进程),或至少弹出待确认对话框。
Switching back within the same window should re-attach to the running session (same process), or at least surface the pending confirmation dialog.
Relevant logs or output / 相关日志或输出
启动错误: this session is already open in another Reasonix window or still running in the background; close the other window or open a copy
来自会话文件的底层证据 / Underlying evidence from session files:
<session>.jsonl.lease.json记录了writer_id: hostname-pid-<random>、pid、hostname、acquired_at;切换标签页时 lease 不会释放,因此重新 attach 时会认为该会话仍被"另一个窗口 / 后台"持有。 The lease is not released when switching tabs, so a re-attach sees the session as still held by "another window / background".- 恢复副本的
.meta中残留一个永远不会结束的in_flight_turn(started_at远早于报错时间),这正是"待确认"徽标无弹窗的原因。 The recovered copy's.metakeeps a stale, never-finishedin_flight_turn, which drives the stuck待确认badge with no dialog.
Screenshots / 截图
图片1:会话列表显示"待确认"徽标
Image 1: conversation list showing the stuck 待确认 badge
图片2:红色报错横幅与卡住的对话 Image 2: the error banner and the stuck conversation