Skip to content

fix(client): 适配 Harness 0.1.6 会话接口(读取当前会话) - #7

Merged
yaojin3616 merged 1 commit into
dataelement:mainfrom
cinderzhan:fix/harness-016-sessions
Sep 22, 2026
Merged

yaojin3616 merged 1 commit into
dataelement:mainfrom
cinderzhan:fix/harness-016-sessions

Conversation

@cinderzhan

@cinderzhan cinderzhan commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

问题

Harness 0.1.6 移除了 sessions.list.getSnapshot().current。工作台依赖该字段时,开场白、自动解读、档案恢复和“跟着对话走”都会失效。

修改

本 PR 建立在 #6 的宿主身份方案之上,不再读取或传递 runtime workbenchId:

  • 优先通过 desktopWorkbenches.currentSession() 获取主视图会话。
  • 宿主服务尚不可用时,从 Harness 0.1.6 的 byId[id].retainedBy.mainView 读取。
  • 保留 Harness 0.1.5 的 snapshot.current 作为会话 API 回退;该回退与工作台身份迁移无关。
  • 工作台激活和会话归属分别通过 isActive() 与 ownsSession() 判断。
  • 覆盖 service、retained 和 legacy 三种会话来源,以及草稿门控和面板跟随。

验证

  • npm run check:8 项 DSH 测试、16 项 adapter 测试通过。
  • npm run check:distribution:通过。
  • git diff --check:通过。

尚未在真实 Desktop v0.10.0 中手动验证。

合并顺序

先合并 #6,再合并本 PR。

@yaojin3616
yaojin3616 force-pushed the fix/harness-016-sessions branch from fcdbfb6 to 05d0273 Compare September 22, 2026 07:24
@yaojin3616
yaojin3616 merged commit f978319 into dataelement:main Sep 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants