Skip to content

v0.22.0 — 任务管理页重做:工作流图 / workflow graph for the Tasks page

Choose a tag to compare

@Menghuan1918 Menghuan1918 released this 27 Sep 14:34
· 1025 commits to main since this release

中文

正式版(npm latest)。支持线不变:仅支持 DSH 0.1.7-rc.1+(peer 下限 ^0.1.7-rc.1),0.21.1 的用户直接升级即可;DSH 0.1.6-alpha.2 及更早仍请固定 v0.19.1。

这一版的主内容是把任务管理页从「子代理拓扑」重做成工作流图,以及随后几轮按真机反馈的打磨。

工作流图(新的主显示模式)

  • 会话树渲染为分层节点 + 贝塞尔连线的画布:拖拽平移、滚轮缩放到光标、内容包围盒居中适配(双击背景重新适配)、右下角控制条(图/树切换 + 折叠开关 + 缩放 + 适配)。经典缩进树保留(键盘可导航),两种模式共享同一个视图模型。
  • 双段式节点卡:上段 = 类型徽章(主代理 / 子代理 / 成员 / 工作流 / 已完成聚合)+ 相位徽标 + 名称 + 元信息;下段小条 = 状态点 + 状态词 + 主 Agent 同款合并活动行(并发工具归并 + 计数 + 在跑那条的细节,措辞取宿主 chat 词条)+ 折叠按钮。运行中小条从左到右完整扫过(prefers-reduced-motion 下关闭);8px 圆角、层级只用上段极淡底色、当前会话加粗 accent 描边。
  • 工作流 run 入图:从 tool-workflow/* 事件折叠(与官方面板同一批),run 挂在发起代理下、成员重挂并按相位分框、同色相位徽标;catalog 里没有的成员用 run 数据合成,跑完的 run 仍能看到成员。
  • 折叠分两组:✓ N 已完成(含出错,失败单独报 出错 N)与 N 个待命(跑完一轮、随时可被叫起来的 teammate)是两行;手动折叠按钮永远有效,自动聚合只在待命成员 ≥3 时收空闲成员;聚合卡名字行「前两个名字 + +N」,点聚合全部展开。

两个常驻浮动窗 + 团队任务板

  • 后台任务输出与共享任务详情/编辑都在可拖拽、可四边拉伸、内容区自滚动的浮动窗里,只靠关闭按钮或 Escape 结束(外部点击 / 失焦 / 锚点离屏都不关);任务窗把余量交给描述区,拉大是给内容更多空间而不是留白。
  • Agent Teams(实验层):成员富化到对应节点、常驻任务条列出成员与共享任务;状态机跟随宿主(待办 → 认领 → 进行中 → 完成 → 重开)+ 改派 / 编辑 / 两击删除,CAS 过期修订单独提示。
  • 后台任务改读宿主客户端 ctx.jobs:删掉自建的 jobs.list / jobs.output / jobs.kill 三条路由与事件回放镜像,彻底不碰模型 job_output 游标。

适配 DSH 0.1.7 的两处数据面重写

上游删掉了 agentTeams.remoteView 三个 Remote 方法,团队改为读 Lead Session 的 agentTeam Session projection(推送式,删掉 teams.view 路由与 5 秒轮询);写路径两条路由保留,拒绝从「返回联合」变为「抛 TeamError」,过期修订映射 409 team-conflict。修掉的真实故障:0.1.7 上团队条从来不渲染(路由报 remoteView is not a function,页面静默无提示)。

真机抓到、单测全绿的四个缺陷

逐节点折叠按钮点了没反应(被自动折叠的守卫卡住);「待命」卡片从不画折叠按钮;认领任务后标签错显「阻塞」;队列任务上「完成」必失败(需先认领)。

窄屏与手机设置

按原生右侧栏窄宽重新定档卡片与行距;设置页新增手机分组——窄屏(≤768px)不自动弹出新任务页、任务页默认树状图。


English

Stable release (npm latest). The support line is unchanged: DSH 0.1.7-rc.1+ only (peer floor ^0.1.7-rc.1), so v0.21.1 users can upgrade straight away; hosts on DSH 0.1.6-alpha.2 or earlier keep pinning v0.19.1.

The headline is the Tasks page rebuilt from a "subagent topology" into a workflow graph, plus several rounds of real-host polish.

The workflow graph (the new primary view)

  • The session tree renders as layered nodes joined by bezier edges: drag to pan, wheel-zoom to the cursor, fit to the content box (double-click the background to refit), and a control cluster bottom-right (graph/tree toggle + fold switch + zoom + fit). The classic indented tree is kept (keyboard-navigable), and both modes share one view model.
  • Two-segment node cards: the top segment is the kind badge (main agent / subagent / teammate / workflow / completed aggregate) + phase badge + name + meta; the bottom bar is the state dot + state word + the same merged activity line the main agent shows (concurrent tools grouped and counted, with the running call's detail, worded by the host's chat namespace) + a fold button. A running bar is swept across its whole width (disabled under prefers-reduced-motion); 8px-rounded, hierarchy carried by a faint top-segment tint only, the session you are on wearing a heavier accent border.
  • Workflow runs enter the graph: folded from tool-workflow/* events (the same events the official panel folds), a run hangs under its origin agent with member agents re-parented below and boxed per phase with matching badges; members with no catalog row are synthesized from the run's own data, so a finished run still shows who took part.
  • Folding split into two groups: ✓ N completed (including failures, called out as N failed) and N idle (teammates that finished a turn and can be called back at any moment) are two separate rows; the manual fold button always works, the automatic rule only sweeps idle members once there are 3 or more, and an aggregate's name line reads "first two names + +N".

Two persistent floating windows + the team board

  • Background-job output and the shared task's detail/edit surface live in windows that are draggable, resizable from every edge, with a self-scrolling body, dismissed only by the close button or Escape (no outside click / blur / anchor observer); the task window hands its spare height to the description, so enlarging it gives the content room rather than leaving a gap.
  • Agent Teams (experimental layer): members enrich their nodes and an always-visible strip lists the roster and shared tasks; the state machine follows the host (pending → claim → in progress → complete → reopen) with reassign / edit / two-step delete, and stale CAS revisions get their own notice.
  • Background jobs now read the host's client ctx.jobs: the plugin deleted its own jobs.list / jobs.output / jobs.kill routes and the event-replay mirror, and never touches the model's job_output cursor.

Two DSH 0.1.7 data-plane rewrites

Upstream deleted the three agentTeams.remoteView-style Remote methods, so team reads moved to the Lead Session's agentTeam Session projection (push-based; the teams.view route and its 5-second poll are gone); the two write routes stay, with rejections moved from a result union to a thrown TeamError and a stale revision mapped to a 409 team-conflict. The bug this fixed in the wild: on 0.1.7 the team strip never rendered at all (the route answered remoteView is not a function, and the page degraded silently).

Four defects caught on a real host, all green in unit tests

The per-node fold button did nothing (blocked by the automatic rule's guards); an idle card never drew a fold button; claiming a task mislabelled it "blocked"; and "complete" on a queued task always failed (a claim comes first).

Narrow panes and mobile settings

Card and row metrics re-tuned for the native right sidebar's narrow width; the settings page gained a Mobile group — on a narrow viewport (≤768px) the Tasks page no longer auto-opens and defaults to the tree view.


Full changelog / 完整变更:CHANGELOG.md · Design docs / 设计文档:docs/plans/