Skip to content

fix(chat): enable disk skills in slash menu for custom ACP agents - #1121

Merged
xintaofei merged 2 commits into
spacering-net:mainfrom
ana52070:fix/custom-agent-disk-skills
Nov 10, 2026
Merged

xintaofei merged 2 commits into
spacering-net:mainfrom
ana52070:fix/custom-agent-disk-skills

Conversation

@ana52070

Copy link
Copy Markdown
Contributor

描述 (Description)

修复自定义 ACP 智能体(如自建的 Google Antigravity 实例、或配置了独立/共享技能目录的自定义 Agent)在聊天输入框中无法显示和触发磁盘技能(Disk Skills)的问题。

背景与问题根因 (Background & Root Cause)

  1. 在之前 PR [bug]antigravity 斜杠没有加载skills #971 中,由于 Antigravity 官方 ACP 服务端(agy_acp_server)在协议中仅上报内置命令(/plan、/logout、/usage)而从不上报技能命令,引入了 diskSkillTrigger 将 Antigravity 的磁盘技能挂载到输入框 / 菜单下。
  2. 然而 diskSkillTrigger 之前仅硬编码了 antigravity 与 open_code,对自定义智能体(isCustomAgentType(agentType),即 custom:<id>)直接返回 null。
  3. 自定义 ACP 智能体(例如用户使用 agy_acp_server 搭建的自定义 Antigravity 智能体,或任何声明了 skillsDir / skillsSharedStore 的自定义 Agent)并不通过 ACP 广播技能命令;diskSkillTrigger 返回 null 导致:
    • useAgentSkills 传入 null,前端不会请求磁盘技能列表,availableSkills 永远为空;
    • 输入框输入 / 时无法弹出磁盘技能候选菜单;
    • 手动输入技能名(如 /smart-dispatch)无法被识别为技能引用徽标(Token Badge);
    • 自动化配置与历史消息中的技能徽标无法被正确识别。

修复方案 (Solution)

  • 在 src/components/chat/composer/invocation-reference.ts 中引入 isCustomAgentType,将自定义 ACP 智能体纳入 diskSkillTrigger 的 / 触发范围。
    • 由于 skillsForMenu 自身已有对 commands 的去重过滤机制,若某自定义 Agent 同时存在同名命令也会被安全过滤。
    • 若自定义 Agent 未配置技能目录,后端 acp_list_agent_skills 返回 supported: false,useAgentSkills 自然保持空列表,完全平稳兼容。
  • 更新 invocation-reference.test.ts,移除将 custom:x 视为 null 的断言,补充自定义 ACP 智能体触发 / 技能的单测用例。
  • 在 message-input.test.tsx 补充针对自定义 ACP 智能体斜杠菜单下列出磁盘技能的集成测试。

验证情况 (Verification)

  • 单元测试 (Unit Tests):
    • src/components/chat/composer/invocation-reference.test.ts (23 passed)
    • src/components/chat/message-input.test.tsx (118 passed)
    • 合计 141 个用例全部通过。
  • 代码规范 (Lint & Format):
    • 运行 ESLint 与 Prettier 校验,无报错与警告。

ana52070 and others added 2 commits November 10, 2026 22:02
Custom ACP agents (e.g. user-configured Antigravity instances, or custom
agents with declared skill directories) do not advertise skills as ACP
commands; their skills live on disk. Previously diskSkillTrigger returned
null for custom agents, preventing skills from being scanned and displayed
in the slash menu.

Include custom agents in diskSkillTrigger so that their disk skills are
scanned and listed under '/' in the composer.
…ser menus

The disk-skill trigger now covers custom ACP agents, but the comments in
the chat composer and the automation editor still named only Antigravity
and OpenCode. Say that a custom agent's scan follows the skill directories
its user declared, and that a skill it also advertises as a command is
dropped by skillsForMenu.
@xintaofei

Copy link
Copy Markdown
Collaborator

codeg work task 505 is done — #1121 (3 files, +14/-7).

@xintaofei
xintaofei merged commit c340c76 into spacering-net:main Nov 10, 2026
10 checks passed
xintaofei added a commit that referenced this pull request Nov 11, 2026
This release reduces memory growth during extended use, fixes missing collaboration tools in forked Codex conversations, restores skill selection for custom agents, and updates several agents.

## Improved

- **Claude Code is updated to 2.1.322 with adapter 0.106.0.**
- **Updated OpenCode to 2.2.7, Kimi Code to 2.5.3, Hermes Agent to 0.23.1 and the ZCode bridge to 0.83.3.**

## Fixed

- **Reduced memory buildup during repeated scrolling, view changes and streaming code generation**, improving memory usage during extended sessions. (#1114, #1115, #1117 by @kogekiplay)
- **Custom agents with a configured skill directory or shared skill store now list their skills in the `/` menu**, in both chat and automation editors. (#1121 by @ana52070)
- **Forked Codex conversations retain their enabled MCP tools**, allowing you to continue delegating work to sub-agents and retrieving their results. (#1105)
- **Reopening a conversation no longer adds duplicate context compaction cards after the existing history.**
- **OpenCode commands that time out or are terminated no longer incorrectly appear as successful.**
- **OpenCode file previews correctly display reads beyond the end of a file**, while reads counted from the end no longer show a misleading line range.
- **Reopening older ZCode conversations correctly restores their saved titles.**

Thanks to @kogekiplay (#1114, #1115, #1117) and @ana52070 (#1121) for their contributions, and to @lxpsxx (#1105) for the report.

-----------------------------

# 发布版本 0.42.3

这一版改善长时间使用时的内存占用,修复 Codex 分叉会话后协作工具丢失、自定义智能体无法选择技能等问题,并更新多个智能体。

## 改进

- **Claude Code 更新至 2.1.322,适配器更新至 0.106.0。**
- **OpenCode 更新至 2.2.7,Kimi Code 更新至 2.5.3,Hermes Agent 更新至 0.23.1,ZCode 桥接更新至 0.83.3。**

## 修复

- **减少反复滚动、切换视图和持续生成代码时的内存累积**,改善长时间使用时的内存占用。(#1114、#1115、#1117 by @kogekiplay)
- **配置了技能目录或共享技能库的自定义智能体,可以在 `/` 菜单中选择技能**,聊天输入框和自动化编辑器均可使用。(#1121 by @ana52070)
- **Codex 分叉会话后会保留已启用的 MCP 工具**,可以继续委派子智能体并获取执行结果。(#1105)
- **重新打开会话时,已有的上下文压缩卡片不会再重复出现在历史记录末尾。**
- **OpenCode 中超时或被终止的命令,不再被误标为执行成功。**
- **OpenCode 读取位置超出文件末尾时,返回内容仍能正确预览**,从文件末尾倒数读取时也不会再显示错误的行号范围。
- **重新打开较早的 ZCode 会话时,能正确恢复已保存的会话标题。**

感谢 @kogekiplay(#1114、#1115、#1117)和 @ana52070(#1121)的贡献,以及 @lxpsxx(#1105)的反馈。
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