BitFun icon indicating copy to clipboard operation
BitFun copied to clipboard

[Bug] 切换会话/工作区时 manage_dialog_queue 返回 "Session is not loaded on the execution host"

Open QZQ-go opened this issue 4 weeks ago • 0 comments

关联:#3728(同批次排查中的渲染进程卡顿)、#3275(同为 SSH 工作区与本地工作区共存时的消息发送失败,已修复的相邻问题)

环境

  • OpenBitFun 1.0.8(com.openbitfun.desktop)
  • macOS(Apple Silicon)
  • 工作区同时存在本地会话与远程 SSH 工作区会话

问题描述

在会话之间切换(尤其是本地工作区 ↔ 远程 SSH 工作区来回切)时,前端 manage_dialog_queue 请求持续失败:

[TauriAdapter] Request failed
{"action":"manage_dialog_queue","error":"Session is not loaded on the execution host"}

1 分 16 秒内连续失败 7 次(16:58:01 → 16:59:17)。每次失败都紧跟在 [AuxPane] Active session changed 之后,说明触发点是会话切换。

关联现象

同一时刻 WorkspaceManager 在 0 ms 内连续发出两个相反事件:

16:58:22.403  [WorkspaceManager] Emitting event {"type":"workspace:loading"}
16:58:22.403  [WorkspaceManager] Emitting event {"type":"workspace:error"}

以及远程工作区的兼容服务不可用:

{"action":"get_external_source_control_snapshot",
 "error":{"code":"host_unavailable",
          "detail":"The remote workspace is not running the external compatibility service",
          "retryable":true}}
[ChatInput] External prompt commands are unavailable on this host {"code":"host_unavailable"}

复现步骤

  1. 打开一个本地工作区会话并保持激活。
  2. 切换到远程 SSH 工作区的会话(本例为通过 SSH 连接的远端主机)。
  3. 再切回本地会话,或切到另一个会话。
  4. 观察控制台:manage_dialog_queue 返回 Session is not loaded on the execution host。

本机已有远程连接处于 is_connected=true(后端日志 ssh_is_connected 确认),因此不是 SSH 掉线导致。

实际影响

  • 每次切换都会在前端抛一个未处理的失败请求,workspace:loading 后立即 workspace:error,工作区状态机进入错误分支。
  • 怀疑这与同时段输入框的交互异常相关(切换后输入框短暂不可用)。

完整日志(已脱敏)

evidence-B-dialog-queue-errors.log
# 来源: webview.log  时间: 2026-11-04 16:57~17:01 (UTC+8)
# 每次切换会话/工作区,manage_dialog_queue 均返回
# "Session is not loaded on the execution host"

# 证据 B:manage_dialog_queue 调用失败(已脱敏)
# 来源: webview.log  时间: 2026-11-04 16:57~17:01 (UTC+8)
# 判读要点: 每次切换会话/工作区,前端调用 manage_dialog_queue 均收到
#   "Session is not loaded on the execution host";WorkspaceManager 在同一毫秒内
#   连续发出 workspace:loading 与 workspace:error(相隔 0ms)。

[2026-11-04T16:58:01.255][tid:1][DEBUG][webview] [AuxPane] Active session changed, swapping agent canvas snapshot {"from":"edac7bb9-cfdd-4bb0-8e64-db2bbc8131f4","to":"149ac9af-bca4-4d4a-a788-b38d03fa4746"}
[2026-11-04T16:58:01.454][tid:1][ERROR][webview] [TauriAdapter] Request failed {"action":"manage_dialog_queue","error":"Session is not loaded on the execution host"}
[2026-11-04T16:58:03.304][tid:1][ERROR][webview] [TauriAdapter] Request failed {"action":"manage_dialog_queue","error":"Session is not loaded on the execution host"}
[2026-11-04T16:58:22.332][tid:1][DEBUG][webview] [AuxPane] Active session changed, swapping agent canvas snapshot {"from":"149ac9af-bca4-4d4a-a788-b38d03fa4746","to":"deb8d08b-b259-4045-8d7b-68ff814d1659"}
[2026-11-04T16:58:22.403][tid:1][DEBUG][webview] [WorkspaceManager] Emitting event {"type":"workspace:error"}
[2026-11-04T16:58:22.407][tid:1][ERROR][webview] [TauriAdapter] Request failed {"action":"manage_dialog_queue","error":"Session is not loaded on the execution host"}
[2026-11-04T16:58:32.438][tid:1][ERROR][webview] [TauriAdapter] Request failed {"action":"manage_dialog_queue","error":"Session is not loaded on the execution host"}
[2026-11-04T16:58:37.764][tid:1][ERROR][webview] [TauriAdapter] Request failed {"action":"manage_dialog_queue","error":"Session is not loaded on the execution host"}
[2026-11-04T16:58:47.766][tid:1][ERROR][webview] [TauriAdapter] Request failed {"action":"manage_dialog_queue","error":"Session is not loaded on the execution host"}
[2026-11-04T16:58:59.941][tid:1][DEBUG][webview] [WorkspaceManager] Emitting event {"type":"workspace:error"}
[2026-11-04T16:59:00.088][tid:1][DEBUG][webview] [HistorySessionDiagnostics] Historical session diagnostic event {"diagnosticId":"149ac9af-189149417-156","sessionId":"149ac9af-bca4-4d4a-a788-b38d03fa4746","event":"switch_requested","ageMs":0,"switchRequestId":942,"isRemoteSession":false,"isHistorica…
[2026-11-04T16:59:00.096][tid:1][DEBUG][webview] [AuxPane] Active session changed, swapping agent canvas snapshot {"from":"deb8d08b-b259-4045-8d7b-68ff814d1659","to":"149ac9af-bca4-4d4a-a788-b38d03fa4746"}
[2026-11-04T16:59:16.929][tid:1][DEBUG][webview] [AuxPane] Active session changed, swapping agent canvas snapshot {"from":"149ac9af-bca4-4d4a-a788-b38d03fa4746","to":"c4d7307b-fb01-487c-8059-2d14b29e375c"}
[2026-11-04T16:59:17.029][tid:1][ERROR][webview] [TauriAdapter] Request failed {"action":"manage_dialog_queue","error":"Session is not loaded on the execution host"}

期望行为

  • 会话尚未在目标执行宿主加载时,应将队列管理请求降级为 no-op 或可重试状态,而不是抛错误。
  • workspace:loading 与 workspace:error 不应在同一毫秒内连续发出,状态机需要去重/防抖。
  • 远程工作区缺少 external compatibility service 时,ChatInput 应静默跳过,而非走错误路径。

QZQ-go avatar Nov 04 '26 09:11 QZQ-go