Skip to content

在 DSH 0.1.0-rc.7 上安装后 dsh web 无法启动:keyed slot "settings.plugin.item" requires options.key #1

Description

@znxkxx

环境

  • 插件:dsh-reasoning-settings v0.3.0
  • DSH:@deepseek-ai/dsh ^0.1.0-rc.7(npx 安装)
  • 安装方式:dsh plugin --profile web add github:JuneLearn/dsh-reasoning-settings
  • 平台:Windows / Node v22.23.2 / pnpm 11.22.0

问题

安装插件后执行 dsh web,启动直接失败,报错:

HARNESS
Failed to load plugins
dsh-reasoning-settings
failed to apply loader entry c4addc8e (dsh-reasoning-settings): keyed slot "settings.plugin.item" requires options.key

移除插件后启动恢复正常。

根因分析

settings.plugin.item 是一个 keyed 插槽(官方声明见 dsh-client-ui-settings-plugins

children: { "settings.plugin.item": { kind: "keyed", scope: "root" } }

官方往该槽注册卡片时都带 key

ctx.slots.register({ name: "settings.plugin.item", key: SHELL_NS, ... }, BashCard)

而本插件客户端代码 lib/client.jsapply() 里注册时用的是 id 而没有 key

ctx.slots.inject('settings.plugin.item', () => ctx.slots.register({
  name: 'settings.plugin.item',
  id: 'reasoning',      // ← keyed slot 要求 options.key
  order: 20,
  locale: 'settings.reasoning',
  inject: () => ({ api: connection.api, remote: ctx.remote, t }),
}, ReasoningCard))

在 DSH rc.7 中,加载器会强制校验 keyed 插槽的注册必须携带 options.key,因此启动失败。

建议修复

id: 'reasoning' 改为 key: 'reasoning'(或两者同时保留),与官方写法保持一致。

复现步骤

  1. 在 DSH rc.7 上安装 v0.3.0;
  2. 运行 dsh web
  3. 启动失败,输出上述报错。

谢谢!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions