Session Presentation protocol v2: an additive API for showing more than one Session at once (client-side, backward compatible) #4718
Replies: 3 comments 2 replies
|
Your premise checks out against the host's own slot declarations, and I can add first-hand evidence on both halves — because I built the workaround, and its limitations are exactly the argument for this API. 1. The single-slot property is declared twice, not just a default. I enumerated the web shell's
2. What an out-of-tree plugin CAN do today, and what it costs. My plugin ships a floating side-conversation panel. It occupies
So: showing a second conversation is possible today and is not what is missing. Mounting a second Session is what is missing, and it is missing because the 3. One backward-compatibility consequence I think your section under-states. Every That is not an objection; Interest disclosure: I maintain a third-party DSH plugin with a browser half, which is where the seat inventory and the overlay experience come from. The client runtime is DSH's own — we do not modify it and could not implement this; I am a consumer of the API you are proposing, not a competitor to it. |
|
I checked the proposal against the rc.2 runtime/renderer boundary. The
For transition completeness, I would also make “open while full” return a typed capacity result rather than silently replace; On naming, I wrote out the verified rc.2 boundary, transition table, capacity-holder rules, per-id provider shape, persistence validation, failure router, and 22 acceptance cases here: https://sandbaseai.github.io/deepseek-harness-handbook/multi-session-presentation-contract.html Disclosure: I maintain this independent SandBase handbook; the API recommendations are design analysis, not shipped DSH behavior. |
|
I would like to add a real-world plugin case based on dsh-v0.1.2-alpha.2.
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Motivation
Right now the render layer treats "the current Session" as a single slot: one Session is mounted, everything else is torn down or hidden when you switch. That's the right default for most usage, but it also means a whole category of workflows — comparing two conversations side by side, keeping a reference session open while working in another — can't be built as a plugin on stock DeepSeek Harness Web. The gap isn't a missing setting; it's that the pieces a plugin would need (a second mount point, a way to say "these two Sessions are both visible," the
Conversationinternals) aren't exposed on the client surface today. Any plugin trying to do this ends up forking internals rather than composing with the public API.@weijiafu14 went and enumerated the web shell's
SlotMapdeclarations from a real0.1.1-rc.2install — 43 seats — and found that the single-session constraint is enforced twice over:conversationis asingleseat, and theconversation.viewring, though itself alistseat, renders its session bodies one at a time viaonly: <active id>. That evidence also sharpens the gap this proposal is closing: a second conversation's data can already be shown today — for example, a customshell.overlaypanel with its own renderer and its own polled data — but a second Session cannot be mounted: reusing the hostConversationrenderer, getting session-scoped seats, taking host input, and showing up in lineage are all unavailable to a plugin, and mounting a second Session is exactly what this API is about.I've been running a fork with a small additive API that closes this gap, and wanted to bring the design here before going further with it, given external PRs are closed right now.
Proposed API sketch
A new face on
SessionRuntime, versioned so it can evolve independently of everything else:Behavior contract
visibleowns pane membership — left-to-right order is stable and only changes on explicitopen/close, never as a side effect of focus.focusedowns interaction routing only — changing focus never mounts, unmounts, or reorders panes.capacity: 1).capacity).visible; the underlying Session is untouched and remains addressable — closing a pane is not deleting a session.requestCapacity(n)is effect-scoped (returns a disposer) with max-wins arbitration across concurrent requesters, so plugins don't have to coordinate with each other directly.capacityis1, which reproduces existing single-session behavior exactly. A plugin that doesn't know aboutpresentationsees no change at all — fail-closed by construction.Session-scoped slots when capacity > 1
SessionProvider(sessionId)subtree.focusedgoverns interaction routing only; it is never the instantiation gate.capacity: 1(default) there is exactly one provider subtree — identical to current behavior.Reference implementation
There's a working implementation on my fork, offered here for review/cherry-picking — not as a PR (I know external PRs are closed), just so the shape is concrete rather than hypothetical, and I'm equally happy for it to be discarded if the team goes a different direction:
github.com/wanyexin1998/deepseek-harness, branchcodex/presentation-v2b150a551b8d465e31e418e1b2eaf5e79bbb7d28e(release0.1.1-rc.2)53015a6f39710dac52ed08f05aca0c6bad7444acclient/runtime— contract, service, and the presentation state machine;ui-layout— a two-columnAppFramegrid with split-ratio persistence, clamped 0.30–0.70;ui-renderer— session provider;ui-slots— renderer wiring). The remainder is unit tests, e2e snapshot tests, and architecture notes.0.1.1-rc.2client/runtime/sessions/service.d.tsalready says the staged state "can widen to a multi-pane list later" — so this may already be roughly where the team is headed, and I'd rather converge with that than duplicate it.A real-world consumer
I maintain DSH Workbench, a plugin that adds a two-pane split view (per-pane Navigator, shortcuts, a same-workspace warning, 187 tests) on top of this API. It's been a useful forcing function for the design — the contract above is shaped by actually building something against it, not written in the abstract.
Open questions for the team
visible/focusedsplit, or therequestCapacityarbitration model, from a client-runtime design standpoint?Happy to answer questions, share more of the diff, or just leave this here for whenever it's useful. Thanks for reading this far, and for keeping Discussions open for this kind of thing.
中文摘要 (TL;DR)
提案:在
SessionRuntime上新增一个小型、可独立演进的sessions.presentation接口(protocol: 2),让插件可以同时呈现多个 Session,而不是只有"当前 Session"这一个槽位。为什么插件做不到:现有渲染层一次只挂载一个 Session,且
Conversation相关内部组件未导出,所以"两个会话并排显示"这类需求无法在不改动客户端内核的前提下以插件形式实现。接口设计要点:
{ visible, focused?, capacity }:visible决定面板的稳定从左到右排列;focused只负责交互路由(哪个面板接收输入),切换焦点不会挂载/卸载/重排任何面板。open/focus/close;requestCapacity(n)是绑定到调用方生命周期的容量请求,多个请求方之间按"取最大值"仲裁。capacity为 1,与现状完全一致;未适配的插件行为不变(fail-closed,向后兼容)。capacity > 1时,session 级插槽按每个可见 Session 各实例化一份(各自绑定独立的SessionProvider(sessionId));focused只负责交互路由,从不决定实例化;capacity: 1时与现状完全一致;但不保证未按 session id 键控状态的现有插件在双实例并存时仍然安全。参考实现:已在个人 fork(
github.com/wanyexin1998/deepseek-harness,分支codex/presentation-v2,基于上游0.1.1-rc.2)完整实现并测试,约 500–600 行生产代码分布在四个 client 包中,其余为单元测试、e2e 快照测试与架构文档。提供出来仅供官方参考或摘取,并非 PR 请求——完全理解目前不接受外部 PR,官方也完全可以采纳、改造或直接不用。真实消费者:DSH Workbench 插件(双栏分屏、独立 Navigator、快捷键、同工作区提醒,187 个测试)目前基于此 fork 运行。
想请教官方的问题:"protocol 2" 这个编号是我单方面定的,愿意按官方习惯重新命名/编号/调整接口形状;这个方向是否与官方内部已有的多面板规划冲突;
visible/focused的划分和requestCapacity的仲裁方式是否合理。Edited 2026-08-27: folded in the 43-seat slot inventory evidence and the showing-vs-mounting framing from @weijiafu14's comment below, and added the "Session-scoped slots when capacity > 1" contract subsection.
All reactions