Skip to content

[Feature] Source 被禁用后其工具应从工具列表注销,并支持按需暴露/Unregister tools of a disabled Source, optionally expose on demand #522

Open

Description

@SAXEM1997

提交前查重 / Duplicate check

  • 我已搜索 open/closed Issue,确认没有重复。 / I searched open and closed issues and found no duplicate.

搜索词:Source disabled、工具列表、按需、tool list、unregister。未发现同诉求条目。

涉及区域 / Affected area

  • 记忆空间或 Provider / Memory Spaces or Providers
  • CLI、RPC、命令或工具 / CLI, RPC, commands, or tools

Issue 类型 / Issue type

功能请求 / Feature request

摘要 / Summary

Source 被 disabled(未安装)后,其贡献的 17 个 mnemon_* 工具仍全部留在 agent 工具清单里,调用必报 Source memory-spaces is not installed;同时希望提供按需暴露,避免常驻 17 个工具占 schema token。

预期结果 / Expected outcome

  1. Source 未启用/未安装时,其贡献的工具不再出现在工具列表中(注册期按状态过滤,或停用时 disposition 注销),模型不会调到必然失败的工具;
  2. 可选:提供按需暴露机制(工具名 + 描述延迟注入,或元工具按需领取),使不使用记忆的会话不承担 17 个工具的 schema 开销;
  3. 验收:disabled: true 后新会话的工具清单不再出现该 Source 的工具;恢复 enabled 后重新出现。

详情或复现步骤 / Details or reproduction steps

复现步骤

  1. 在 profile 的 cordis.patch.yml 加入:
- id: mnemon-source-memory-spaces
  disabled: true
  1. 重启 dsh / 新开会话;
  2. 调用 mnemon_status → Error: Source memory-spaces is not installed;
  3. 调用 mnemon_memory_bodies → 同上;
  4. 检查工具清单:以下 17 个仍在
    mnemon_recall / remember / forget / link / related / status / memory_bodies / memory_body_create / memory_body_update / memory_body_merge / document_search / document_create / document_manage / runtime_memory / view_route / view_action / subagent_result。

当前行为

工具是静态注册的,与 Source 状态无关。View 层的 diagnostics 已经能识别不可用 Source(unavailable Sources are not evidence),但工具层不联动。

影响

  • 死工具长期占用每轮 schema token;
  • 模型会连续换工具重试(本机实测:一次误配置后连续 3 次换工具调用,全部报同一个错);
  • 对"这轮完全不用记忆"的会话,17 个工具是纯开销。

建议方案

  1. 最小修复:注册期按 Source 状态过滤;或 Source 停用时通过 disposer 注销其工具。
  2. 按需暴露:参考同类插件 qqbot 的 gain_qq_tools(元工具 list/search/enable/disable)。
  3. 可选配置:tools.enabled: string[] / tools.disabled: string[],让用户自行裁剪。

不在范围内 / Out of scope

  • Provider / Embedding 的配置行为;
  • 记忆数据迁移。

环境信息 / Environment

  • DSH 版本 / DSH version:0.2.1-rc.5(dsh web,本机自建容器)
  • dsh-mnemon 版本 / version:0.5.37
  • Mnemon 版本:随 dsh-mnemon 内置,未单独安装
  • 操作系统或浏览器 / OS or browser:Debian 12 容器,Node v22.23.4,Web 客户端 Chromium
  • 相关配置(已脱敏)/ Related configuration (redacted):
- id: mnemon
  config:
    storageScope: workspace
    runtimeUserScope: global
    memoryView:
      strategyTypeId: default-three-tier
      entries:
        include:mnemon-strategy-auto-capture:
          config:
            sourceKeys:
              - source:include:mnemon-source-memory-spaces
        include:mnemon-strategy-scoped:
          config: {}
        include:mnemon-source-memory-spaces:
          config: {}
- id: mnemon-source-memory-spaces
  disabled: true

补充信息 / Additional context

Activity

  1. github-actions commented on Oct 30, 2026

    @github-actions

    基础信息已补齐,后续由维护者排查和处理。
    Required report information is present. Maintainers will review the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions